January 19, 2009

Requisite Pro TestTrack TCM Add-In

Helix ALM
Linking test cases with requirements can be a critical part of proper traceability. How this is done can depend on the how requirements and test cases are tracked and the level of tracebility needed. With TestTrack users, one part of the equation is already answered. Test cases are tracked using TestTrack TCM and this provides a flexible, yet robust application that tracks testing efforts while meeting compliance requirements. So the other part of the equation is how are requirements handled? Some of our users have taken many approaches:
  • TestTrack Pro: Many users already use TestTrack pro to track more than just defects. They track feature requests, change requests, support tickets just to name a few. So it is not that difficult to add another type, software requirement. This allows you to use the linking feature to easily link test cases with requirements, and able to use TestTrack's built in reporting engine to ensure test coverage. A sample project that shows how this can be implemented can be found here.
  • Files: Other users use documents (like Microsoft Word) to document their requirements. These documents can then be attached as files to test cases, or they can be tracked in a source code control tool (like Surround SCM) and attach it to a test case like a source code file, where file history can be viewed, changes can be checked out and back in.
  • Third Party Tool: There are tools out there that allow you to track software requirements. Integration between two tools that are not made by the same vendor can sometimes be a challenge. That is, unless both applications provide a programmable API.
[toc] This article deals with this last option, specifically IBM's Requisite Pro. Both TestTrack and Requisite Pro have API's that allow you to establish integration between the two tools. Requisite Pro's add-in capability allows you to launch an executable from within Requisite Pro, and its API allows you to interact with the open instance of Requisite Pro. I have created an executable that is meant to be used as an Add-in in Requisite pro. The Add-in allows you to link Requisite Pro requirements with TestTrack TCM test cases. The Add-in uses both the Requisite Pro and TestTrack SDKs.

Custom Fields

In order to allow a many to many relationship between requirements and test cases, a multi-select custom field is needed in both Requisite Pro and TestTrack TCM. The custom field in Requisite Pro is created only for Software Requirements, the label is set to Test Track Test Case and the type is multi select. Figure 1 below illustrates the set up of this field. Note that in order for Requisite Pro to let you creat the field, you must provide at least one value, hence the <Select TCM Test Case> value.

Figure 1 - Project Properties window

The custom field in TestTrack is created for test cases. If you would like the requirement to also show in the test runs, make sure you create a custom field that is exactly the same for test runs. The field is a pop-up menu that supports multi selection. Figure 2 below illustrates the setup of this field. Note that just like in Requisite Pro, you must provide at least one value, hence the <Requisite Pro Requirement Number> value.

Figure 2 - TestTrack custom field set up

Note: The custom field names are hard coded in the add-in.

The add-in

It should be noted that this is provided as an example of what can be done with both applications API. You may find this useful, but this is not to be considered a Seapine Software release. This is something I did on my own and provide no guarantees with it. If you choose to use this, you do so under your own risk and assume all responsabilities. Only download the installer if you agree to this. Seapine does not offer support for this. Figure 3 below illustrates the Add-in showing the not filtered view of test cases from a sample project.

Figure 3 - Add-in

Program Flow

Start up

When the Add-In is invoked, it checks for configuration information. If it does not find it, it opens a window where the user can enter the information required to connect to TestTrack. If it find the nescessary information, it attempts a connection to TestTrack, and upon successful connection, it loads the filter combo box with the list of filters for test cases for the project specified in the configuration.

Link

When the link button is clicked, the add-in first checks to ensure that a test case is selected. If there is one selected, then it checks to make sure that a project is open and a requirement is selected in an open instance of Requisite Pro. If both items required are selected, then the add-in first checks to see if the test case has already been added as a value in the custom field in Requisite Pro. If it does not find it, it adds it the list of items for that field. Once it is there, it selects it for the selected requirement. The add-in then does the same in TestTrack. It checks to see if the requirement is already a value in the custom field. If it does not find it, it adds it to the value list of the custom field. Once the value is there, it selects it for that test case. Figure 3 below shows a sample Requisite Pro requirement with test cases associated with it (highlighted).

Figure 4 - Requisite Pro requirement

Figure 4 below shows a sample test case with requirements associated with it (checked).

Figure 5 - TestTrack test case

Installation

You can download the installer package from here. Run the installer, select whether to make this available to everyone that uses your computer or just you and the installation path.

Configuration

To add this as an add-in in Requisite Pro, simply create an .mnu file. You can find a sample here. There you can also find some examples of how to use the Requisite Pro API and the TestTrack API. When the application starts up for the first time, it will not find the configuration file ("C:TTConfig.XML"). Figure 5 below illustrates the window that comes up when it does not find the configuration file.

Figure 6 - Configuration window

The following information is needed to connect to the TestTrack project:
  • Server: The full URL path to the ttsoapcgi.exe.
  • Username: The TestTrack user to use to perform all of the actions. Must have permissions to login via SOAP.
  • Password: Password of the above user.
  • Project: List that is populated once all of the above information is provided.
There is a handy-dandy Test Connection button which makes a call to the TestTrack SOAP CGI. If any errors occur while making this call, you will get an error that the connection failed. Click OK to save changes, Cancel to discard them. NOTE: At this time, closing this window will not launch the test case list window. You will have to launch the executable again. The only way to get this window to show up is to remove/rename the C:TTConfig.xml file. The location and name of the configuration file is hard coded at this time.