Features IDEA Plugin

Instrument your code and view coverage statistics from within IntelliJ IDEA.

Seamless integration

Clover integrates seamlessly with IntelliJ IDEA, bringing code coverage analysis to your Java IDE. Together, Clover and IDEA provide an interactive development desktop that allows you to record and browse source-level coverage without leaving the IDE.

Clover-IDEA integration

The 'Clover Tool Window'

Every time you run your application or a unit test, Clover records the code coverage information and puts it at your fingertips. By browsing the Clover Tool Window, you can view your entire project with detailed in-line coverage information:

Clover Coverage Explorer

In-line annotations

By toggling the Show Coverage button on the IDEA toolbar, you can enable in-line annotations on your code showing which lines are covered. As you make changes, the highlights change color until you run or test your application again.

Clover inline annotations

The 'Test Runs Explorer'

The Test Runs Explorer is invaluable for identifying which test cover what code. Tests can be shown in a variety of ways (list, by package, by folder) and highlighting a test will show you which classes and methods it covered, including both the percentage of statements covered as well as unique coverage for that particular test only.

Clover 'Test runs explorer'

Test Optimization

Running your entire test suite locally in your IDE is effective, but for small code changes it can take way too long. Typically, this leads developers to run ad hoc testing or, even worse, no testing at all.

With Test Optimization, Clover will automatically perform selective testing so you don't have to wait for the entire test suite to run or risk omitting a critical test. Since shorter test runs provide faster feedback, you are likely to end up testing your changes more with Test Optimization.

Coverage reports

There are several ways to view your coverage within IDEA. The Cloud Reports are a great way to determine the classes that form major risks (low coverage but high complexity) to your project and its packages. They can also highlight potential quick wins for increasing the overall project or per-package coverage.

Clover Coverage cloud report

The TreeMap Report allows simultaneous comparison of classes and packages by complexity and by code coverage. The treemap is divided by package and then further divided by class (labelled below). Similar to the Cloud Report, the size of the package or class indicates its complexity while its colour indicates its level of coverage. Clicking on the treemap allows you to easily navigate between the project, package, and class levels as well as drill directly into the source file.

Clover treemap report

Tell me more

Please see the Clover IDEA Plugin documentation.