In this section:
The Test Impact Analysis slice calculates testing metrics that are affected by code changes and outputs the data in widgets and reports shipped with the artifact, as well as in the DTP Test Explorer. The slice collects all files in a code base and analyzes the test cases associated with each file. If a file has been modified within the specified date range and the test cases associated with it have not run since the change, then the test case "Action" field will be set to "Retest". Otherwise, the test case "Action" will not be modified.
In order to generate accurate results, the test case information is merged across two builds. Baseline and Target build ID are configured through drop-down menus when the widget is created. Both builds require coverage and dynamic analysis data for the widget to render properly.
Resubmit data if updating Test Impact Analysis
Coverage data stored in previous versions of DTP (5.3.2 and older) cannot be used to calculate testing metrics used in this extension. You will need to send a new test and coverage report to DTP server and set the build containing the new reports as the baseline when configuring the widget.
You can resubmit a previous build report to the data collector to populate the data. Once the data is in DTP, make sure to archive the build so that it won't be removed during normal database clean up (see Locking and Archiving Builds).
Comparing builds from different branches is not currently supported. Tests from the development branch, for example, are considered different tests from master branch.
- Parasoft DTP and Extension Designer 5.4.1.
- A DTP filter must be configured to receive Run Configurations from Coverage and Dynamic Analysis (unit testing, functional testing, manual testing) runs. See Associating Coverage Images with Filters.
You can confirm that the filter and build meet these requirements by looking at the Build Administration widget:
See Downloading and Installing Artifacts for instructions on installing DTP Enterprise Pack extensions.
Caching the Data
Because you can run the Test Impact Analysis slice over extended periods of time, the slice includes a caching mechanism to speed up multiple requests for the same data. When data is requested, the slice first determines if the data is already computed and cached. If the cache exists, the data is returned directly and the lengthy computation is skipped. The cache is cleared and recomputed on the fly, however, if no data is cached, if the cached data is associated with a different build combination, or if additional analysis data has been reported to the build combination. There is one cache per filter and combination of baseline and target build.
Clearing the Cache
Because the slice does not automatically remove cached data, the cache can grow as more filters are introduced. To help you clear out old cache data, the slice provides a way to delete all cached calculations from the Enterprise Pack database. This flow cleans all cached calculations. The cache also clears at 00:00 every day. You can configure the auto cache clearing setting by editing the Clean Cache inject node.
The Test Impact Analysis slice ships with the Tests Impacted by Change - Pie Chart widget. This widget shows the number of tests that passed, failed, are incomplete, and require rerunning. See Adding Widgets for details on adding widgets to a dashboard in DTP.
|Title||You can change the default title of the widget.|
|Filter||Choose a filter from the drop-down menu. A filter is a collection of test execution and code analysis metadata configurations that enables DTP to aggregate, subset, and analyze specific swathes of data.|
|Period||Choose a range of time or number of builds to set as the scope.|
|Baseline Build||The build that you want to compare to the target build|
|Target Build||The build you want to analyze; typically, this is the latest build|
|Coverage Image||Coverage images are identifiers for the coverage data associated with a test run. The filter must be set to the correct coverage image to present information.|
Check Build Administration to Get the Correct Build
By default, the Baseline Build and Target Build are configured to use the dashboard settings. The slice will automatically select the two most recent builds, but these builds may not contain test and coverage details. You should check the Build Administration page in DTP and use an appropriate baseline and target build when configuring the widget as described in the Requirements section. Also see Build Administration.
The widget shows the data in a pie chart.
If there are any issues with the data, the widget will print an error describing the problem. The following error messages are examples may appear:
To address the errors:
- Verify that the coverage information is accessible (see Requirements).
- Verify that the filter has a coverage image associated with it (see Associating Coverage Images with Filters).
- Verify that the correct coverage image was selected when you added the widget (see Widget Configuration).
Exploring the Results
Click on a region in the Tests Impacted by Change widget to open the Files Impacted by Change drill-down report.
You can perform the following actions in this report: