Prerequisites for using Diffblue Cover
Diffblue Cover requires that the system environment (hardware, operating system, network connectivity, Java installation) as well as the project environment (build tooling, dependencies, presence of artifacts, existing unit tests) meet the minimum requirements as outlined below. Diffblue Cover will perform an environment check before analysis begins to ensure that the requirements are met.
In Diffblue Cover CLI the --preflight
option can be used to check the status of the
prerequisites without performing the project analysis. This option can be run prior without a license key.
Prerequisites
- 16 GB RAM, 5 GB minimum available disk space, 4 CPU cores
- 8GB Java heap allocated
- Windows 10 Enterprise, Ubuntu 18.04, RHEL 7.7, macOS 10.15
- The latest or n-1 64-bit sub-version of Java 8 (8u361 & 8u351), Java 11 (11.0.18 & 11.0.17) or Java 17 (17.0.6 & 11.0.5)
- For Maven projects: Maven version 3.2.5+
- For Gradle projects: Gradle version 4.9+ (must be compatible with your version of Java).
- For Ant projects: access to the complete Ant classpath
- JUnit 4.7 - 4.13 or JUnit 5.0 - 5.9.2
- For Java 8 projects: Mockito 1.9.5 - 4.11.0
- For Java 11 projects: Mockito 2.22.0 - 4.11.0
- For Java 17 projects: Mockito 4.1.0 - 4.11.0
- All necessary tooling to build the project
- The project must compile and run with no failing unit tests
- Access to a dependency repository to download transient dependencies
- Access to the Diffblue licensing server for remote license check
Diffblue Cover IntelliJ Plugin prerequisites
- IntelliJ Community or Ultimate version 2022.2+
- One instance of the Diffblue Cover IntelliJ Plugin per project
- A minimum of 4GB memory allocated to IntelliJ
Cover Reports specific prerequisites
- JaCoCo 0.8.3+
- Docker engine 20.10.17
- Docker compose v2.10.2
- Network connectivity between Diffblue Cover CLI, Diffblue Cover Reports and user’s browser on configured port (default 8080)
- The latest version of either Chrome, Safari, Edge, Firefox with a screen resolution of 1920 x 1080 or higher
Spring specific prerequisites
- For Java 8 projects: Spring Boot 1.3.3+, Spring 4.1.1+
- For Java 11 projects: Spring Boot 2.1.0+, Spring 5.1.0+
- For Java 17 projects: Spring Boot 2.4.0+, Spring 5.3.1+
Dependencies
Dependencies required for running tests should be in the project configuration. Additional libraries may also be necessary depending on the project under test.
Dependency | When | Version |
---|---|---|
Surefire Plugin (org.apache.maven.plugins:maven-surefire-plugin )
|
When using Maven and junit-jupiter-engine | 3.0.0-M7 |
JUnit (junit:junit or org.junit.jupiter:junit-jupiter-engine )
|
Unless using Spring or Spring Boot | 4.7+ |
JUnit Launcher (
org.junit.platform:junit-platform-launcher )
|
When using junit-jupiter-engine, unless using Maven, Spring or Spring Boot | 1+ |
Spring Boot Test (
org.springframework:spring-boot-test )
|
When using Spring Boot (
org.springframework:spring-boot )
|
2+, matching version |
Spring Test (org.springframework:spring-test )
|
When using Spring (
org.springframework:spring-core ) unless using Spring Boot
|
4.1.1+, matching version |
Mockito (org.mockito:mockito-core )
|
4.1.0+ for Java 17 2.22.0+ for Java 11 1.9.5+ for Java 8 |
Other dependencies listed below may be needed, if they are transitive dependencies of your project. If one of these dependencies is required but missing, tests will be generated for some classes but not others. A message will appear in the console output indicating a missing dependency.
Dependency | Version |
---|---|
Java Servlet API (
javax.servlet:javax.servlet-api )
|
4+, matching version |
JSR107 API and SPI (javax.cache:cache-api )
|
0.2+, matching version |
Spring Boot Starter Test (
org.springframework.boot:spring-boot-starter-test )
|
2+, matching version |
Spring Security Config (
org.springframework.security:spring-security-config )
|
4.2.1+, matching version |
Spring Web MVC (
org.springframework:spring-webmvc )
|
5+, matching version |
Spring projects and Hamcrest
Either:
- Use the
spring-boot-starter-test
dependency to add Hamcrest - Add
org.hamcrest:hamcrest
. The version of Hamcrest needs to match the relevant version ofspring-boot-test
. For example, if the user hasspring-boot-test:2.4.6
, they should look at the dependency list: Maven Repository: org.springframework.boot spring-boot-starter-test 2.4.6. This shows that the matching version is Hamcrest 2.2 (you may have to scroll).