Johnny Butler

August 13, 2026

Where TDD helps me in the agent loop

I’ve seen both sides of the debate around Birgitta Böckeler’s article. Sometimes TDD improves the code an agent produces. Sometimes it feels like the agent is performing the ceremony, with no obvious difference in the result.

https://martinfowler.com/articles/exploring-gen-ai/tdd-in-the-agent-loop.html

I’ve found TDD most useful when I can’t clearly define the problem upfront. I stay close to the agent at the start, almost like pair programming. We write an early test, make a small change and look at what it tells us.

Those early tests expose assumptions that were hard to see in the initial brief. They help me understand what the software needs to do and get the foundations in place before the implementation grows.

Once the problem is clearer, I tend to step back and let the agent complete more of the implementation. I then come back to review the code, run the checks and verify the outcome.