Model Coverage Breakdown
R2026bMetric ID
slcomp.mt.CoverageBreakdown
Description
This metric returns the coverage measured in the model test results, aggregated across each of the models in the unit. The metric result includes the percentage of coverage achieved by model tests, the percentage of model coverage justified in coverage filters, and the percentage of coverage missed by model tests.
Supported Artifacts
This metric collects metric results for Units in the project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric:
Returns aggregated coverage results.
Does not include coverage from tests that run in software-in-the-loop (SIL) or processor-in-the-loop (PIL) mode.
Returns 100% coverage for models that do not have coverage points.
Collection
To collect metric results, execute the metric engine using the metric ID.
metricEngine = metric.Engine;
metricResults = execute(metricEngine,"slcomp.mt.CoverageBreakdown")Collecting data for this metric loads the model file and test results files and requires a Simulink® Coverage™ license.
Results
This metric returns an array of metric.Result objects. Each result
contains a Value property with coverage results and supporting
information.
Coverage Results
The Value property contains these coverage fields:
Execution— Aggregated execution coverageDecision— Aggregated decision coverageCondition— Aggregated condition coverageMCDC— Aggregated modified condition and decision coverage (MC/DC)OverflowSaturation— Aggregated saturate on integer overflow coverage
Each coverage field contains the same set of subfields:
| Field Name | Description |
|---|---|
Achieved | Percentage of coverage achieved by model tests |
Justified | Percentage of model coverage justified by coverage filters |
Missed | Percentage of coverage missed by model tests |
AchievedOrJustified | Percentage of coverage achieved by model tests or justified by coverage filters |
SatisfiedOutcomes | Number of coverage outcomes satisfied by model tests |
JustifiedOutcomes | Number of model coverage outcomes justified by coverage filters |
TotalOutcomes | Total number of model coverage outcomes |
Supporting Information
In addition to the coverage results, the Value property also
contains supporting information:
TestResults— Test results that contributed to the coverage, returned as a structure with fields:Alias— Test result nameURI— Digital thread identifier
Fragments— Model information and coverage outcomes, returned as a structure with fields:Model— Model information, returned as a structure with fields:Alias— Model nameURI— Digital thread identifier
ExecutionDecisionConditionMCDCOverflowSaturation
For each coverage type, the fragment data summarizes the number of
Satisfied,Justified, andTotalcoverage outcomes.
Compliance Thresholds
The default compliance thresholds for this metric are:
Compliant— Test results return0%missed coverageNon-Compliant— Test results return missed coverageWarning— None