| name | sdlc-test |
| description | Use BEFORE generating implementation code for any feature with verifiable behavior. Writes the tests (and evals, if output quality is judgment-based) FIRST, as the contract that defines "correct," so the agent implements against a real target instead of a vibe check. Make sure to use this whenever you say "implement", "write the code for", "build the function/endpoint/feature" - intercept and do tests first - and also on "write tests" or "add coverage". Third step of the SDLC loop and the single highest-leverage habit. |
sdlc-test - write the contract before the code
Third beat of the SDLC loop, and the paper's #1 individual practice: write tests and evals before generating code. A well-written test/eval suite communicates intent more precisely than any prompt and is what turns vibe coding into agentic engineering. It also gives the agent a target to self-correct against.
Why this matters
Tests and evals are how you tell the agent what "correct" means in a form it can check itself - the feedback loop that lets it iterate to green instead of you eyeballing output. Tests catch the deterministic failures; evals catch the non-deterministic ones. Without both, it's vibe coding no matter how good the prompt was.
Tests vs. evals (use the right one)
- Tests - deterministic behavior: given input X, produce output Y. Compiles, returns 3, handles the empty list. Most features need these.
- Evals - non-deterministic / judgment behavior: did an agent or LLM-backed feature produce a response that meets a quality bar? Scored by a rubric, not an assertion. Only needed when the output is a judgment, not a fact.
Procedure
- Turn success criteria into tests. Take the criteria and edge cases from
sdlc-plan and write a test for each - especially the unhappy paths. Edge cases without a test tend to never get handled.
- Make them fail first. Run the tests against no/empty implementation and confirm they go red. A test that passes before any code is a test that proves nothing.
- Add an eval rubric only if output is judgment-based. Score the few things a test can't: does it meet intent, is the approach sane. Keep it small (see
sdlc-review's rubric).
- Keep tests behavioral. Test through public interfaces, not implementation details (per AGENTS.md), so they survive refactors.
Output
- Test files covering criteria + edge cases, confirmed red.
- (Only if needed) a short eval rubric file.
Gate
Tests exist and fail before sdlc-implement writes code. The definition of "done" for implementation is: these go green.
References
Load these as needed: