G-05Test-driven Agent

/coding-agents/test-driven

Write the failing test first; the test then defines “done” unambiguously.

Step-by-step walkthrough4 steps
  1. The spec becomes a test before it becomes code.
  2. Red first — and failing for the right reason, or the test is wrong.
  3. The failing test is an unambiguous definition of done.
  4. Green. The agent can’t declare victory early — the test won’t let it.
Key insight

TDD fixes the coding agent’s worst habit — declaring victory early. The agent cannot argue with a red test.

Failure mode

The agent writes a test that asserts its implementation rather than the spec: green, and wrong.

Elsewhere in the atlas