Main Content

Requirement with Test Case

Since R2020b

Metric ID

RequirementWithTestCase

Description

Use this metric to determine whether a requirement is linked to a test with a link where the Type is set to Verifies. The metric analyzes only requirements where the Type is set to Functional and that are linked to the unit with a link where the Type is set to Implements.

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:

  • Analyzes only requirements where the Type is set to Functional and that are linked to the unit with a link where the Type is set to Implements.

  • Counts links to tests in the project where the link type is set to Verifies, including links to tests that test other models or subsystems. For each requirement that is linked to tests, check that the links are to tests that run on the unit that implements the requirement.

Collection

To collect data for this metric:

  • In the Model Testing Dashboard, click a metric in the Requirements Linked to Tests section and, in the table, see the Test Link Status column.

  • Use getMetrics with the metric ID RequirementWithTestCase.

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

Results

For this metric, instances of metric.Result return Value as one of these logical outputs:

  • 0 — The requirement is not linked to tests in the project.

  • 1 — The requirement is linked to at least one test with a link where the Type is set to Verifies.

See Also

Related Topics