Main Content

Assess Coverage Results from Requirements-Based Tests

You can scope coverage results to linked requirements-based tests from the Test Manager in Simulink® Test™. The aggregated coverage results are scoped such that each test only contributes coverage for the corresponding model elements that implement the requirements verified by that test.

Rationale for Scoping Coverage Results to Linked Requirements-Based Tests

If your model-based design workflow requires that models are fully exercised by requirements-based tests, you can scope your coverage results to only those outcomes exercised by requirements-based tests. As an example, DO-178C suggests that structural coverage information collected during requirements-based testing should confirm that the degree of structural coverage is appropriate and satisfies the software requirements. When you enable Scope coverage results to linked requirements, the aggregated coverage results are scoped such that each test only contributes coverage for the corresponding model elements that implement the requirements verified by that test.

You define requirements and link them to model elements and tests by using Requirements Toolbox™. Scoping coverage results to linked requirements allows you to produce evidence that your model coverage comes from the intended requirements-based tests and is not a side effect of an unrelated test. Scoping coverage results to linked requirements can also reveal inadequate requirement linking or testing gaps that might otherwise be difficult to detect in aggregated coverage results.

Prerequisites for Scoping Coverage Results to Linked Requirements-Based Tests

To scope coverage results to linked requirements, you must:

  • Have licenses for Simulink Test and Simulink Coverage™.

  • Link requirements in Requirements Toolbox to model elements and to test cases in Simulink Test that verify the requirements. For more information on creating requirements links, see View and Link Requirements in Simulink (Requirements Toolbox).

    Note

    You cannot create or edit requirements links or view detailed information about the requirements without a Requirements Toolbox license.

  • Collect coverage by using the Test Manager in Simulink Test, and enable Scope coverage results to linked requirements for the aggregated coverage results. For more information on setting up coverage collection in the Test Manager in Simulink Test, see Collect Coverage in Tests (Simulink Test).

Coverage Reporting for Aggregated Coverage Results Scoped to Linked Requirements

The following coverage report shows requirements testing details and coverage details for a MultiPortSwitch block called MPSwitch1.

Coverage report for Multi port switch block "MPSwitch1" displays a decisions analyzed table with three rows. The first decision outcome is tested and satisfied by test T1. The second decision outcome is tested but not satisfied by test T2. The third decision outcome is not tested.

In the example above, MPSwitch1 implements Requirement 1, which is verified by Testcase 1. Therefore, Testcase 1 attempts to provide full coverage for MPSwitch1. Scoping coverage results to linked requirements makes it easier to assess the extent to which MPSwitch1 was exercised by Testcase 1 when viewing aggregated coverage results.

The first decision outcome is successfully exercised by Testcase 1 and is reported as satisfied. The second decision outcome is not exercised by Testcase 1, but is reached by a test unrelated to Requirements 1. The coverage report therefore reports this decision as not satisfied.

The third decision outcome is not exercised by any test and is therefore reported as not satisfied.

Example

For an example of how to scope coverage results to linked requirements from the Test Manager in Simulink Test, see Test Coverage for Requirements-Based Testing (Simulink Test).

Related Topics