You can associate your GoogleTest test cases with development artifacts, such as requirements or tests, to help you track the quality of the application under test. After sending test results to DTP, the Parasoft Traceability Pack extension for DTP enables you to view traceability information in DTP widgets, reports, and other visualizations. See the DTP user guide for details on configuring DTP to display traceability information, and on connecting to your application lifecycle or requirements management system (ALM/RMS).
Associations are established by registering traceability data directly in a test case, using the RecordProperty(KEY, VALUE) GoogleTest function. The KEY should be a traceability tag, and the VALUE should be an artifact identifier.
The following traceability tags are supported:
Tag | Description |
|---|---|
| Correlates a test case with a requirement |
| Correlates a test case with a test definition |
| Correlates a test case with a task |
| Correlates a test case with an asset |
| Correlates a test case with a feature request |
| Correlates a test case with a problem report |
req and test tags are special tags in C/C++test that enable traceability from a test case to an artifact in your application lifecycle or requirements management system (ALM/RMS).The following test case is associated with the requirement identifier 'req-12345' and the test identifier 'test-12345' using the RecordProperty(KEY, VALUE) function:
TEST(AllTests, TestCaseWithTraceability)
{
// Traceability associations
RecordProperty("req", "req-12345");
RecordProperty("test", "test-12345");
EXPECT_EQ(getValue(0, 0), 0);
}
After executing the tests, the GoogleTest test report (.xml) will include the traceability associations:
<testcase name="TestCaseWithTraceability" status="run" result="completed" classname="AllTests">
<properties>
<property name="req" value="req-12345"/>
<property name="test" value="test-12345"/>
</properties>
</testcase>
Be sure to publish the test report to DTP to fully leverage the traceability associations using the Parasoft Traceability Pack extension for DTP; see Publishing Reports to Parasoft DTP for more details.