Depending on the settings you apply for Simulink® Coverage™ coverage recording, there can be a difference between the definition of modified condition and decision (MCDC) coverage used for model coverage analysis in Simulink Coverage and that used for test case generation analysis in Simulink Design Verifier™.
Design Verifier always uses the masking MCDC definition for test case generation. By
Coverage also uses the masking MCDC definition when recording coverage. However, if
you set the
CovMcdcMode model configuration parameter to
Coverage instead uses the unique-cause MCDC definition when recording coverage. For
information on the differences between the masking MCDC definition and the unique-cause
MCDC definition, see Modified Condition and Decision Coverage (MCDC) Definitions in Simulink Coverage.
CovMcdcMode model configuration
'UniqueCause' can result in differences
between MCDC reporting in Simulink
test generation in Simulink
Design Verifier. An example of this
difference can be seen in analysis results for logical expressions
containing a mixture of
as in this Stateflow® transition.
each separate inputs, there are five possible ways to evaluate the
condition on the Stateflow transition, shown in the following
Satisfying MCDC for a Boolean variable requires a pair of condition
evaluations, showing that a change in that variable alone changes
the evaluation of the entire expression. In this example, MCDC can
be satisfied for
C with either the pair 1, 2 or
the pair 3, 4. In both of those cases, the value of the expression
changed because the value of
C changed, while all
other variable values stayed the same.
Each pair has a different set of values for
are held constant, but each pair contains one evaluation where
true and one evaluation where
false. To satisfy MCDC for
Design Verifier test
generation analysis accepts any
pair containing one evaluation of true values and one evaluation of
false values for
In this example, Simulink
Design Verifier test generation analysis
accepts not only pair 1, 2 and pair 3, 4 but also pair 1, 4 and pair
2, 3. Simulink
Coverage model coverage analysis
using the unique-cause MCDC definition is satisfied only by pair 1,
2 or by pair 3, 4.
The preceding example assumes that
C are all
separate inputs. When input
A is constrained to
be the same value as
C, as in this model, only
a subset of condition evaluations are possible.
This subset of condition evaluations for the Stateflow transition is shown in the following table.
Evaluations 2 and 3 are no
longer possible, so neither pair 1, 2 nor pair 3, 4 is possible. As
a result, unique-cause MCDC for
C can no
longer be satisfied in Simulink
coverage analysis. Since pair 1, 4 is still possible, however, Simulink
Design Verifier test
generation analysis reports that MCDC for
The complexity of MCDC analysis for logical expressions with
a mixture of
causes this difference between results from Simulink
to unique-cause MCDC analysis and Simulink
Design Verifier. The
CovMcdcMode model configuration parameter
'Masking' does not cause this discrepancy.
However, if you require the use of unique-cause MCDC analysis in Simulink
you can minimize this effect by using the
suite optimization for test generation analysis in Simulink
Design Verifier For
more information, see the Tip section of Test suite optimization (Simulink Design Verifier).