The silver-unit-testing-bullet?

First of all, there’s no doubt that unit testing can be a great form of testing. But it is not the silver bullet it is often promised. The lack of unit testing is not likely the reason for all of the issues in your project-gone-bad.

As automated unit testing is, or should be, fast, efficient, assertive, and repeatable it’s easy to run into conclusions and focus all efforts in unit testing – and reduce higher level testing. Shift-left testing is a trend. Metrics like unit test code coverage have become the most important metrics of the project.

However, the real users of unit testing are the developers. Unit tests focuses on units that are likely too small to tell anything about if the system works. Instead unit testing is tool for the developers to

  1. Assist with development of new code; it enables the developers to design, debug, and test new code fast and easy without the rest of the system setup to test their code
  2. Enable checking for any side-effects, regressions, they would introduce when they are touching any old code for a reason or another – as long as that area of code is covered by existing unit tests

For any other purposes, unit testing may be the wrong tool even if it would be for the right reasons. But have you already heard of snake oil?