Get started - Cover Plugin
Get started with Diffblue Cover Plugin for IntelliJ - in short, install the plugin, apply your license, and you're ready to go. This topic also provides an example and some next steps.
If you've already done this as part of your free trial, you may want to skip this and jump straight to the Cover Plugin details, or perhaps you want to update to the latest version - see Update Cover.
From IntelliJ IDE
From a ZIP Archive
- 1.In the IntelliJ IDE, open the
Plugins
menu - eitherFile > Settings > Plugins
(Windows/Linux) orIntelliJ IDEA > Preferences > Plugins
(macOS). - 2.Select the
Marketplace
tab, search forDiffblue
, and clickInstall
. Your plugin will now be downloaded and installed. - 3.When prompted, click
Restart IDE
to complete the install.

- 1.Download the Diffblue Cover Plugin for IntelliJ as a
.zip
bundle from: - The Diffblue website - Free Community Edition or Free Trial versions. - The JetBrains Marketplace (IntelliJ Plugin Marketplace). - The link sent to you via your Diffblue Cover welcome email. - Your organization's internal file/app store.\ - 2.In the IntelliJ IDE, open the
Plugins
menu - eitherFile > Settings > Plugins
(Windows/Linux) orIntelliJ IDEA > Preferences > Plugins
(macOS). - 3.Click on the cog icon next to the
Installed
tab and selectInstall Plugin from Disk...
. Navigate to the location of the plugin, select the zip file, and clickOK
. - 4.When prompted, click
Restart IDE
to complete the install.

Once IntelliJ has restarted, you'll be prompted for your license key (provided in your welcome email or by your organization) to activate the plugin. Diffblue Cover requires a remote license check with the Diffblue licensing server each time it's used. For help troubleshooting license keys, network connections, and proxy server settings, see Licensing. Note that:
- Applying a license provides access to the Teams and Enterprise Editions of Diffblue Cover. The free Community Edition does not require a license.
- Offline license activation is available with the Diffblue Cover Enterprise Edition only. This can only be done through the CLI.

Four steps to automatically write tests - clone an example project, compile the project and check your environment, learn a few basics, and then one click or one command to write tests.
We're going to make use of an example project (Spring PetClinic) to show the Diffblue Cover Plugin for IntelliJ at work. First, we'll clone the project from the Git repo:
Git CLI
IntelliJ UI
- 1.Open a command line and navigate to where you want to clone this project.
- 2.Run the following commands:
git clone https://github.com/diffblue/demo-spring-petclinic
- 3.Open the PetClinic project in IntelliJ.
From IntelliJ select
File > New... > Project from version control
.- Ensure
Git
is selected inVersion control
. - Enter
https://github.com/diffblue/demo-spring-petclinic
as the URL. - Select the directory/folder to clone the project to.
- When you're ready, click
Clone
.

