1. 0

You often hear people advocate that writing tests (unit, functional, etc.) when building software leads to less bugs in production. In this post, I am trying to demonstrate this statement by analyzing real numbers from my current job. No tests were written originally and once tests were included, I became a strong advocate of the TDD methodology.

  1.  

  2. 2

    This seems more like, “tests are good” rather than “TDD is good”. Also, the “Show Lobsters” is a little misleading. I expected to be linked to a project, not a blog post.

    Code Complete 2 has some good statistics on how useful testing can be, done in several larger studies over large codebases that is worth looking into. I think that testing is fairly uncontroversial now, although TDD is still controversial. Although reducing how frequently you generate bugs is clearly good, I think that the best part of having tests is that it lets you refactor with confidence (I am stealing this phrase from someone, I forget whom). If you make a big change and you have good test coverage, you can be reasonably certain that the refactor was not a step backward in terms of correctness.

    I would be more interested in seeing a comparison between “test first” and “clearly define API first, test whenever”.

    1. 1

      I thought the “Show Lobsters” was supposed to be used when sharing my own blog post. I just removed it.

      Anyway, thanks for the feedback :) I haven’t read Code Complete 2, I’ll make sure to check it out. I think we are on the same page about the benefit of TDD. I definitely love fearless refactoring. As for testing or TDD adoption, I would agree that it is not controversial in the web community (I work with PHP, JS and Ruby; each of these community are believing in the importance of testing). However, I work with a lot of non-web folks who sadly are skeptical about the benefit of automated testing :(