home/glossary/Test-Driven Agentic Development
The Agentic Workflow

Test-Driven Agentic Development

definition

Test-Driven Agentic Development (TDAD) adapts the traditional TDD cycle (write test → fail → implement → pass → refactor) for agent-assisted coding, where you write tests first and then let the agent implement until all tests pass — effectively using tests as executable specifications that constrain agent behavior. This workflow inverts the typical agent interaction: instead of describing what you want in natural language and hoping the agent interprets correctly, you encode your requirements as tests that provide unambiguous success criteria.

Test-Driven Agentic Development (TDAD) adapts the traditional TDD cycle (write test → fail → implement → pass → refactor) for agent-assisted coding, where you write tests first and then let the agent implement until all tests pass — effectively using tests as executable specifications that constrain agent behavior. This workflow inverts the typical agent interaction: instead of describing what you want in natural language and hoping the agent interprets correctly, you encode your requirements as tests that provide unambiguous success criteria. TDAD is one of the highest-reliability agent workflows because it eliminates ambiguity — the agent doesn't have to guess what "correct" means when there's a test suite that defines it, and the auto-fix loop drives the agent to iterate until the objective criteria are met. The trade-off is that writing good tests requires upfront effort and domain knowledge, but this investment pays back through dramatically higher first-attempt success rates and fewer review-and-iterate cycles. This concept connects to spec-driven development for the complementary practice of writing specs before coding, test generation for when agents write the tests themselves, auto-fix loops for the iteration mechanism that drives TDAD, and eval-driven development for applying the same test-first philosophy to prompt and model evaluation.