In this chapter:

Introduction

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:

  1. analyzes the coverage data associated with file modifications
  2. determines the lines of code in those files that were changed  
  3. reports which of the not-yet covered new/modified lines of code can be covered

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.

Requirements

  • Parasoft DTP and Extension Designer 5.4.3 
  • At least one filter in DTP must be configured to receive Run Configurations from coverage analysis runs.
  • Test and coverage data from the following Parasoft tools are supported:
    • C/C++test Standard, dotTEST, and Jtest 10.4.3 or later.
    • C/C++test Professional 10.4.3 or later.
    • SOAtest 9.10.7 or later.
  • Reports published to DTP must have consistent information. Instead of presenting code coverage data, the drill-down report may show N/A if one or more of the reports for the builds lacks proper resource information. Verify that the source-related settings for code analysis tool sending reports to DTP have been properly configured. Refer to the tool’s documentation for additional information.
  • 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

    Information about sources must be consistent

    If DTP reads sources from Parasoft code analysis and testing tool reports, make sure that source information is always included by setting the report.dtp.publish.src property to min or full in either the tool's .properties configuration file (see the tool's documentation) or in the shared project settings in DTP (see Configuring Parasoft Test Settings for Projects). If DTP reads sources from source control, ensure that the scontrol and report.scontrol properties are properly configured. Gaps, incomplete, or inconsistent source information will prevent the Modified Coverage extension from properly displaying the data.

Locking Builds

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.  

Installation

Modified Code Coverage is installed with the Process Intelligence Pack. Refer to the Process Intelligence Pack installation instructions for details.

Usage

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:

TitleClick in the title field to rename the widget (optional).
FilterChoose Dashboard Settings to use the dashboard filter or choose a filter from the drop-down menu.
PeriodChoose Dashboard Settings to use the dashboard period or choose a time range from the drop-down menu.
Baseline BuildChoose a build for comparison. By default, Previous Build is selected.
Target BuildChoose 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.

  • No labels