SIL Coverage Fragment
R2026bMetric ID
slcomp.sil.CoverageFragment
Description
This metric returns the coverage measured in the software-in-the-loop (SIL) test results for each model in the unit. The metric result includes the percentage of coverage achieved by tests run in SIL mode, the percentage of coverage justified in coverage filters, and the percentage of coverage missed by tests run in SIL mode.
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:
Does not include coverage from tests that run in simulation (model testing) 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.sil.CoverageFragment")Collecting data for this metric loads the model file and test results files and requires a Simulink® Coverage™ license.
Results
For this metric, instances of metric.Result return
Value as a struct that contains fields for:
Statement— Statement coverageDecision— Decision coverageCondition— Condition coverageMCDC— Modified condition/decision coverage (MC/DC)Function— Function coverageFunctionCall— Function call coverage
Note that the metric returns instances of metric.Result for each
model in the unit.
Each field contains a struct that contains these fields:
Achieved— Percentage of coverage achieved by tests run in SIL modeJustified— Percentage of coverage justified in SIL modeMissed— Percentage of coverage missed by tests run in SIL modeAchievedOrJustified— Percentage of coverage completed by tests run in SIL mode. The dashboard considers coverage completed if the coverage is either achieved or justified.
Compliance Thresholds
This metric does not have predefined thresholds.