You can scope coverage results to linked requirements-based tests from the Simulink® Test™ Manager. 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.
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 Simulink Requirements™. 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.
To scope coverage results to linked requirements, you must:
Have licenses for Simulink Test and Simulink Coverage™.
Link requirements in Simulink Requirements to model elements and to test cases in Simulink Test that verify the requirements. For more information on creating requirements links, see Link Blocks and Requirements (Simulink Requirements).
You cannot create or edit requirements links or view detailed information about the requirements without a Simulink Requirements license.
Collect coverage by using the Simulink Test Manager, and enable Scope coverage results to linked requirements for the aggregated coverage results. For more information on setting up coverage collection in the Simulink Test Manager, see Collect Coverage in Tests (Simulink Test).
The following coverage report shows requirements testing details and coverage details for a MultiPortSwitch block called MPSwitch1.
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.
For an example of how to scope coverage results to linked requirements from the Simulink Test Manager, see Test Coverage for Requirements-Based Testing (Simulink Test).