Modified Condition/Decision Coverage (MC/DC)

MC/DC includes condition coverage. Additionally, for each atomic condition an independence pair of TRUE-FALSE-combinations has to be tested, showing that the condition can independently determine the value of the decision.

Consider the code snippet:
if ((a || b) && (c || d)) {...}
The atomic conditions are a, b, c and d in this case. For condition a, an independence pair is
(T || F) && (F || T) = T
(F || F) && (F || T) = F
For this pair of evaluation alternatives, only the value of a and the result of the decision are switching.
To qualify as an independence pair, it is also allowed that the value of conditions switches if they are not evaluated at all due to short circuit evaluation. In the example, another independence pair for condition a is
(T || F) && (T || F) = T
(F || F) && (T || T) = F
For the TER calculation, Testwell CTC++ takes six measure points into account:
  1. The decision is evaluated to TRUE.
  2. The decision is evaluated to FALSE.
  3. An independence pair for condition a is tested.
  4. An independence pair for condition b is tested.
  5. An independence pair for condition c is tested.
  6. An independence pair for condition d is tested.
Note: MC/DC is available with ctcpost with the option -fmcdc, if the code was instrumented for multicondition coverage.