Diffblue Cover Reports

Introduction

Diffblue Cover Reports provides insights about your code to help your team identify gaps in your application’s coverage to target development work through data visualization using Diffblue Cover CLI and Jacoco.

These data visualizations help make sure you have coverage where it is most important, instead of relying only on a single percentage for your entire application. In the screenshot below, although the application has a high level of coverage, some classes only have between 0-40% and 40-70% coverage. If these classes are critical for your application it may mean your application remains at high risk despite high coverage.

These reports are free for all customers using the Diffblue Cover CLI. Please contact your account manager to get access to the beta. Or if you are not yet using Diffblue Cover CLI, you can start a free trial.

Prerequisites

  • Java version 8 or later

Supported Browsers

We support the most recent versions of:

  • Chrome
  • Safari
  • Edge
  • Firefox

Getting Started

To start using Diffblue Cover Reports, you need to:

  • Upload an existing jacoco.xml report (or generate and then upload a new jacoco.xml report)

AND

  • Upload an existing dcover.json report (or generate and then upload a new dcover.json report).

To generate a new jacoco.xml report:

To use Diffblue Cover Reports, you must have a jacoco.xml report. Please see these separate instructions for generating a standard JaCoCo report.

You can also filter the results shown in the JaCoCo report. You must keep the default DCover test name settings for this to be effective.

  • To generate a JaCoCo report which filters out the tests generated by DCover:
    1. Add the Surefire plugin to your pom.xml file
    2. Use the command: mvn clean test -Dtest=!*DiffblueTest

    Please note that in certain environments, you may need to use the following alternative instead: mvn clean test -Dtest='!*DiffblueTest'

  • To generate a JaCoCo report which filters out all tests apart from those generated by DCover, use the command: mvn clean test -Dtest=*DiffblueTest

To generate a new dcover.json report:

To use Diffblue Cover Reports, you must also have a dcover.json report. Please see these separate instructions for generating a dcover.json report.

The dcover.json report contains information about the tests generated for each class and method, along with details of the output codes.

Uploading your reports:

1. Click on the Upload Reports button. You can either upload:

  • A dcover.json report and a jacoco.xml report (excluding Diffblue tests)
  • A dcover.json report, a jacoco.xml report (excluding Diffblue tests) and a jacoco.xml report (excluding manual tests)

2. Fill in the following fields:

  • Coverage report name - this is the name you use to refer to your work in Diffblue Cover Reports.
  • Diffblue Cover Report - this is the location of the JSON report you want to upload.
  • JaCoCo Report, excluding Diffblue tests - this is the location of the JaCoCo XML report which excludes any tests written by DCover.
  • JaCoCo Report, excluding manual tests - this is the location of the JaCoCo XML report which excludes all manual tests and keeps those written by DCover.

3. Then, click Upload reports.

4. Once you have uploaded your first report, you can see all reports listed by clicking on this icon on the left menu:

Test Coverage Breakdown

Once you have uploaded a report, click on the Dashboard icon to see the Test Coverage Breakdown. An example is shown below:

Coverage

Click on to see more detailed information on coverage. An example is shown below. The innermost circle represents the module, the middle circle represents the classes, and the outer circle represents the methods.

You can hover over any slice of the sunburst to see the coverage percentage.

Insights

Use the icon to see the insights into your report, for example: