Knowledge Base > Cover CLI > Generating JSON reports
Generating JSON reports
To generate a report using the Diffblue Cover CLI, your project must first be compiled. To do this, use a command such as:
mvn clean install -DskipTests
The report.json
file is automatically created in the ./diffblue/reports
directory. If you want to create the report in a different directory, please use the command:
--report-file=path/to/report.json
For example:
dcover create --report-file=report.json
The JSON report output is in the following format:
Name | Type | Description |
---|---|---|
meta | object | Meta information about this report |
> reportVersion | string | JSON report version, currently 2.0 |
run | object | Information about this Diffblue Cover run |
> version | string | Version of Diffblue Cover used in this run |
> command | string | Command run, e.g. dcover create mypkg.MyClass --verbose |
> creationTimestamp | string | Timestamp of this report in ISO 8601 format, e.g. 2021-09-15T12:37:28+01:00 |
> environmentDetectionTime | double | Time taken to detect the environment in seconds, e.g. 30.5 |
> indexingTime | double | Time taken to create or update the index in seconds, e.g. 30.5 |
> entryPointsTime | double | Time taken to compute the entry points in seconds, e.g. 30.5 |
> generationTime | double | Time taken to create tests in seconds, e.g. 120.3 |
> verificationTime | double | Time taken to verify the created tests in seconds, e.g. 120.3 |
> validationTime | double | Time taken to validate the created tests in seconds, e.g. 100.9 |
> totalTime | double | Total analysis time in seconds, e.g. 251.7 |
summary | object | Overall summary of results |
> perMethodTestability | object | Testability classifications of the methods in this run. The sum of the entries’ values equals methodsCount . The property is not present when empty. |
> > testabilityCode | integer | Number of methods with testabilityCode, e.g. "T003": 2 |
> perMethodOutcome | string | Representative reasons for (not) creating at least one complete test for each method in this run. The sum of entries equals methodsCount . The property is not present when empty. |
> > outputCode | integer | Number of methods with outputCode, e.g. "R000": 2 |
> perTestOutcome | object | Reasons for (not) creating tests. The sum of entries equals completeTestCount + incompleteTestCount . The property is not present when empty. |
> > outputCode | integer | Number of tests with the outputCode, e.g. "R013": 2 |
> completeTestCount | integer | Number of complete tests (equal to the number of the perTestOutcome entry R000 ). “Complete” also means “successfully verified” if verification is enabled. |
> incompleteTestCount | integer | Number of incomplete tests (equal to the sum of the numbers of the perTestOutcome entries other than R000 ) |
> warnings | object | Warnings encountered while creating tests for this run. The property is not present when empty. |
> > outputCode | integer | Number of warnings raised for the outputCode, e.g. "R020": 2 |
> classCount | integer | Number of classes in this run |
> methodsCount | integer | Number of methods in this run |
> validation | object | Reasons for (not) validating tests. The sum of the entries equals completeTestCount . The property is not present when empty. |
> > outputCode | integer | Number of tests with the outputCode, e.g. "V003": 2 |
codes | object | Explanation of the output codes. |
> code | string | Explanation of the code, e.g. "T000": "This method should be tested." |
classes | object | Class-level results |
> className | object | className, e.g. "io.diffblue.MyClass" |
> > perMethodTestability | object | Testability classifications of methods in this class. The sum of entries equals methodsCount . This property is not present when empty. |
> > > testabilityCode | integer | Number of methods with the testabilityCode, e.g. "T003": 2 . |
> > perMethodOutcome | string | Representative reasons for (not) creating at least one complete test for each method in this class. The sum of the entries equals methodsCount . This property is not present when empty. |
> > > outputCode | integer | Number of methods with the outputCode, e.g. "R000": 2 |
> > perTestOutcome | object | Reasons for (not) creating tests for this class. The sum of the entries equals completeTestCount + incompleteTestCount . This property is not present when empty. |
> > > outputCode | integer | Number of tests with the outputCode, e.g. "R013": 2 |
> > completeTestCount | integer | Number of complete tests (equal to the number of the perTestOutcome entry R000 ).“Complete” also means “successfully verified” if verification is enabled. |
> > incompleteTestCount | integer | Number of incomplete tests (equal to the sum of the numbers of the perTestOutcome entries other than R000 ) |
> > warnings | object | Warnings encountered while creating tests for this class. This property is not present when empty. |
> > > outputCode | integer | Number of warnings raised for the outputCode, e.g. "R026": 2 |
> > methodsCount | integer | Number of methods in this class |
methods | object | Method-level results |
> methodName | object | JVM methodName, e.g. "io.diffblue.MyClass.foo:(I)Z" |
> > perMethodTestability | string | Testability classification of this method, e.g. "T001" |
> > perMethodOutcome | string | Representative reason for this method. This is "R000" if there is at least one complete test for this method. |
> > perTestOutcome | object | Reasons for (not) creating tests. The sum of the entries equals completeTestCount + incompleteTestCount .This property is not present when empty. |
> > > outputCode | integer | Number of tests with the outputCode, e.g. "R004": 2 |
> > completeTestCount | integer | Number of complete tests (equal to the number of the perTestOutcome entry R000 ).“Complete” also means “successfully verified” if verification is enabled. |
> > incompleteTestCount | integer | Number of incomplete tests (equal to the sum of the numbers of the perTestOutcome entries other than R000 ) |
> > warnings | object | Warnings encountered while creating tests for this method. This property is not present when empty. |
> > > outputCode | integer | Number of warnings raised for the outputCode |