Post

In part, it is near impossible to get AI/agents to do actual TDD, particularly writing the tests first.

0 reposts1 like

> In part, it is near impossible to get AI/agents to do actual TDD, particularly writing the tests first. This. I have not seen LLMs writing tests first and then start the implementation, even after hard prompting. LLMs will happily write decent tests after implementing though. Related ->

Sung Kim@sungkim.bsky.social

Is TDD worth it when coding with AI agents? No, TDD is a process that doesn't seem to “come natural” to models. It's like an uphill battle against the training data, and takes a lot of iterations on a prompt to get it to follow the process most of the time. martinfowler.com/articles/exp...

It does NOT mean not having automated tests, you need zillions of all types of tests (e2e, integration, unit etc), all over the place

That's just one problem. A couple more due to moving up the size of the System Under Test which reduces the (valuable) pressure on the design and teasing out domain concepts which would help agents to produce higher quality output. So, marginal deterioration.

We're all still working it out. However Adam Thornhill (author of code as a crime scene, founder of CodeScene which is an excellent tool, long time XP/TDD practitioner) is the kind of person I will pay attention to.

wrong way to go to have lots of tests? I've worked on plenty of v high test coverage systems. Re execution speed, the testing pyramid/trophy is still valid...

...most of your tests are very fast low level ones, and with e2e tests spending a lot of effort making sure they are as decoupled as poss, fast, reliable etc

And Adam's approach is still very much "test-first" - driving each change from a failing test at the boundary and letting the implementation follow is much the same shape as ATDD/BDD/outside-in. What's gone is the inner loop, where the unit tests were the design tool as well as the verification.