Code Coverage Measures

Code coverage is a measure on how thoroughly the program code has been exercised during test. The different coverage levels Testwell CTC++ provides are described here.

Testwell CTC++ offers multiple coverage measures to evaluate code coverage. Some of these coverage measures, namely function coverage, decision coverage, and multicondition coverage can be chosen as instrumentation modes in the preprocessor of Testwell CTC++. The other coverage measures are derived during the reporting step by ctcreport or ctcpost.

For every coverage level, a set of measure points is defined that need to be hit. Testwell CTC++ calculates the number of actual hits, the missing hits and the ratio between hits and the total number of possible hits.

The measure points taken into account for one measure can be highlighted in the HTML report for better clarity.

In the HTML report, line coverage is given as a visual indication whether a line has been executed, not executed or partially executed.

The diagram above shows a hierarchy of coverage levels in the following sense: From 100% decision coverage, for example, follow 100% statement coverage. For coverage ratios below 100%, no such dependency holds true in general.