Collect Model Coverage Data

Measure model coverage to indicate untested elements of your design during simulation

Simulink® Coverage™ measures model coverage and code coverage to indicate untested elements of your design, such as logical conditions, unintended functionality, and switch positions during simulation. Review coverage information for the model in generated reports and in highlighted models to identify missing coverage and navigate to the associated requirements. Determine if you need to modify the requirements, test cases, or design to meet your coverage goals.


slcovmexBuild coverage-compatible MEX-function from C/C++ code
cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects
cvhtmlProduce HTML report from model coverage objects
cvmodelviewDisplay model coverage results with model coloring
mcdcinfoRetrieve modified condition/decision coverage information from cvdata object


Model Coverage Basics

Model Coverage

Validate your model tests by measuring how thoroughly the model objects are tested.

Model Coverage Collection Workflow

Develop effective tests with model coverage.

Specify Coverage Options

In the Simulink Editor, specify several coverage recording options.

Types of Model Coverage

Model coverage metrics provided by Simulink Coverage .

View Coverage Results in a Model

Highlight model elements to view coverage results.

Obtain Cumulative Coverage for Reusable Subsystems and Stateflow® Constructs

Create and view cumulative coverage results for a model with a reusable subsystem.

Cumulative Coverage Data

Collect cumulative model coverage from successive simulation runs.

Create and Run Test Cases

Create and run test cases by using the model coverage MATLAB® commands cvtest and cvsim.

Model Coverage Object Details

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

Describes the definitions of MCDC coverage used in Simulink Coverage.

Modified Condition and Decision Coverage in Simulink Design Verifier

Describes the difference between MCDC coverage in Simulink Design Verifier™ and in Simulink Coverage.

Logical Operator Cascade Patterns

This model includes various patterns of cascaded Logical Operator blocks.

Analyzing MCDC for Cascaded Logic Blocks

This example illustrates how Simulink® Coverage™ records the MCDC metric for a cascade of Logical Operator blocks.

Simulink Optimizations and Model Coverage

Learn how inlined parameters, block reduction, and conditional input branch execution can affect your model coverage data.

Model Objects That Receive Coverage

Model objects that receive model coverage during simulation.

Model Objects That Do Not Receive Coverage

Simulink objects that do not receive coverage.

Model Coverage for MATLAB Functions

Use model coverage for MATLAB Function blocks and interpret the results.

Model Coverage for Stateflow Charts

Determine the extent to which a model test case exercises simulation control flow paths through a model.

Model Coverage for Multiple Instances of a Referenced Model

Collect model coverage when a model has multiple Model blocks that reference the same model.

Was this topic helpful?