Link to Requirements in IBM Rational DOORS

Introduction and Setup

You can link test cases that you created in the Test Case Editor to requirements that are in IBM® Rational® DOORS®. This is done through the Requirements tab in the Test Case Editor. The integration allows you to easily link any DOORS requirements to any test cases by selecting them using their object headings.

    Note:   You need a license for Simulink® Verification and Validation™ to use this feature.

    Note:   Before using this feature, you must run a setup program one time on the machine you will be using. In a command window, type

    rmi setup

    and press Enter. This function is part of Simulink Verification and Validation setup and enables the use of the IBM Rational DOORS integration to link requirements to a test case in SystemTest™. For more information, see the rmi function in the Simulink Verification and Validation documentation.

Add Requirements

Requirements are linked to the currently selected test case in the Test Case Editor.

To add requirements to a test case:

  1. Select a test case from the Test Cases list in the Test Case Editor.

  2. Click the Requirements tab.

  3. Click the Add link to new DOORS module button.

    The DOORS module selection dialog box opens. Note that DOORS must be open for this integration to work. If DOORS is not open, an error occurs.

  4. In the Browse DOORS dialog box, browse to the module you want to link to.

  5. Click OK to add the module.

    The requirement appears in the table in the main area of the Requirements tab.

  6. Select the object heading you want to link to.

After you add a requirement, the Add button becomes Add link to last DOORS module and the Browse DOORS dialog opens to the module from which you have already selected.

Requirements Tab

The table displays requirements and contains the following columns:

  • Location — Displays the module location.

  • Description — Displays the DOORS title number and heading.

In the details section under the table, details of the selected requirement are displayed, as follows:

  • Document Type — Indicates the source document of the requirements, in this case, IBM Rational DOORS.

  • Module Location — Shows location of the DOORS document.

  • Object Heading — Displays the list of available objects in the module location. It shows the DOORS object ID number, title number, and heading. Selecting an object updates the description in the Object Text area.

  • Object Text — Displays DOORS object text of the currently selected object heading. It is empty if DOORS is not open or available.

    Note in the previous illustration that object 2: "1.1 Purpose of the Document" is selected, and its Object Text is displayed, "This document provides.....".

  • View in DOORS button — Navigates to the object in DOORS. If DOORS is not open or available, it produces an error.

    In the example shown above, where the requirement 2 (number 1.1, Purpose of the Document) was selected, when the View in DOORS button is clicked, the following graphic shows how it opens in DOORS with that requirement selected.

Test Case Report

The Test Case Editor has a separate report that links from the SystemTest Test Report. If you link requirements to a test case, additional sections are added to the Test Case report.

The Requirements section is created if at least one requirement is attached to a Test Case Data test vector. If you have a Simulink Verification and Validation license, the Object Text will be available in addition to the other information.

A Test Case Editor report is generated when a SystemTest Test Report is generated and you run a test that uses a Test Case Data test vector. To enable the Test Report, in the SystemTest desktop, click the test name in the Test Browser, and then click the Output Files tab on the Properties pane. In the Select File Names section, select the Generate report option.

If the report is enabled and you run a test containing a Test Case Data test vector with requirements, you can open the report at the end of the run by clicking the Test Report link in Run Status pane of the SystemTest desktop.

Using the example from the previous section, the following window shows the report that is created.

At the top of the report you can see the link to the Test Case report. When you click that link, the Test Case Report opens.

Notice the link to the requirement in that report. If you click that link, the details about that requirement appear.

Create Requirements Programmatically

In addition to creating requirements in the Test Case Editor as described in the previous sections, you can create requirement links programmatically for sue with IBM Rational DOORS.

To create a requirement link, use the systest.requirements.createlink function, as follows. Note that DOORS must be running.

Create a requirement link object to a DOORS object "1" in the module "/example/MyModule".

 reqLinkObj = systest.requirements.createLink('DOORS', '/example/MyModule' ,'DOORS Object','1')

Create a requirement link object from a requirement link structure attached to a Signal Builder block in a model.

blockPath = 'mymodel/SignalBuilderBlock/';
reqStruct = rmi('get',blockPath,1);
reqLinkObj = systest.requirements.createLink(reqStruct);

For more information, see the reference page for systest.requirements.createlink.

You can determine the supported requirements information using the getInfo function.

info = systest.requirements.getInfo(format,modulelocation) returns information describing the supported link values in the modulelocation for a given format. format and modulelocation must be specified as a string. format is not case sensitive but modulelocation is case sensitive. info is returned as a 1x1 structure containing the following fields:

  • ModuleID – A string containing the module ID.

  • ModuleLocation – A string containing the module location.

  • AvailableObjectIds – A 1xN cell array of strings containing the object IDs for the specified ModuleLocation.

  • ObjectID – The ID string for the DOORS object.

  • ObjectHeading – The heading string of the DOORS object.

To get the module location of the DOORS object:

doorsObject.ModuleLocation

You can use the function getObjectText() to get the Object Text of a DOORS object when DOORS is open:

txt = getObjectText(doorsObject);

You can use the getStatus() function to determine the requirement link's status.

[validflag msg] = getStatus(obj) gets the status of a DOORS Requirement link object obj. validflag is true if you are also able to navigate to the DOORS object. If validflag is false, the function returns a message msg describing why the link is invalid.

You can view the requirement link in DOORS using the view() function. To open the link in the module:

view(obj)

This function opens the module in DOORS if the link is valid. It throws an error if DOORS is not available or open. It also errors if Simulink Verification and Validation is not installed. It errors if getStatus(obj) is false.

Examples

A design engineer at an automobile company uses DOORS to capture her requirements. The requirements are in a module inside a project. The engineer has created a test case for three of the requirement objects in the module. She wants to link these requirements to the test case.

objectIDList = {'001234','001235','001236'};

module = '/ProjectCar/EngineModel';

doorsReqObjs = systest.requirements.createLink('DOORS',module,'DOORS Object',objectIDList);

testCases.Properties.Requirements = doorReqObjs;

While working in the test case, the engineer wants to look at the requirements to make sure the test case has the correct values.

view(testCase.Properties.Requirements(3))
Was this topic helpful?