In this chapter:
Modified Code Coverage helps reduce the testing scope associated with code changes (such as implementing a feature) so testers can focus on the uncovered code and increase their testing efficiency. It also helps teams maintain an audit trail of the risk associated with untested changes. Modified Code Coverage performs the following actions:
The artifact is implemented as widget that reports the coverage percentage for the lines of code that have been changed since a baseline build. It also graphically indicates the coverage achieved on each new or modified line of code.
DTP must have access to the source code. You can integrate DTP with your source control system or configure the code analysis tool to publish sources to DTP as part of their analysis. For details, see Configuring Source Code Views.
If DTP reads sources from Parasoft code analysis and testing tool reports, make sure that source information is always included by setting the |
DTP continually receives and cleans large amounts data from its database. By default, the unit test and coverage information associated with a build will be automatically deleted after two more builds containing unit test and coverage information are reported to the same DTP project. You can lock builds that contain your baseline data to prevent it from being removed. We recommend keeping the baseline build ID locked while using the build for Modified Coverage and/or for DTP audit reports. You should make sure to lock baseline builds that contain coverage and test data. See Locking and Archiving Builds for details.
Modified Code Coverage is installed with the Process Intelligence Pack. Refer to the Process Intelligence Pack installation instructions for details.
After installing the pack, the widget will appear in the Coverage category. See Adding Widgets for general instructions on adding widgets to your dashboard.
The following settings are available:
Title | Click in the title field to rename the widget (optional). |
---|---|
Filter | Choose Dashboard Settings to use the dashboard filter or choose a filter from the drop-down menu. |
Period | Choose Dashboard Settings to use the dashboard period or choose a time range from the drop-down menu. |
Baseline Build | Choose a build for comparison. By default, Previous Build is selected. |
Target Build | Choose the build you want to compare the baseline build to. By default, Latest Build with Data is selected. |
By default, Baseline Build is set to Previous Build and Target Build is set to Latest Build. The widget 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 (see Build Administration) and use an appropriate baseline and target build when configuring the widget.
The widget shows the percentage of modified lines of code that have been covered with tests from the baseline build to the target build.
Click on the widget to open a detailed drill-down report that shows the coverage for each file:
Red and green are used to highlight testable code that was changed between the baseline build and the target build. Green indicates that at least one test case covered the code. Red indicates that no test cases covered the code.