Test-driven development begins by expressing expected behavior as an executable test. The developer observes the test fail, writes the smallest implementation that satisfies it and then improves the design while keeping the test suite passing.
For coding agents, tests written before implementation provide an independent target. Asking the same agent to invent tests after the code risks producing checks that merely confirm its existing implementation instead of challenging the intended behavior.
Acronyms and aliases
TDD acronymtest-first development variant
Related terms
Frequently asked questions
Why write the test before the implementation?
A prior test clarifies expected behavior and reduces the chance that the test will be shaped to accept whatever implementation was produced.
Does test-driven development prove software is correct?
No. It verifies the cases and properties expressed by the tests, while untested requirements and environmental failures can still contain defects.