Main Content

Identify and Address Traceability Gaps

In order to consider the requirements traceability of a requirement set complete, each functional requirement in the set must have an implementation and verification link. In addition to using the implementation and verification status to track progress, you can identify and visualize traceability gaps in your project by using traceability matrices and diagrams.

In this step of the tutorial, you view a traceability diagram for the requirements in the project to visualize their links to designs and tests, use a traceability matrix to view unlinked tests, address the traceability gaps by creating links, and visualize the completed traceability.

Visualize Traceability for Requirements

Open the myAdd2 project, which is similar to the myAdd project, but contains updated versions of the files that you changed in previous steps.

openProject("myAdd2");

Open the tMyAdd test file and the myAddTestSpecification requirement set.

open tMyAdd
slreq.open("myAddTestSpecification");

In the Requirements Editor, select the requirement that has the ID Req5. In the Analysis section, click Traceability Diagram.

The traceability diagram for requirement 2.1 shows that the requirement links to a justification for implementation and the test tNeg for verification.

The Traceability Diagram window shows that the requirement has both an implementation and a verification link.

Open the myAdd function and the myAddReqs requirement set.

open myAdd
rs = slreq.open("myAddReqs");

View the traceability diagram for requirement 1.

The traceability diagram shows that requirement 1 links to the myAdd function for implementation.

The Traceability Diagram window shows that the requirement only has an implementation link.

Identify Traceability Gaps

Create a traceability matrix that examines the links between the requirement sets and the tMyAdd test file:

  1. In the Requirements Editor, click Traceability Matrix.

  2. In the Traceability Matrix window, click Add.

  3. In the Select Artifacts dialog box, click Select Multiple Artifacts.

  4. In the Configure Matrix window, add myAddReqs.slreqx and myAddTestSpecification.slreqx to the left side of the matrix by right-clicking the file name in the Available Artifacts pane and selecting Add to the left.

  5. Add tMyAdd.m to the top by right-clicking the file and selecting Add to the top.

  6. Remove any additional artifacts from the traceability matrix by right-clicking them and selecting Remove Artifacts.

  7. Generate the matrix by clicking Generate Matrix.

The Configure Matrix window has the myAddReqs requirement set and the myAddTestSpecification on the left, and the tMyAdd test file on top.

Filter the matrix to only show functional requirements that are missing links by selecting these filters in the Filter Panel:

  • Left > Type > Functional

  • Left > Link > Missing Links

Similarly, only show test functions that are missing links by applying these filters:

  • Top > Type > Function

  • Top > Link > Missing Links

Highlight the rows and columns that do not have links by clicking Highlight Missing Links in the toolstrip.

The requirements in the myAddReqs requirement set do not have links to tests in the tMyAdd test file. The tests tInput, tAdd, and tOutput do not have links to requirements in either requirement set.

Close Traceability Gaps

Close the traceability gaps between the myAddReqs requirement set and the tMyAdd test file by creating links between these requirements and the test functions. Hold Ctrl to select the cells that correspond to these rows and columns:

  • Take two inputs requirement and tInputs test function

  • Add the inputs requirement and tAdd test function

  • Output the result requirement and tOutput test function

Click Create Link in the toolstrip. In the Create Links dialog box, click Create.

The traceability matrix shows links between 3 of the 4 requirements and the 3 tests.

To link the last remaining unlinked requirement, clear the filter Top > Link > Missing Links. Create a link between the Inputs should be finite requirement and the tFinite test function.

The mouse points to the cell corresponding to the requirement that has the summary Inputs should be finite and the test tFinite.

Save the link set. In the Requirements Editor, click Save > Save All.

Visualize Completed Traceability

Re-open the traceability diagram for requirement 1 in the myAddReqs requirement set.

req = find(rs,Index=1);
slreq.generateTraceabilityDiagram(req)

Refresh the traceability diagram by clicking Analyze.

The traceability diagram shows that requirement 1 now has a verification link to tInputs.

The Traceability Diagram window shows that the requirement now has both an implementation and verification link.

See Also

Apps

Classes

Functions

Related Topics