Multicondition Coverage
Multicondition Coverage includes all measure points for decision coverage. Additionally, it measures if all true-false-combinations for the evaluation of the atomic conditions inside the decision have been tested.
Example: The following function contains a decision consisting of four atomic conditions.
int multicondition(int a, int b, int c, int d){
if ((a || b) && (c || d)){
return 1;
}
else {
return 0;
}
}
It is tested with the input
multicondition(0, 0, 0, 1); // Test I multicondition(0, 0, 1, 0); // Test II multicondition(0, 0, 1, 1); // Test III multicondition(0, 1, 0, 0); // Test IV multicondition(0, 1, 0, 1); // Test V
Test cases I, II and III correspond to evaluation alternative 7, hence its counter has value "3". Test IV corresponds to alternative 6 and test V to alternative 4.
For the code in line 2, nine measure points are taken into account for multicondition coverage: the true and false evaluation of the whole decision and the seven evaluation alternatives.
Scope and limits of multicondition instrumentation
In multicondition mode, ctc instruments boolean expressions in
if, for, while,
do-while decisions, except for simple declarations or
init-statements inside (C++).
=
are instrumented, if the expression to be assigned contains
&& or || operators. Example:
x = (a || b) && (c || d);Other occurences of boolean expression are not instrumented.