Model coverage helps you validate your model tests by measuring how thoroughly the model objects are tested. Model coverage calculates how much a model test case exercises simulation pathways through a model. Model coverage is a measure of how thoroughly a test case tests a model and the percentage of pathways that a test case exercises. Model coverage helps you validate your model tests.
Model coverage analyzes the execution of the following types of model objects that directly or indirectly determine simulation pathways through your model:
Models referenced in Model blocks
The states and transitions of Stateflow® charts
During a simulation run, the tool records the behavior of the covered objects, states, and transitions. At the end of the simulation, the tool reports the extent to which the run exercised potential simulation pathways through each covered object in the model.
The Simulink Verification and Validation™ software can only
collect model coverage for a model if its simulation mode is set to
PIL. If the simulation mode is set to
any other mode, model coverage
is not measured during simulation.
If you have an Embedded Coder® license, you can also measure code coverage for code generated from models in software-in-the-loop (SIL) mode or processor-in-the-loop (PIL) mode. For the types of coverage that code coverage performs, see Types of Code Coverage. For an example of how to enable code coverage, see Code Coverage for Models in Software-in-the-Loop (SIL) Mode and Processor-in-the-Loop (PIL) Mode