Guy on Simulink

Simulink & Model-Based Design

Tracing Requirements to Models, Tests, and Generated Code

When I wrote a post about the R2013b new features, Fraser replied in a comment that one of his favorite new feature is the requirements linking to MATLAB code.

This made me realize that I never described on this blog how Simulink Verification and Validation allows the tracing of requirements to models, tests, and generated code:

Tracing requirements to models, tests, and generated code

To help readers not familiar with this topic, this week I give a quick overview of how Simulink Verification and Validation can facilitate maintaining and demonstrating traceability of high-level requirements to Simulink models and generated code.

Linking Blocks to Requirements

The first step is to link requirements stored in an external document to blocks in your model. If I have requirements stored in a Microsoft® Word document, I can select the text I want to link:

Select Text in the Requirement Document

Then I go to the model, right-click the block to be linked and select Link to Selection in Word:

Linking a block to external requirement

Once the link is created, you will see a hyperlink in the Word document. Clicking this link highlights the linked block in Simulink.

Word Document linked to a Simulink block

In the model, the right-click menu of the block now contains a link that can be used to highlight the requirement in Word.

Simulink block linked to an external requirement

Requirements in the generated code

If you generate code for your model, you can choose to include the requirements as comments in the code. In the code generation report, you will see hyperlinks allowing you to navigate directly to the requirements document.

Code Generation report with requirement link

Traceability report

To get the big picture of the requirements in your model, you can generate a traceability report. Using Simulink Report Generator, you can configure the look of the report.

For the simple block in the example above, the default report looks like this:

Traceability Report

Requirements Consistency Check

As your project evolves, you can run a set of Requirements Consistency Checks in the Model Advisor to ensure that the requirements links are still up-to-date and valid.

Consistency Checking

Now it's your turn

Consult the Simulink Verification and Validation product page or its documentation to learn more about how it can help you manage requirements and a lot more.

How do you navigate between your Simulink models and your requirements? Let us know by leaving a comment here.

|
  • print

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。