Coverage Data Collection

Collect model coverage data during simulation


slcovmex Build coverage-compatible MEX-function from C/C++ code

Examples and How To

Model Coverage Collection Workflow

Develop effective tests with model coverage.

Specify Model Coverage Options

Before starting a model coverage analysis, you specify several model coverage recording options.

Create and Run Test Cases

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

View Coverage Results in a Model

View coverage results of a model by coloring its elements.

Model Coverage for MATLAB Functions

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

Model Coverage for Stateflow Charts

Use the Model Coverage tool to determine the extent to which a model test case exercises simulation control flow paths through a model.

Model Coverage for C and C++ S-Functions

Analyze model coverage for C/C++ S-Functions.

Model Coverage for Multiple Instances of a Referenced Model

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

Analyzing MCDC for Cascaded Logic Blocks

This example illustrates how Simulink Verification and Validation records the MCDC metric for a cascade of Logical Operator blocks.

Obtain Cumulative Coverage for Reusable Subsystems and Stateflow® Constructs

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

Code Coverage for Models in Software-in-the-Loop (SIL) Mode and Processor-in-the-Loop (PIL) Mode

Configure code coverage for SIL and PIL simulations and review results.


Model Coverage

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

Types of Model Coverage

Simulink® Verification and Validation™ can perform several types of coverage analysis.

Types of Code Coverage

If you have Embedded Coder®, Simulink Verification and Validation can perform several types of code coverage analysis for models in software-in-the-loop (SIL) mode, processor-in-the-loop (PIL) mode, and for the code within supported S-Function blocks.

Logical Operator Cascade Patterns

This model includes various patterns of cascaded 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.

Cumulative Coverage Data

Collect cumulative model coverage from successive simulation runs.

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.

Was this topic helpful?