Main Content

Model Coverage Fragment

Metric ID

slcomp.mt.CoverageFragment

Description

This metric returns the coverage measured in the model test results for each model in the unit. The metric result includes the percentage of coverage achieved by the model tests, the percentage of model coverage justified in coverage filters, and the percentage of coverage missed by the model tests.

Computation Details

The metric:

  • 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

Use getMetrics with the metric ID slcomp.mt.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 the Value as a struct that contains fields for:

  • Execution — Execution coverage

  • Decision — Decision coverage

  • Condition — Condition coverage

  • MCDC — Modified condition and decision coverage (MC/DC)

  • OverflowSaturation — Saturate on integer overflow coverage

Note that there are instances of metric.Result returned for each model in the unit.

Each field contains a struct that contains these fields:

  • Achieved — The percentage of coverage achieved by the model tests.

  • Justified — The percentage of model coverage justified by coverage filters.

  • Missed — The percentage of coverage missed by the model tests.

  • AchievedOrJustified — The percentage of coverage achieved by the model tests or justified by coverage filters.

Compliance Thresholds

This metric does not have predefined thresholds.

See Also

Related Topics