Main Content

Modified Condition and Decision Coverage (MCDC) Definitions in Simulink Coverage

Simulink® Coverage™ by default uses the masking modified condition and decision coverage (MCDC) definition for recording MCDC coverage results. Although you can change the MCDC definition that Simulink Coverage uses during analysis to the unique-cause MCDC definition, there are some differences in how Simulink Coverage records coverage for models depending on which definition you use.

Differences between Masking MCDC and Unique-Cause MCDC in Simulink Coverage Coverage Analysis

Masking MCDC accounts for the masking of conditions in subexpressions, allowing for an increased number of satisfied MCDC objectives compared to the unique-cause definition of MCDC. As a result, some Simulink models that receive less than complete MCDC coverage using the unique-cause MCDC definition receive increased coverage when using the masking MCDC definition. Consider the following example, where two inputs to a Stateflow® chart, condition A and condition C, cannot change independently:

Stateflow chart with four input ports. Ports A and C are branches of the same signal, input signal one. Port B is input signal two, and port D is input signal 3.

This input dependence results in dependent conditions for the expression contained within the Stateflow chart:

For the expression (A||B)&&(C||D), changing the value of condition C also changes the value of condition A. Due to the interdependence of conditions A and C, unique-cause MCDC for condition C cannot be achieved:

Coverage report showing MCDC analysis where condition C is missing coverage.

However, masking MCDC for condition C can be achieved, because masking MCDC allows the value of condition A to change in the independence pair for condition C, as long as the sub-expression (A||B) remains true:

Coverage report showing MCDC analysis where all MCDC outcomes are fully satisfied.

Certification Considerations for MCDC Coverage

DO-248C Discussion Paper #13 "Discussion of Statement Coverage, Decision Coverage and Modified Condition/Decision Coverage" states that masking MCDC is acceptable for meeting the MCDC objective of DO-178B certification.

Setting the (MCDC) Definition Used for Simulink Coverage Coverage Analysis

By default, Simulink Coverage uses the masking MCDC definition during coverage analysis. There are two ways to change the MCDC definition used for Simulink Coverage coverage analysis:

Use the Model Configuration Parameters to Set the MCDC Definition Used

  1. Open the Configuration Parameters dialog box.

  2. Set the CovMcdcMode parameter to Masking or Unique-Cause.

Use the cvtest Object to Set the MCDC Definition Used

Create a cvtest object for your model to set the mcdcMode to 'Masking' or 'UniqueCause':

cvt = cvtest(model)
cvt.options.mcdcMode = 'UniqueCause'
covdata = cvsim(cvt)

Modified Condition and Decision Coverage in Simulink Design Verifier

Setting CovMcdcMode to 'UniqueCause' can result in differences between MCDC reporting in Simulink Coverage and test generation in Simulink Design Verifier™. Simulink Design Verifier always uses the masking MCDC definition for test case generation. For more information, see Modified Condition and Decision Coverage in Simulink Design Verifier.

Related Topics

  • MCDC (Simulink Design Verifier)