Main Content

Requirements per Test Case

Metric ID

RequirementsPerTestCase

Description

Use this metric to count the number of requirements linked to each test. The metric analyzes only tests that run on the model or subsystems in the unit for which you collect metric data. A test is linked to a requirement if it has a link where the Type is set to Verifies.

Computation Details

The metric:

  • Analyzes only tests in the project that test:

    • Unit models

    • Atomic subsystems

    • Atomic subsystem references

    • Atomic Stateflow® charts

    • Atomic MATLAB® Function blocks

    • Referenced models

  • Counts only links where the Type is set to Verifies that link to requirements where the Type is set to Functional. This includes links to requirements that are not linked to the unit or are linked to other units. For each test that is linked to requirements, check that the links are to requirements that are implemented by the unit that the test runs on.

Collection

To collect data for this metric:

  • In the Model Testing Dashboard, click a metric in the section Requirements per Test to display the results in a table.

  • Use getMetrics with the metric ID RequirementsPerTestCase.

Collecting data for this metric loads the model file and requires a Simulink® Test™ license.

Results

For this metric, instances of metric.Result return Value as an integer.

See Also

Related Topics