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.

October 25th, 2006 at 9:17 am
Another thing to watch for with code coverage is that it tells you absolutely nothing about missing functionality.
You may exercise 100% of the code that is there, but that doesn’t mean 50% of the required code isn’t missing.
October 25th, 2006 at 2:40 pm
While 100% code coverage doesn’t tell you that you’ve tested all your functionality, or that you’ve eliminated all the bugs, the absence of 100% code coverage should be a warning sign that you can’t possibly be testing everything (or that you’ve got some dead code you need to rip out).
I wrote a bit about this back in September: http://on-ruby.blogspot.com/2006/09/code-coverage-is-evil-eh-not-so-much.html
October 27th, 2006 at 10:04 am
[…] Code Coverage Coverage- Mandy Ownes has some good vibes on code coverage. […]
October 8th, 2009 at 2:49 pm
100% without thinking is not such a good thing, in fact it is terrible thing. Anything without thinking in terrigle thing.
But you write about code coverage as there are only one kind of code coverage. In fact fully path coveraged code means that every possible test was executed. On the other hand statement coverage means, the code was executed in some way. This can be achieve even in program with lot of bugs without any test failing.
I discribed differences among basic kinds of coverage in http://testovanisoftwarueng.blogspot.com/2009/10/problems-with-code-coverage.html
There are even sove exercises to try.