The UnitTest sensor data type is designed for representation of the outcome of single unit test invocation on a source file in a tool and language independent manner. Table 25.20, “UnitTest SDT attributes” documents its attributes.
Table 25.20. UnitTest SDT attributes
| Attribute | Description |
|---|---|
| tstamp | The UTC time at which this data was collected. |
| tool | A string indicating the tool that collected this data, such as "JUnit". |
| result | A string that should specify either 'pass' or 'failure'. |
| path | The fully qualified file path to the file containing the test cases that were run. |
| name | The name of the test case. |
The Ant build tool supports invocation of JUnit tests. A sensor for Ant represents this data as UnitTest entries.
Once collected, UnitTest data can be used to track trends in the success rate of unit tests associated with a system as it is developed, and to investigate potential relationships between test success/failure and other product or process measures, such as size, defects, time, dependencies, build failures, and so forth.