Where TDD Falls Short

Posted 2 months, 3 weeks ago | Originally written on 6 Mar 2024

TDD is not design.

That's it.

While TDD does produce robust code, it amounts to building with a scaffold. The only problem is that the scaffold ends up being the life support for the application.

While the test suite then serves as an aid to prevent regression of the code, it limits future evolution of the code. I'm sort of cycling back to an idea I had a very long time ago: that code should evolve through a hack, refactor and integrate steps. The hack is dirty, but not constrained by a test suite but free to explore the problem domain. The refactor should attempt to expose some underlying system which realises the hack. Only then can the test be hammered in. The integrate step would apply for every subsequent iteration in which new system components are integrated into existing components.