Main Content

Component Requirements

Since R2025a

Metric ID

slcomp.mt.ComponentRequirements

Description

You can use this metric to count the number of functional requirements implemented in the component.

Supported Artifacts

You can collect this metric for the Units in your project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.

Computation Details

The metric only includes requirements in which the:

  • Requirement Type is set to Functional

  • Requirement links to a component with the link Type set to Implements

Collection

To collect data for this metric, execute the metric engine and use getMetrics with the metric ID slcomp.mt.ComponentRequirements.

metric_engine = metric.Engine;
execute(metric_engine,"slcomp.mt.ComponentRequirements");
results = getMetrics(metric_engine,"slcomp.mt.ComponentRequirements")

Collecting data for this metric loads the model file and requires a Requirements Toolbox™ license.

Results

For this metric, the function getMetrics returns a metric.Result instance. Instances of metric.Result include the properties:

PropertyDescriptionData TypeExample Value
ValueNumber of functional requirements implemented in the componentstruct
  struct with fields:

    Count: 3
ArtifactsInformation about the implemented functional requirementsstruct array
  1×3 struct array with fields:

    UUID
    Name
    ParentUUID
    ParentName

See Also

| |

Topics