Average Model Coverage for Project
Metric ID
project.mt.ComponentCoverageBreakdownAverage
Description
You can use this metric to assess the average execution, decision, condition, MC/DC, and integer overflow coverage across the components in the project.
The Project Model Testing dashboard uses the results from this metric in the Coverage section of the dashboard.
Supported Artifacts
You can collect this metric for the Units in your project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric:
Calculates the average by using the Model Coverage Breakdown metric results from the components in the project.
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 data for this metric, execute the metric engine and use getMetrics
with the metric ID
project.mt.ComponentCoverageBreakdownAverage
.
metric_engine = metric.Engine; execute(metric_engine,"project.mt.ComponentCoverageBreakdownAverage"); results = getMetrics(metric_engine,"project.mt.ComponentCoverageBreakdownAverage")
Collecting data for this metric loads the model file and test result files and requires licenses for Simulink® Coverage™ and Simulink Test™.
Results
For this metric, instances of metric.Result
return the
Value
as a struct
that contains fields
for:
Field Name | Description | Data Type | Example Value |
---|---|---|---|
Average | Average aggregated coverage metrics across components in the project | struct | [1×1 struct] |
EmptyResults | Number of components without metric results | double | 0 |
TotalResults | Number of components with metric results | double | 5 |
The Average
field contains these fields:
Field Name | Description | Data Type | Example Value |
---|---|---|---|
Condition | Average aggregated execution coverage across the components in the project | [1×1 struct] |
struct with fields: Achieved: 60.0000 AchievedOrJustified: 70.0000 Justified: 10.0000 Missed: 30.0000 |
Decision | Average aggregated decision coverage across the components in the project | ||
Execution | Average aggregated condition coverage across the components in the project | ||
MCDC | Average aggregated modified condition and decision coverage (MC/DC) across the components in the project | ||
OverflowSaturation | Aggregated saturate on integer overflow coverage for the component |
Each of those fields contains a struct
with fields:
Field Name | Description | Data Type | Example Value |
---|---|---|---|
Achieved | Average percentage of coverage achieved by component tests | double | 60.0000 |
AchievedOrJustified | Average percentage of coverage achieved by component tests or justified by coverage filters | 70.0000 | |
Justified | Average percentage of model coverage justified by coverage filters | 10.0000 | |
Missed | Average percentage of coverage missed by component tests | 30.0000 |
Compliance Thresholds
The default compliance thresholds for this metric are:
Compliant
— Test results have0%
missed coverageNon-Compliant
— Test results are missing coverageWarning
— None
See Also
Project Model Testing Metrics | Model Coverage Breakdown | Summary of Model Testing Statuses for Project | Component Breakdown