data showing what code you didâ€”or, more importantly, did notâ€”execute. Coverage
is the perfect complement to unit testing: Unit tests tell you whether your code
performed as expected, and code coverage tells you what remains to be tested.
Most developers understand this process and agree on its value proposition, and
often target 100% coverage. Although 100% coverage is an admirable goal, 100% of
the wrong type of coverage can lead to problems. A typical software development
effort measures coverage in terms of the number of either statements or branches
to be tested. Even with 100% statement or branch coverage, critical bugs still
may be present in the logic of your code, leaving both developers and managers
with a false sense of security.
How can 100% coverage be insufficient? Because statement and branch coverage do
not tell you whether the logic in your code was executed. Statement and branch
coverage are great for uncovering glaring problems found in unexecuted blocks of
code, but they often miss bugs related to both decision structures and decision
interactions. Path coverage, on the other hand, is a more robust and
comprehensive technique that helps reveal defects early.
As a Co-Founder of Codign Software, I have over 15 years' software development, QA and sales experience. Prior to starting Codign Software, I spent 9 years at McCabe & Associates, an industry leader in Application Lifecycle Management products.
I have extensive experience with software metrics, testing methodologies and large scale implementations.