Skip to Content
All posts

TDD In The Age Of AI Agents

#AI#Engineering#Culture#Product

I have been thinking a lot about how software development is changing.

Not because writing code is going away. But because the way we get to working code is changing very fast.

AI agents can now draft features, refactor files, create tests, and even fix bugs in a way that would have felt impossible a few years ago. That is exciting. It is also dangerous if we stop paying attention to discipline.

For me, that is where TDD becomes more important, not less.


The new reality

Agentic development changes the shape of the work.

Instead of spending all your energy on typing every line yourself, you spend more time:

  • defining what the system should do
  • checking whether the output matches the intent
  • keeping complexity under control
  • deciding when to trust the agent and when to stop it

That is a different job. And it requires a different kind of focus.

The biggest shift is not technical. It is psychological.

When code comes back quickly, it becomes very easy to mistake speed for correctness. That is exactly where TDD helps.


Why TDD still matters

TDD gives you a small but powerful loop:

  • write down the behavior first
  • make the failure visible
  • produce the minimum code to pass
  • refactor with confidence

That loop is valuable in normal development. It becomes even more valuable when an agent is involved.

Why?

Because tests are a form of truth. They help you separate:

  • what you want
  • what the code currently does
  • what the agent thinks you asked for

That separation matters. Agents are good at producing options. They are not always good at understanding the shape of the problem the way a human does.

If the test is weak, the agent can still look productive while drifting away from the real goal. If the test is strong, the agent has a better boundary to work inside.


What agents change

Kent Beck’s broader point, as I read it, is not that agents make engineering obsolete. It is that they push the important skills upward.

That matches what I am seeing too.

The valuable part is becoming:

  • setting a clear vision
  • breaking work into meaningful milestones
  • controlling complexity as the system grows
  • knowing what "done" actually means

Those are not glamorous tasks, but they are the ones that keep projects from turning into chaos.

The old habit was to focus on syntax, implementation details, and manual repetition. The new habit is to focus on direction, quality, and verification.

That is why I do not see AI agents as a replacement for engineering discipline. I see them as a stress test for it.


The failure modes are real

AI agents can be incredibly useful. They can also surprise you in very annoying ways.

Sometimes they:

  • over-optimize for the prompt instead of the product
  • remove useful tests because they look unnecessary
  • produce code that compiles but does not really solve the problem
  • create a false sense of progress because something changed fast

That is why I do not trust speed on its own.

Speed without validation is just a faster way to make mistakes.

And when you are working in a product environment, mistakes are not abstract. They affect users, teams, timelines, and trust.


The workflow I like

If I were building with agents today, I would keep the process simple.

  1. Start with behavior. Define what the feature should do in plain language.

  2. Write the test or acceptance check first. Make the expectation visible before the implementation exists.

  3. Let the agent draft the code. Use it as leverage, not as authority.

  4. Verify the result against the test and the design intent. Ask whether the solution is correct, not just whether it is complete.

  5. Refactor with human judgment. Clean up the shape of the code so the next change is easier.

That flow keeps the human in charge of meaning while letting the agent handle more of the repetitive work.

That feels like the right balance to me.


Why this matters for teams

This is not only a developer workflow issue. It affects how teams operate.

When agents become part of the development process, teams need stronger habits around:

  • code review
  • test quality
  • architecture decisions
  • shared understanding of product goals

The best teams will not be the ones who use the most AI. They will be the ones who use it with the clearest standards.

That is especially important for startups. Startups move fast already. If you add AI into the mix without strong feedback loops, you can scale confusion just as easily as you scale output.

So the goal is not to chase more code. The goal is to build better systems with less waste.


My takeaway

I do not think TDD is becoming outdated. I think it is becoming more useful in an environment where generation is cheap and correctness is still expensive.

Agentic development gives us leverage. TDD gives us confidence.

Together, they create a workflow where we can move quickly without losing our sense of direction.

And that feels like the real opportunity.

Not to write more code for the sake of it. But to build software with more clarity, more control, and more intention.