Requirements-Based Coverage Fragments
R2026bMetric ID
modeltesting.RequirementsBasedCoverage[slcomp.CoverageFragments]
Description
This metric returns coverage fragment counts that describe how much structural coverage is achieved by requirements-based 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 are linked to requirements 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.RequirementsBasedCoverage[slcomp.CoverageFragments]")View the metric result values for a specific unit.
results(1).Value results(1).ScopeAlias
To collect all metrics in the modeltesting.RequirementsBasedCoverage
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.RequirementsBasedCoverage[]")Results
The metric returns an array of objects, one for each unit in the project.
Use the metric.ResultValue 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.RequirementsBasedSatisfiedCondition— Number of condition coverage objectives satisfied specifically by requirements-based tests. Empty when no condition coverage data is available.RequirementsBasedSatisfiedDecision— Number of decision coverage objectives satisfied specifically by requirements-based tests. Empty when no decision coverage data is available.RequirementsBasedSatisfiedExecution— Number of execution coverage objectives satisfied specifically by requirements-based tests. Empty when no execution coverage data is available.RequirementsBasedSatisfiedMCDC— Number of MC/DC coverage objectives satisfied specifically by requirements-based tests. Empty when no MC/DC coverage data is available.