Main Content

Review Requirements Verification Status

You can view the verification status of your requirements in the Requirements Browser and Requirements Editor. The verification status reflects results of certain MATLAB® tests, as well as Simulink® Test™ tests and Simulink Design Verifier™ property proving.

Verify Functional Requirements

The requirement type specifies the role of a requirement. Functional requirements as well as requirements with a custom type that is a subtype of the Functional type, are meant to be implemented and contribute to the verification status summary. Other requirement types do not contribute to the verification status. For more information, see Requirement Types and Define Custom Requirement and Link Types by Using sl_customization Files.

To verify functional requirements, use Verify type links to link them to verification items. For more information, see Link Types. You can only verify requirements by using these verification items:

  • MATLAB testing: The requirements verification status reflects the results of MATLAB tests that you run by using the Requirements Editor or using the runTests method. Additionally, if you have MATLAB Test, you can verify requirements in projects by using the MATLAB Test Manager (MATLAB Test). For more information, see Verify Requirements with MATLAB Tests.

    Note

    Test results from the Test Browser do not affect the verification status in the Requirements Editor.

  • Simulation testing: Requirements verification status reflects the results of the following linkable Simulink Test items after you run these items in the Test Manager:

    • Test files

    • Test suites

    • Test cases

    • Iterations

    • Assessments

    For more information on how to link Simulink Test items to requirements, see Link Test Items to Requirements

    To learn how to verify requirements with Simulink Test items, see Test Model Against Requirements and Report Results.

    Run tests from the Simulink Test Manager, or by using the sltest.testmanager.run (Simulink Test) function. For a brief tutorial on creating and running a test case, follow the first part of Create and Run a Baseline Test Case (Simulink Test).

    Capture run-time assessments from verify (Simulink Test) statements or Model Verification Blocks (Simulink Test) by monitoring those assessments through test cases in the Test Manager.

    If you link a step in Test Sequence block that contains a verify (Simulink Test) statement to a requirement, then you can visualize the verification status of that corresponding verify statement when:

    • Test Harness: You simulate the test harness containing the Test Sequence block and open the simulation results in Simulink Data Inspector (SDI)

    • Test Manager: You run tests in Simulink Test which executes the Test Sequence block with step containing verify statement.

    Alternatively, use the Run Tests option from the Requirements menu or the runTests function to run batch tests for the specified requirements.

    If you manually set the link type for a step to be verified by when the step does not contain verify statements, then the verification status will remains unexecuted. Assert statements will not be marked as verified by in the Requirements Editor. For more information, see Assess Model Simulation Using verify Statements (Simulink Test).

  • Property proving: Verification status reflects the analysis results of properties modeled using:

    Link blocks to requirements, then analyze the properties. For more information, see Validate Requirements by Analyzing Model Properties.

You can also verify requirements by linking to external result sources with Confirm type links. For more information, see Include Results from External Sources in Verification Status

Run Link Verification Analysis

Requirements Toolbox™ does not perform link verification analysis until you run it. You can run the analysis in Requirements Editor or Requirements Perspective.

A banner in the Requirements Editor or Requirements Perspective indicates when results are pending. To run the analysis, click Analyze now in the banner. Alternatively, click Refresh in the Requirements Editor or the Refresh button in the Requirements Perspective.

Link verification analysis continuously runs in the background until you use slreq.clear.

Alternatively, you can use updateVerificationStatus and getVerificationStatus to view the verification status at the MATLAB command line without running the analysis in the Requirements Editor or Requirements Perspective. You can also use runTests to run tests linked to requirements in the requirement set and get the verification status at the command line.

Verify Requirements by Running Tests or Analyses

Generate the verification status by running tests or analyses linked to your requirements.

  1. In the Requirements Editor, right-click the requirement and select Run Tests.

  2. In the Run Tests dialog box, select the tests.

  3. Click Run Tests.

Note

If a requirement has an unresolved link to a test, Requirements Toolbox does not run the test. For more information on resolving links, see Load and Resolve Links.

You can also update verification status by running tests or analysis outside of the Requirements Editor.

  • Run MATLAB tests by using the MATLAB Test Manager (MATLAB Test).

  • In Simulink Test, run the tests in the Simulink Test Manager.

  • In Simulink Design Verifier, run property proving analysis.

  • In Simulink, run the model that contains the Model Verification blocks.

Note

  • If you have linked requirements to Simulink Design Verifier Proof Objective blocks in multiple models, the Run Tests dialog box runs a Simulink Design Verifier analysis when the corresponding models are open.

Display Verification Status

The verification status is summarized in the Verified column of the Requirements Browser and Requirements Editor. To display the column:

  • In the Requirements Editor, select Columns > Verification Status

  • In the Requirements Browser pane of the model window, right-click a requirement and select Verification Status.

For example, the Verified column shows partial verification links for this requirement set, with one failed result.

The Requirements Editor shows the Implemented and Verified columns for a requirement set. The mouse points to the bar in the Verified column for one of the parent requirements. The tooltip shows that seven of the child requirements have a passed status, one has a justified status, one has a failed status, one has an unexecuted status, and eight have no links.

The fullness of the bar indicates how many requirements in a group including the parent requirement and children requirements are linked to verification items. The color indicates the test or analysis results:

  • Passed (green): The linked test(s) passed, or the analysis proved the objective(s). If a requirement has links to more than one verification item, all items must pass for the requirement verification status to display a passed result.

  • Failed (red): The linked test(s) failed, or the analysis falsified the objective(s). If a requirement has links to more than one verification item and any one item fails, the requirement verification status displays a failed result.

  • Justified (light blue): The requirement is excluded from the status with a justification. For more information, see Justify Requirements.

  • Unexecuted: (yellow): The linked test(s) or objective(s):

    • Have not run or executed

    • Have been updated more recently than the most recent result

  • None (empty): The requirement does not have Verify type links.

Include Verification Status in Report

You can include verification status in your requirements report.

  1. In the Requirements Editor menu, select Report > Generate Report.

  2. Select Verification Status.

  3. Click Generate Report.

For more information, see Report Requirements Information.

See Also

Apps

Related Examples

More About