Before we write any tests, we need to compile the PetClinic project. Diffblue Cover works by analyzing the bytecode of any project used with Cover. You can do this from the Maven plugin in IntelliJ - click the
Maven
tab, open petclinic > Lifecycle
, and double-click package
.
Basic prerequisites:
- Java 8, 11, or 17 compatible source code.
- Maven 3.2.5+ or Gradle 4.9+ build tools.
- The project (for use with Diffblue Cover) must compile and run with no failing unit tests.JUnit and TestNG testing frameworks are supported.
More details:
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 detailed in Specs & Reqs. Cover Plugin will perform an environment check before analysis begins to ensure that the requirements are met - if there are any issues, these will be reported via the Diffblue Cover panel in IntelliJ using E(Environment) Output Codes.
Note that you can run
dcover create --preflight
(using Diffblue Cover CLI) to check the Cover prerequisites for your project, without performing any other actions.We won't cover the whole UI here, but here are a few useful gutter icons to get you started:
Icon | Description |
---|---|
![]() | Indexing - Diffblue Cover is discovering your project structure. |
![]() | Write tests - click this icon to write tests for this method or class. |
![]() | Not testable - this method or class can't be tested. Click the icon to find out why. |
![]() | Private method - this method can't be tested as it's private, although it may be tested indirectly via a public method. If you'd like Cover to write unit tests for this method, you can either make the method public or package protected. |
![]() | Test writing in progress - please wait while Diffblue Cover writes tests for your method or class. |
- 1.Navigate to a class - for example,
OwnerController
. - 2.To create tests for this class, click on the
Write Tests
gutter icon next to the lineclass OwnerController
. - 3.Click the links in the Diffblue Cover panel to see the tests produced - example below.
And that's it, simple - 1 click, 9 methods analyzed, 7 tests written, around 340 lines of code, and all in around 65 seconds - computationally perfect, human readable.
package org.springframework.samples.petclinic.owner;
import ...
@ContextConfiguration(classes = {OwnerController.class})
@ExtendWith(SpringExtension.class)
class OwnerControllerDiffblueTest {
@Autowired
private OwnerController ownerController;
@MockBean
private OwnerRepository ownerRepository;
/**
* Method under test: {@link OwnerController#initCreationForm(Map)}
*/
@Test
void diffbluetestInitCreationForm() throws Exception {
MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/owners/new");
MockMvcBuilders.standaloneSetup(ownerController)
.build()
.perform(requestBuilder)
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().size(1))
.andExpect(MockMvcResultMatchers.model().attributeExists("owner"))
.andExpect(MockMvcResultMatchers.view().name("owners/createOrUpdateOwnerForm"))
.andExpect(MockMvcResultMatchers.forwardedUrl("owners/createOrUpdateOwnerForm"));
}
....
Note that the examples here use
DiffblueTest
as the default class name suffix and diffbluetest
as the default method name prefix, just to highlight the tests created by Diffblue Cover. To change your suffix and prefix in IntelliJ, go to Diffblue > Change Settings > Test Naming > Class Template/Method Template
.
- 1.Diffblue Cover first ensures that your code is compiled. This is required because Cover analyses the bytecode to fully understand your application.
- 2.Then Cover triggers an execution of all possible paths through each method that Cover will create tests for, and any related methods. It uses inputs that are similar to those a developer would choose and determines the most useful assertions to add to the tests (the assertions always reflect the current behavior of the code).
- 3.Finally the best test candidate is committed for each method. The tests are computationally perfect and human readable, every time.
This simple "getting started" example illustrates creating tests for a class using the gutter icons (you can do the same for individual methods too). You can scale this up even further - right-click a Java source file or folder in your project structure and select Write Tests to create tests for all classes/methods contained within the file/folder. Of course that may not always be desirable:
- A large project with potentially a large number of tests can take some time to complete.
- License limits may apply. For example, the Community Edition only allows up to 100 tests per week and 50K lines of code.

Now you're up and running with Cover Plugin:
- Have a scan through the Test examples topic which provides some additional source code examples along with an explanation of the tests created by Diffblue Cover.
- Create some tests for your own project - as long as you have a project that compiles and your environment meets the Cover prerequisites, you're literally a click away from AI written tests, created in seconds instead of hours.
- Select your own preferences/settings for Cover Plugin - go to
Diffblue > Change Settings
.
Diffblue Cover is also provided as a CLI tool to write tests for your entire project, all in one hit (see Get started - Cover CLI), and can also be integrated into your CI pipeline to automatically write tests within your CI workflow (see Get started - Cover Pipeline).
But Cover CLI, Cover Plugin, and Cover Pipeline are not mutually exclusive, in fact they make perfect partners. Use Cover Plugin within the IntelliJ IDE to write and check unit tests for your application during development, and also use Cover CLI directly from the IntelliJ Console or your OS command line to access the wider and deeper functionality provided by Cover CLI - finally, use Cover Pipeline within your CI tool to automate the whole process and provide consistency across your organization.

Last modified 22h ago