Why Code Coverage is Necessary

By: 
Michael Rielly

September 08, 2010

Before you submit your final code for certification, how confident are you that you have completely exercised the application under all situations? Did your final tests only run the application under a best-case scenario? Niro has a great post on the benefits of Code Coverage. As Niro points out, one of the challenges developers have is knowing when their software meets a sufficient level of quality so that it is ready to ship to customers. But the only way to ensure that your software will not contain any defects is to test it.

[via] The challenge that software projects are faced with is to know when testing should stop. Is it sufficient to ensure every requirement has been tested? HP conducted some research into this and discovered that testing without structural code coverage typically results in only 55% of the code being executed. What this means is that 45% of our software has not been executed before we ship the product to our customer! So this would indicate that measuring structural code coverage and then designing test cases to increase it's level would be useful in ensuring that the software we ship is of a higher quality than what it would be had we not used this measure.

Highly-regulated industries such as transportation and aviation require repeatability -- and if it isn't automated, it isn't repeatable. Developers need to be able to analyze the 'completeness' of their system tests and to ensuring that applications are not released with untested code.