Coverage metrics
Statement Coverage
To reach full statement coverage, each statement of the program code has to be executed at least once. It is obvious that the program is not tested completely until statement coverage is not 100%.
Branch Coverage
To reach 100% branch coverage, all branches must be executed. In contrast to statement coverage the implicit else
-branch of if-statements has to bee executed too.
Term Coverage
Term coverage takes a closer look to the decision expression in if-statements. Each basic boolean term of the decision must at least once effect the overall result to true and to false. CodeCover implements the Ludewig term coverage, which subsumes MC/DC for boolean short circuit semantics. In Eclipse, we provide a view (boolean analyzer), helping to understand which term value sets have been tested and which basic terms have been effective.
Loop Coverage
Loops are error-prone, e.g. off-by-one errors in for loops. The loop coverage helps carefully testing of loops, and shows, whether each loop was not executed, once executed, and more than once repeated.
Question mark operator (?) Coverage
The question mark operator (the ?-operator) is a conditional expression. The ?-operator coverage metric shows, whether both alternatives of the expression have been executed. Like the branch coverage, the ?-operator is covered 100%, if both alternatives are executed, 50%, if only one alternative is executed, otherwise 0%.
Synchronized Coverage
Synchronized statements are used to synchronize critical code sections. If a synchronized statement is locked, other threads will wait until the locked section is set free. The synchronized coverage metric shows whether a synchronize statement has caused waiting effects. In particular the synchronized coverage is very helpfull to quantify the effects of load testing.