Hauptinhalt

Tests Per Requirement Distribution Details

R2026b
Since R2026b

Metric ID

modeltesting.TestAnalysis[slcomp.TestsPerRequirementDistributionDetails]

Description

This metric returns detailed information about the number of tests linked to each requirement in the unit. For each requirement, the metric reports the count of linked tests, the link status, the linked tests, and the distribution bin for the requirement.

Use this metric to identify which requirements are linked to tests and to determine if requirements are linked to a disproportionate number of tests.

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.TestsPerRequirementDistributionDetails]")

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 requirement in the unit. If there are no requirements, the value is missing. Each structure has these fields:

  • Count — Number of tests linked to the requirement.

  • LinkStatus — Text describing the link status of the requirement, such as 'Linked to tests'.

  • Requirement — A structure identifying the requirement, with these fields:

    • Alias — Name of the requirement.

    • URI — Unique resource identifier for the requirement.

  • Tests — A structure array identifying the tests linked to the requirement. Each structure has these fields:

    • Alias — Name of the test.

    • URI — Unique resource identifier for the test.

  • TestsPerRequirementBinEdge — Distribution bin label indicating the range of test counts that this requirement falls into, such as '0-4'.

  • IsLinked — Logical value indicating whether the requirement is linked to at least one test.

See Also

Objects

Functions

Topics