Introduction to using Cover Reports
Cover Reports provides a web UI to help visualize your test data, monitor and manage your coverage, and pinpoint unique, actionable insights that improve quality and efficiency. It uses a simple home page to display an aggregated project list, and an intuitive hierarchy so you can focus in on specific areas. Information, statistics, and visualizations are grouped into three main tabs – Overview, Map, and Coverage Detail.
In this topic:
Navigation - an overview of how to navigate Cover Reports.
Dashboards - a summary of the Cover Reports Dashboards - Overview Tab, Map Tab, and Coverage Detail Tab.
Telemetry data - access details and summary information for the telemetry tabs.
Export API - integrate Cover Reports with your own internal systems
Considerations - some recommended considerations as a Cover Reports User.
This set of topics is targeted at Cover Reports Users.
This section provides an overview of how to navigate Cover Reports.
Menu: As you'd expect, your projects are organised and displayed in a standard tree structure and you can navigate through your projects, sub-projects, packages, classes, and methods as needed. The coverage data visible from the dashboards reflects the current selected component.
Home: Simply click the Diffblue logo at any point to return to the root of the navigation tree.
Search: Use the search to find a project, package, or class across all of your projects.
Recent Projects: Use the recent projects list for quick navigation to your recently viewed projects.
Runs: When viewing a project or project group, the latest run of each of the modules will be aggregated to show the current state across your codebase.
The Latest Run
drop-down is only available when navigating down to an individual module level.
Use the Latest Run
drop-down to select which data to view.
Click the Delete icon for a run to delete the individual run and associated data.
Dashboard summary. Cover Reports Home Page, Overview Tab, Map Tab, and Coverage Detail Tab
The Cover Reports UI is pretty straightforward. The following tabs detail the data and visualizations available through each of the dashboards/tabs.
Overview Tab - an overview/summary of coverage data for your project/project component. The data on this tab reflects the current location within the navigation structure.
Here's a quick breakdown of the visualisations and the terminology used for the data.
Project Overview
Coverage - provides coverage data for the current navigation location.
Coverage breakdown bar - shows the breakdown of coverage provided by Diffblue Cover and manually written tests and highlights the amount of overlapping coverage.
Total coverage - indicates total coverage, combining both Diffblue Cover and manual test coverage.
Coverable lines - the number of lines of code that could be covered by unit tests.
Covered lines - the number of coverable lines of code that are covered by unit tests.
Uncovered lines - the number of coverable lines of code that are not covered by unit tests.
Line of Code Usage Quota - the total number of coverable lines of code that contribute to your usage quota, calculated for the current accounting period (last 12 months by default). Please see your contract to understand your allowance and usage periods. Usage Quota Calculation:
If at least one Diffblue Cover test exists within a module during any run, the number of coverable lines of code for that module will count towards the usage quota. For each module, the run with the highest number of coverable lines is used regardless of whether that run itself has new Diffblue tests.
Number of Tests - provides test counts for the current navigation location.
Diffblue - the number of Diffblue tests.
Manual - the number of manual tests.
Total lines of code - the number of lines of Java source files that contain at least one character not including whitespace, tab, or comment.
Coverage Sources & Coverage Over Time - a more detailed breakdown.
By Diffblue tests only - Lines / percentage covered exclusively by Diffblue Cover Tests only.
By manual tests only - Lines / percentage covered exclusively by Manual Tests only (existing developer written tests).
By Diffblue and manual tests - Lines / percentage covered by Diffblue Cover Tests and Manual Tests (existing developer written tests) - i.e. this is the overlap from both types of test.
Trivial, Untestable, Not tested - Lines / percentage that Diffblue Cover was unable to write tests for. In many cases when Diffblue Cover is unable to write tests, this is due to issues such as private methods, empty methods, trivial setters and getters, etc.
Excluded - Lines / percentage which do not have coverage and were excluded by the user from Diffblue Cover test creation.
Unknown - Lines / percentage where the testability could not be determined by Diffblue Cover.
Project Comparison Table - Use the projects comparison table (at the bottom of the page), to view the projects within Cover Reports underneath the current navigation location. At the home location, you will see all projects within cover reports in this list. Use this table to compare coverage levels across different projects, click the row to navigate to that location.
Name - The name of the project provided / detected during upload.
Location - The location of the project within the navigation tree.
Map Tab - a coverage heat map for your project/project component.
Click an item to drill down further through your project structure.
Use the toggles to change coloring and sizing option.
Coverage Detail Tab - a detailed coverage breakdown. Here's a quick breakdown of the panels and the terminology used for the data. This view is only available when nagivating to an individual module level (or lower).
Total Advisories - total number of advisories (see note below) generated by this run of Diffblue Cover.
Total Uncovered lines - the number of lines of code that are not covered by unit tests.
Stats list table - a full breakdown for each project component:
Coverable lines - the number of lines of code that could be covered by unit tests.
Uncovered lines - the number of lines of code that are not covered by unit tests.
Diffblue Coverage - percentage coverage provided by all Diffblue Cover Tests.
Total Coverage - total coverage (percentage) provided by Diffblue Cover Tests and/or Manual Tests (existing developer written tests).
Manual Coverage - percentage coverage provided by all Manual Tests (existing developer written tests).
Diffblue Test Count - total number of Diffblue Cover Tests.
Advisories - output code details (see note below).
Note - Advisories - Diffblue Cover performs a number of checks before, during, and after creating unit tests. Cover can generate a range of advisory output codes during these checks to provide general information and highlight any potential issues. See Output Codes for more details.
Cover CLI and Cover Plugin both capture usage data to help improve Cover services and features. This data can also be sent to your Cover Reports instance, allowing you to monitor Diffblue Cover usage across your organization. To enable telemetry for Cover Reports, see the Cover Reports - Configuration Options topic or see your Cover Reports Administrator for help.
To access the dashboards, navigate to your Cover Reports telemetry home page, for example http://cover-reports.mycompany.com:8080
/ui/telemetry
. From here you can select either the CLI tab for Cover CLI events, or the Plugin tab for Cover Plugin events.
Using the telemetry view you can search and view the data in ways that suit you. You can set the search window by the previous week, month, quarter, year or a custom timeframe (start and endpoint can be defined). You can also define the breakdown of the data as daily, weekly, monthly, quarterly and yearly.
The number of active users is tracked based on the defined criteria for a unique Diffblue user. A unique user is an individual with telemetry enabled who interacts with Diffblue Cover by using the Cover CLI, opening the Cover plugin, or writing tests with the Cover plugin. This tracking relies on each user's telemetry configuration.
Please see below for some example views.
Total unique users of Diffblue Cover per day:
Total number of write test operations by Diffblue Cover per day:
Total tests produced by Diffblue Cover per day:
An API is available to allow exporting information from Cover Reports. This is a read only REST API that returns information in a JSON format. This API is provided to allow external systems to integrate with Cover Reports, for example, to download coverage statistics and incorporate them with other information within your organisation.
The available endpoints are specified in live documentation deployed within Cover Reports itself. To view this, navigate to/swagger-ui/index.html
in Cover Reports, for example http://cover-reports.mycompany.com:8080
/swagger-ui/index.html
This page reflects the capabilities of the installed Cover Reports.
Additionally, it is possible to send requests to the API using this page. This can be useful when exploring the API to understand how it works.
By default, any Diffblue Cover user can access the Cover Reports export API. However, you may want to restrict and/or secure access using API authentication. For example, you may want to restrict access to specific systems only. For more information see Configuration options.
Each release of Cover Reports may change the API. When changes are made that may break existing installations that have come to rely on the API, a new version will be set in the API URL. Existing systems will continue to work using the previous URLs, while new integrations can benefit from the improved API.
At this point, the previous API will be deprecated in favour of the new one. This will provide a short transition period to allow installations to adjust to use the new API.
How you make use of Cover Reports will clearly depend on many factors. As a Cover Reports User, consider the following when deploying and using Cover Reports. You may also wish to discuss these with your Cover Reports Administrator (deployment) and Cover Reports Contributors (reports bundles), as appropriate.
When deploying Cover Reports, consider the following features:
Authentication: By default, any Diffblue Cover user can upload reports bundles to Cover Reports. However, you may want to restrict and/or secure access by enabling upload authentication. For example, you may want to restrict upload to your CI processes only, so that the data and upload timings are consistent. If upload authentication is enabled, all uploads will need to use the defined username and password when uploading reports bundles.
Telemetry: Cover CLI and Cover Plugin both capture anonymous usage data to help improve Cover services and features. This data can also be sent to your Cover Reports instance by enabling and configuring the Cover Reports endpoint for telemetry data, allowing you to monitor Diffblue Cover usage across your organization. Telemetry configuration can be managed centrally as detailed in Configuration options.
When generating, naming, and uploading reports bundles, consider the following:
Generate & Upload - Timing: You can generate and upload reports bundles before, during, and after code development. For consistency, you may wish to define specific schedules and you may also find it useful to generate and upload reports for your project before you run dcover create
on the project for the first time (useful for setting a coverage baseline).
Naming Conventions: The --name
, --project-name
and --location
arguments are used to structure the uploaded data within Cover Reports. Diffblue recommends that you select an appropriate and consistent naming convention to help with data visualization in the Cover Reports UI. Alternatively, don't use these options and allow the data to be auto-generated.
Cover CLI and/or Cover Pipeline: Reports bundles can be uploaded using Cover CLI (as part of a developer's process) and/or Cover Pipeline (as part of a CI workflow/pipeline). As an organization you may want to consider whether you use one method for upload, or both. If you're not sure or have concerns, you could use different naming conventions for the uploads to separate the data within the Cover Reports UI.
Deleting Projects and Runs: You can delete a project and associated data from the Cover Reports Home page, and delete individual runs and associated data from the Runs drop-down menu. You should consider your delete actions carefully as data can't be recovered, once deleted.