Main Content

Basic Workflow for Enhanced MCDC Analysis

To generate test cases for enhanced Modified Condition Decision Coverage (MCDC) coverage objectives:

  1. On the Design Verifier tab, in the Mode section, select Test Generation.

  2. Click Test Generation Settings.

  3. In the Configuration Parameters dialog box, on the Design Verifier > Test Generation pane, set Model coverage objectives to Enhanced MCDC. Click OK.

  4. Click Generate Tests.

Note

Enhanced MCDC analysis is not supported when you Generate Test Cases for Embedded Coder Generated Code. The software considers MCDC coverage objectives for test generation analysis.

Simulink® Design Verifier™ analyzes the model for Enhanced MCDC coverage objectives.

After the analysis is complete:

  • The software highlights the model with the analysis results.

  • The Results Inspector window displays the summary of the model coverage objectives including the detectability status.

    The Results Inspector window displays these detectability statuses for a model coverage objective:

    • Detectable

    • Not Detectable

    • Undecided

    The table lists the possible combinations of the objective status and the detectability statuses.

    Objective StatusDetectability StatusTest Case Description

    Satisfied

    Detectable

    The test case satisfies the model coverage objective and is detectable at the detection site.

    Satisfied - Needs Simulation

    Detectable

    The test case satisfies the model coverage objective and is detectable at the detection site.

    To confirm the satisfied status, you must run additional simulations of test cases. For more information, see Objectives Satisfied - Needs Simulation.

    Satisfied

    Not detectable

    The test case satisfies the model coverage objective. However, the test objective is not detectable at any detection site.

    Satisfied

    Undecided

    The test case satisfies the model coverage objective. The software is unable to show the effect of model coverage objective on the downstream blocks.

    Unsatisfiable

    Not Detectable

    The test objective is unsatisfiable and not detectable at any detection site.

    Undecided

    Undecided

    The test objective is undecided and the software is unable to show its effect on the downstream blocks.

  • The Simulink Design Verifier data file stores the detectability status and detection site for model coverage objectives. For more information see, Manage Simulink Design Verifier Data Files.

Configure Detection Sites using Test-pointed Logged Signals

If you mark any signal as test-pointed logged signal, Enhanced MCDC analysis will prioritize such signals as detection sites for test blocks wherever possible. For example, consider the model shown below:

Model showing test-pointed logged signal.

If you make the output of Min block as the test-pointed logged signal, the detection site for the switch block is min block's outport. Otherwise, it would be saturation block's outport.

portHandle_MinBlk = get_param('model/Min', 'PortHandles’);
set_param(portHandle_MinBlk.Outport, 'TestPoint', 'on’);
set_param(portHandle_MinBlk.Outport, 'DataLogging', 'on’);

For more information on test points, see Configure Signals as Test Points. For signal logging, refer to Configure Signals for Logging.

Configure Advanced Options for Enhanced MCDC Analysis

To analyze a model with stricter nonmasking conditions, enable the Use strict propagation conditions option. This option is available in the Configuration Parameters dialog box, on the Design Verifier > Test Generation pane, in Advanced parameters.

The software evaluates stricter nonmasking conditions to analyze the effect on the test block from the downstream blocks. For example:

  • If your model consists of Atomic Subsystem with the Function packaging option set to Auto or Inline.

    Consider a model that consists of Switch and Atomic Subsystem blocks. The Function packaging option is set to Auto and you enable the Use strict propagation conditions option. The effect of the Switch test block is detectable at the detection point Out1.

    When you analyze the model with the Use strict propagation conditions option set to Off, the software analyzes the model until the effect of the Switch test block reaches the Atomic Subsystem. The Atomic Subsystem is the detection point.

  • If your model consists of blocks such as Gain or Product with the Saturate on integer overflow option set to On.

Inspect Enhanced MCDC Objectives using Model Slicer

Model Slicer supports the following objective statuses for test case generation:

  • Satisfied

  • Satisfied - needs simulation

  • Satisfied by existing test cases

  • Undecided with test case

  • Undecided due to the runtime error

You can analyze enhanced MCDC objectives and their impact on the model by using Model Slicer. In the Results window, use the Inspect link to the right of the satisfied and detectable objectives.

Alternatively, you can click on the Inspect Using Slicer button in the Design Verifier tab.

After launching Model Slicer, the tool sets the input based on the test case values that are relevant to the objective generated by Simulink Design Verifier and steps to the time of observation logged in sldvData. Model Slicer then adds the model object being observed as the starting point and shows its impact on the detection point by highlighting the slice.

When you set the model coverage objective to enhanced MCDC in the Configuration parameter window, you can analyze its detectability along with inspecting the objective. In this case, the Slicer Configuration window allows you to switch to different modes using the slicer Configuration list.

Related Topics