Eric Sink recently wrote an article advocating the use of code coverage; where he has managed to achieve 100% coverage. I’m a huge believer that coverage data is quite valuable in the testing process, but is 100% such a good thing?

Earlier this year in his “In pursuit of code quality: Don’t be fooled by the coverage report” article, Andrew Glover noted that:

High coverage rates simply mean that a lot of code was exercised. High coverage rates do not imply that code was exercised well.

A common misconception of code coverage is that it is the final point of your quality development. Steve McConnell advises in his book, Code Complete, that “testing by itself does not improve software quality. Test results [and code coverage] are an indicator of quality, but in and of themselves, they don’t improve it. Trying to improve software quality by increasing the amount of testing is like trying to lose weight by weighing yourself more often.” Sound familiar?

Code coverage tools work as supplements, not substitues, for overall code quality. 100% code coverage certainly does not mean 100% tested. In the end, coverage measure is just an indicator of how various parts of your program were exercised - but gives you little confidence in your overall picture of quality.