Is TDD Actually Useful for AI Agents?

Test-driven development is a good candidate to provide AI coding agents with a tight, reliable feedback loop. A small but carefully designed experiment suggests it might not — and in some cases the TDD-driven code came out worse than code written without it.

I’m reacting to “TDD inside the agent loop – theater or actual value?” https://martinfowler.com/articles/exploring-gen-ai/tdd-in-the-agent-loop.html by Birgitta Böckeler (Distinguished Engineer, Thoughtworks), comparing her findings against my own 15+ years of building software with TDD.

Topics covered:

  • Why LLMs were never trained on the step-by-step TDD process — only on finished code that solves a problem
  • What Birgitta’s experiment actually measured: design quality, mutation scores, and token cost, across TDD vs. non-TDD runs judged blind by another model
  • Why non-TDD agent runs often produced better upfront design than TDD runs
  • The real cost of TDD in the agent loop: 3x+ more tokens, and a prompt that’s fragile across models
  • Which classic TDD benefits survive when an agent — not a human — is doing the cycle (and which quietly disappear, like “managing fear”)
  • What to use instead: mutation testing, static analysis, and regression tests as feedback signals

TDD isn’t dead — but forcing an agent through a human ritual built for human psychology might be solving the wrong problem.

Recommended products

Subscribe to channel

More from the Blog


0
    0
    Your Cart
    Your cart is empty
      Apply Coupon
      Scroll to Top