
Why Testing After with AI Is Even Worse
Back then, I wrote a piece about “ Why Testing After Is a Bad Practice ” where I laid out 4 main reasons why writing unit tests after the code is already implemented is a bad practice. Here’s a quick summary: Unconsciously complying with a given “reality” - Writing tests after tends to shape the tests around the existing code, and not challenge it or make sure it does what it should Emotional attachment to our code - You’ve already developed some emotional attachment to the code, and you unconsciously avoid changing it, even when required Overly mocking - Your code was poorly designed since nothing (mainly tests) required it to be modular and separated by concerns. This causes the tests written after to mock a lot of modules and services in order to test basic functionalities Gets neglected at the end - When you write tests after, they tend to get neglected due to project delivery considerations. These 4 main reasons still stand, but in the age of AI Agentic Coding, tests that were alw
Continue reading on Dev.to
Opens in a new tab



