Coupling NI Requirements Gateway with the LabVIEW Unit Test Framework Toolkit

Publish Date: Aug 09, 2013 | 16 Ratings | 1.00 out of 5 |  PDF

Overview



LabVIEW


Coupling Series Home


TestStand


Note: This document applies to NI Requirements Gateway versions 1.1 and earlier. For information on newer Requirements Gateway versions, refer to the Coupling External Applications with NI Requirements Gateway topic in the NI Requirements Gateway help.

The LabVIEW Unit Test Framework Toolkit drastically simplifies the lives of design and test engineers who need to prove that their LabVIEW applications work, and work every time. Using a set of test vectors, LabVIEW Unit Test Framework Toolkit users can automate the process of testing their code using any number of user-defined inputs and expected outputs, and can even track the percentage of code that has been covered by unit tests. NI Requirements Gateway provides a natural extension to the software engineering process with LabVIEW by tracking the requirements and their VI implementations that the Unit Test Framework Toolkit is designed to test.

Table of Contents

  1. Integration with NI Requirements Gateway
  2. The LabVIEW Unit Test Framework Test Definition Type
  3. Specifying Requirement Coverages in LabVIEW Unit Tests
  4. Propagating Requirement IDs to Unit Test Framework Test Results
  5. The LabVIEW Unit Test Framework Test Result Type
  6. Specifying Requirement Coverages in LabVIEW Unit Test Results
  7. Additional Resources

1. Integration with NI Requirements Gateway

The LabVIEW Unit Test Framework Toolkit is designed to be integrated with NI Requirements Gateway in two ways. 

First, a unit test definition can specify that a unit test itself covers a particular requirement.  In this fashion, users can guarantee that VI implementations of specified requirements have tests to cover their functionality.

Second, a unit test result can cover requirements. This allows users to extend coverage to the results of unit tests, not just the existence of the unit tests themselves. 

Figure 1 - The NI Requirements Gateway Management View of an example LabVIEW Unit Test Framework project

Within the NI Requirements Gateway project configuration, users should ensure that they specify project coverage in such a fashion (Boolean AND) that a requirement set forth in a specification document is not considered met until it has been covered by code implementation, unit test definition, and a passing unit test result – an all new precision for guaranteeing the integrity of LabVIEW code.

Figure 2 - The requirements in the Specification document are not considered covered until met by code implementation, unit test definition, and passing test result

Back to Top

2. The LabVIEW Unit Test Framework Test Definition Type

The LabVIEW Unit Test Definition type installs with the LabVIEW Unit Test Framework Toolkit.  Users can find the type for LabVIEW Unit Test Definition (*.lvtest) files within the <LabVIEW>\examples\Unit Test Framework\NI Requirements Gateway folder.  The type is accessible and demonstrated in the NI Requirements Gateway example project entitled Basic Functions.

As with all custom defined types, if you want to make a type available for all projects, you should follow one of two procedures:

  1. In the NI Requirements Gateway project configuration that utilizes a particular type, place the type into the Public folder.
  2. Copy the type definition from the *.types file wherever it is located on disk into the public types definition file located at <Requirements Gateway Public>\Config\types\public\public.types.

Figure 3 - A portion of the Public NI Requirements Gateway type definitions

Back to Top

3. Specifying Requirement Coverages in LabVIEW Unit Tests

LabVIEW Unit Tests are designed to easily integrate with NI Requirements Gateway for requirements management purposes.  Relationships between requirement specification documents and LabVIEW Unit Tests can be specified using the requirement ID of each requirement as a traceability relationship.

When configuring LabVIEW Unit Tests via the Configuration page of the Test Properties dialog box, you can specify the requirement IDs of all of the requirements that a particular unit test covers within the Requirement ID entry box.  If a particular unit test covers multiple requirements, specify the requirement IDs of each requirement in a semi-colon separated list.

Figure 4 - Requirement coverage can easily be specified via the Requirement ID portion of the Test Properties dialog box

Furthermore, since LabVIEW Unit Test definition files (*.lvtest files) are simply tab-delimited files, users can specify requirement IDs of all of the requirements that a particular unit test covers by directly editing the definition file.

Figure 5 - Alternatively, requirement IDs can be specified directly in a tab-delimited unit test definition file

Back to Top

4. Propagating Requirement IDs to Unit Test Framework Test Results

The test results of a LabVIEW Unit Test are designed to be customizable.  In order to customize LabVIEW Unit Test results, Open the LabVIEW project that contains the files on which you want to perform unit testing and navigate to the Project Properties by choosing Project » Properties.

Within the Project Properties dialog box there are several Unit Test categories, including Unit Test: Generate Reports and Unit Test: Report Details.  These two categories allow you to specify the type of report generated as a result of your unit test and the contents of the report.

Because the LabVIEW Unit Test Framework Test Result type is designed to work only with ATML results, you must generate an ATML/XML report in order to use the LabVIEW Unit Test Framework test results with NI Requirements Gateway.  To do this, go to Unit Test: Generate Reports and make sure that you are generating a ATML/XML Report.

In order to propagate requirement IDs covered by unit tests through to unit test results so that you can use the test results to further cover requirements you must ensure that you have chosen to include details of Passed and Failed tests in the Unit Test: Report Details category.

Figure 6 - In order to propagate requirement IDs to test results, ensure that you include details of both Passing and Failing test results

Back to Top

5. The LabVIEW Unit Test Framework Test Result Type

The LabVIEW Unit Test Result type installs with the LabVIEW Unit Test Framework Toolkit.  Users can find the type for LabVIEW Unit Test Result files within the <LabVIEW>\examples\Unit Test Framework\NI Requirements Gateway folder.  The type is accessible and demonstrated in the NI Requirements Gateway example project entitled Basic Functions.

As with all custom defined types, if you want to make a type available for all projects, you should follow one of two procedures:

  1. In the NI Requirements Gateway project configuration that utilizes a particular type, place the type into the Public folder.
  2. Copy the type definition from the *.types file wherever it is located on disk into the public types definition file located at <Requirements Gateway Public>\Config\types\public\public.types.

Back to Top

6. Specifying Requirement Coverages in LabVIEW Unit Test Results

After you have specified the coverage of requirements in a LabVIEW Unit Test definition and ensured that details have been included in the Project Properties dialog box for Failed and Passed tests, requirement IDs will be automatically propagated to LabVIEW Unit Test Results in any of the three report formats – no extra work is required on the part of the user.

Figure 7 - Requirement IDs of the covered requirements are automatically propagated to unit test results

However, the LabVIEW Unit Test Framework Test Result type is designed to work only with ATML results.  Users can parse ASCII results using the more generic Requirements Gateway Text type, but HTML reports are not supported at this time.

Back to Top

7. Additional Resources

NI Requirements Gateway

LabVIEW Unit Test Framework Toolkit

LabVIEW and CMMI-Compliant Requirements Management

Download Free Evaluation Software

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit