Main Content

Requirements Per Test Distribution

R2026b
Since R2026b

Metric ID

modeltesting.TestAnalysis[slcomp.RequirementsPerTestDistribution]

Description

This metric returns a distribution showing how many tests are linked to specific numbers of requirements. The distribution groups tests into bins based on the number of linked requirements.

Use this metric 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.RequirementsPerTestDistribution]")

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 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 array with one entry for each bin in the distribution. Each structure has these fields:

  • BinEdge — Label describing the range of requirements counts for this bin, such as '0-4', '5-9', or '>19'.

  • BinCount — Number of tests that fall into this bin.

See Also

Objects

Functions

Topics