Requirements Per Test Distribution Details
R2026bMetric ID
modeltesting.TestAnalysis[slcomp.RequirementsPerTestDistributionDetails]
Description
This metric returns detailed information about the number of requirements linked to each test in the unit. For each test, the metric reports the count of linked requirements, the link status, the linked requirements, and the distribution bin for the test.
Use this metric to identify which tests are linked to requirements and to determine if tests are linked to a disproportionate number of requirements.
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.TestAnalysis[slcomp.RequirementsPerTestDistributionDetails]")View the metric result values for a specific unit.
results(1).Value results(1).ScopeAlias
To collect all metrics in the modeltesting.TestAnalysis 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.TestAnalysis[]")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 array with one entry for each
test in the unit. If there are no tests, the value is missing. Each
structure has these fields:
Count— Number of requirements linked to the test.LinkStatus— Text describing the link status of the test, such as'Linked to requirements'.Requirements— A structure array identifying the requirements linked to the test. Each structure has these fields:Alias— Name of the requirement.URI— Unique resource identifier for the requirement.
Test— A structure identifying the test, with these fields:Alias— Name of the test.URI— Unique resource identifier for the test.
RequirementsPerTestBinEdge— Distribution bin label indicating the range of requirements counts that this test falls into, such as'0-4'.IsLinked— Logical value indicating whether the test is linked to at least one requirement.