justin․searls․co

TDD is more important than ever

Lately, I've been reminded of the heady days of my agile youth by how often I've found myself asking, "how will we test this?"

As I've mentioned frequently on podcasts and recent Q&As about AI, an odd paradox has emerged in the software industry:

  1. Developers experienced in agile engineering practices like test-driven development tend to be among the most skeptical of AI code generation, often citing fears that software quality is being thrown out the window
  2. Developers experienced in agile engineering practices like test-driven development tend to be among the most successful at building great software with coding agents, often citing creative techniques enabling agents to verify the correctness of their work

In the late 2000s, I always knew I was talking to a solid programmer if their first question upon being handed a complex task was to ask, "how will we test this?" Agile developers learned back then that literally everything hinged on establishing a fast, reliable, automated way to verify your code fulfilled its intended purpose. Without tests, you can't refactor aggressively, deploy frequently, or delete safely. Over the 2010s, many of us learned patterns and heuristics that allowed us to take shortcuts and tone down our testing zeal in the name of pragmatism and efficiency, but the underlying skill of concocting ways to verify our code never stopped being valuable.

Well, here we are again. In 2025, the only thing that matters when it comes to coding agents like Claude Code and Codex CLI is to ensure they are equipped with the tools they need to independently verify the correctness of their work.

Why is verification so important? Because, if you tell an agent to do something that it can't independently verify, then—just like a human developer—the best they can do is guess. And because agents work really fast, each action based on a guess is quickly succeeded by an even more tenuous guess. And then a guess of a guess of a guess, and so on. Very often, when I return to my desk after 30 minutes and find that an agent made a huge mess of the code, I come to realize that the AI didn't suddenly "get dumb," but rather that an application server crashed or a web browser stopped responding and the agent was forced to code speculatively and defensively.

Many of the tools agents need most depend on access to things that us humans take for granted: a sandboxed computer free of arbitrary restrictions, or an MCP server enabling interaction with an iOS Simulator, or a built-in browser that conveys real-time visual information. But fortunately, being able to sense the lack of sufficient verification is a deeply-ingrained instinct for us TDD graybeards. Moreover, we have the experience to know when to reach for image regression testing or mutation testing or characterization testing and the skill to set up appropriate test harnesses for each. Out of the box, most coding agents—like most human developers—don't have the faintest clue what those things even are, much less how to use them effectively.

So I was really pleased to see Simon Willison put verifiability in bold, because it means people may finally be ready to talk about what this has always been about. We don't get to coding "super-intelligence" until we get to true reinforcement learning, and we can't have reinforcement learning until we all get a hell of a lot better at baking verifiability into our software workflows.

So, if you're a veteran of the agile era, or the craftsmanship movement, or just otherwise give a shit about writing great code, but are nevertheless worried about the impact AI will have on software quality, you have a lot more leverage here than you might think. The things that matter most to you matter more now than ever. Better yet, other developers who were happy to ignore all this stuff for 20 years suddenly have an urgent and present need to start paying attention to exactly what you're most passionate about. Take heart. ❤️


Got a taste for hot, fresh takes?

Then you're in luck, because you'll pay $0 for my 2¢ when you subscribe to my work, whether via RSS or your favorite social network.

I also have a monthly newsletter where I write high-tempo, thought-provoking essays about life, in case that's more your speed:

And if you'd rather give your eyes a rest and your ears a workout, might I suggest my long-form solo podcast, Breaking Change? Odds are, you haven't heard anything quite like it.