跳到正文
原文
Johnny Butler · Agentic Engineering· Johnny Butler·· 2026/08/14AI 评分36

在 AI 智能体开发循环中,TDD 在哪些环节真正帮到我

原文标题:Where TDD helps me in the agent loop

AI 导读

作者结合 Birgitta Böckeler 关于 TDD 的争论,分享了自己在 AI 智能体开发循环中的实践:当问题无法提前清晰定义时,TDD 最有用。他会像结对编程一样贴近智能体,先写一个早期测试、做小改动并观察反馈,这些测试能暴露初始需求中难以察觉的假设。等问题清晰后,他再退后让智能体完成更多实现,最后回来审查代码、运行检查并验证结果。

正文

当前语言的正文正在等待翻译,暂时显示原文。

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.

来源:Johnny Butler · Agentic Engineering · world.hey.com