Main Content

Component Boundary Coverage Fragments

R2026b
Since R2026b

Metric ID

modeltesting.ComponentBoundaryCoverage[slcomp.CoverageFragments]

Description

This metric returns coverage fragment counts that describe how much structural coverage is achieved by component boundary tests. The metric reports the number of satisfied and total coverage objectives for condition, decision, execution, and MC/DC coverage types.

Use this metric to identify how much coverage comes from tests that exercise a unit at its component boundary versus overall coverage.

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.

Collection

To collect data for this metric, execute the metric engine with the metric ID.

metric_engine = metric.Engine;
results = execute(metric_engine,"modeltesting.ComponentBoundaryCoverage[slcomp.CoverageFragments]")

View the metric result values for a specific unit.

results(1).Value
results(1).ScopeAlias

To collect all metrics in the modeltesting.ComponentBoundaryCoverage group at once, use the group name with empty brackets. Use the MetricID property to distinguish results from different metrics in the group.

results = execute(metric_engine,"modeltesting.ComponentBoundaryCoverage[]")

Results

The metric returns an array of metric.Result objects, one for each unit in the project. Use the Value property of the metric result object to view the metric result values. Use the ScopeId and ScopeAlias properties to identify which unit the result belongs to.

The ScopeAlias property returns the name of the unit.

The Value property returns a structure with these fields:

  • Model — A structure identifying the model that contains the unit, with these fields:

    • Alias — Name of the model.

    • URI — Unique resource identifier for the model.

  • SatisfiedCondition — Number of condition coverage objectives satisfied by all tests. Empty when no condition coverage data is available.

  • SatisfiedDecision — Number of decision coverage objectives satisfied by all tests. Empty when no decision coverage data is available.

  • SatisfiedExecution — Number of execution coverage objectives satisfied by all tests. Empty when no execution coverage data is available.

  • SatisfiedMCDC — Number of MC/DC coverage objectives satisfied by all tests. Empty when no MC/DC coverage data is available.

  • TotalCondition — Total number of condition coverage objectives. Empty when no condition coverage data is available.

  • TotalDecision — Total number of decision coverage objectives. Empty when no decision coverage data is available.

  • TotalExecution — Total number of execution coverage objectives. Empty when no execution coverage data is available.

  • TotalMCDC — Total number of MC/DC coverage objectives. Empty when no MC/DC coverage data is available.

  • ComponentBoundarySatisfiedCondition — Number of condition coverage objectives satisfied specifically by component boundary tests. Empty when no condition coverage data is available.

  • ComponentBoundarySatisfiedDecision — Number of decision coverage objectives satisfied specifically by component boundary tests. Empty when no decision coverage data is available.

  • ComponentBoundarySatisfiedExecution — Number of execution coverage objectives satisfied specifically by component boundary tests. Empty when no execution coverage data is available.

  • ComponentBoundarySatisfiedMCDC — Number of MC/DC coverage objectives satisfied specifically by component boundary tests. Empty when no MC/DC coverage data is available.

See Also

Objects

Functions

Topics