This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

View Coverage Results in a Model

Overview of Model Coverage Highlighting

When you simulate a Simulink® model, you can configure your model to provide visual results that allow you to see at a glance which objects recorded 100% coverage. After the simulation:

  • In the model window, model objects are highlighted in certain colors according to what coverage was recorded:

    • Light green indicates that an object received full coverage during testing.

    • Light red indicates that an object received incomplete coverage.

    • Gray indicates that an object was filtered from coverage.

    • Objects with no color highlighting received no coverage.

  • When you click a colored object, the Coverage Display Window provides details about the coverage recorded for that block. For subsystems and Stateflow® charts, the Coverage Display Window lists the summary coverage for all objects in that subsystem or chart. For other blocks, the Coverage Display Window lists specific details about the objects that did not receive 100% coverage.

The simulation highlights blocks that received the following types of model coverage:

Enable Coverage Highlighting

To enable the model coverage colored diagram display:

  1. In the Simulink Editor, select Analysis > Coverage > Settings to open the Coverage pane of the Configuration Parameters dialog box.

  2. In the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis and then select Entire System.

  3. Select MCDC as the Structural coverage level.

  4. Select Objectives and Constraints under Other metrics.

  5. On the Results pane of the Configuration Parameters dialog box, select Display coverage results using model coloring. This is the default setting.

After you have enabled the coverage coloring, simulate your model. In the model, you can see at a glance which objects received full, partial, or no coverage.

Highlighted Coverage Results

The following sections show examples of highlighted model objects in colors that correspond to the recorded coverage.

Green: Full Coverage.  In this example, the Switch block received 100% coverage, as indicated by the green highlighting and the information in the Coverage Display Window.

Red: Partial Coverage.  In this example, the control_logic Stateflow chart received the following coverage:

  • Decision: 25%

  • Condition: 21%

  • MCDC: 0%

Inside the control_logic subsystem, the Pressure substate was never fail.

In the next example, in the Multiport Switch block, two of the data ports were never executed.

Gray: Filtered Coverage.  In this example, the fuel_rate_control subsystem is highlighted in gray because it was filtered out of coverage recording.

View Results in Coverage Display Window

After simulating the model and recording coverage, by default, the Coverage Display Window is the top-most visible window. When you click an object that recorded coverage, the Coverage Display Window displays details of the coverage recorded during simulation.

In the Coverage Display Window, you can:

  • Configure the window so it is not always the top-most visible window. Next to Always on top, click and removing the check.

  • Configure the window to display coverage information when you click an object that recorded coverage. Click and select Click.

  • Configure the window to display coverage information when you hover your cursor on an object that recorded coverage. Click and select Focus.

  • Close the window. Press Alt+F4.

  • Close the window and remove highlighting on the model. Select Display > Remove Highlighting.

Abbreviations in Coverage Results

The Coverage Display Window shows results with abbreviations. You can view expanded results in the Top-Level Model Coverage Report.

FCALLfunction call
LLlower limit
MX ITERmaximum iterations exceeded
NAnot applicable
OffThresh[switch] off threshold
OnThreshswitch on threshold
SOsaturate on integer overflow
TBLlookup table
TItest interval
TOtest objective
TPtest point
ULupper limit
  • integration result (Discrete-Time Integrator block)

  • slew rate (Rate Limiter block)

Was this topic helpful?