Writing Tests Slows Me Down

Let's address the misconception that writing tests in TDD slows down development, highlighting its benefits in defect prevention and overall efficiency.

Writing tests slowing development down is a popular complaint about TDD. This criticism has some merit. Personally, We have only ever felt that TDD has made me faster, but academic research disagrees. A meta-analysis of 18 primary studies by the Association for Computing Machinery showed that TDD did improves productivity in academic settings but added extra time in industrial contexts. However, that’s not the full story.

Understanding the benefits of slowing down

The aforementioned research indicates that the payback for taking extra time with TDD is a reduction in the number of defects that go live in the software. With TDD, these defects are identified and eliminated far sooner than with other approaches. By resolving issues before manual quality assurance(QA), deployment, and release, and before potentially facing a bug report from an end user, TDD allows us to cut out a large chunk of that wasted effort. We can see the difference in the amount of work to be done in this figure:

Get hands-on with 1200+ tech skills courses.