SupercovCompare
← All comparisons

Java · Comparison

Java coverage: JaCoCo, OpenClover, and Supercov

Compare JaCoCo, OpenClover and Supercov for Java: bytecode counters, per-test coverage, MC/DC and assertion coverage, with Maven and Gradle commands.

JaCoCo vs OpenClover vs Supercov

Start with JaCoCo if you want the standard Java coverage report: it has Maven and Gradle integrations and most CI tools read its XML. OpenClover is the option when you also want to know which tests covered which code. Supercov measures per test as well, and adds MC/DC and assertion coverage.

Coverage features
FeatureJaCoCo0.8.15OpenClover5.1.0Supercov2.0.0
Code quality scoringNot built inNot built inSupported
Security reviewNot built inNot built inSupported
Line coverageSupportedSupportedSupported
Branch coverageSupportedSupportedSupported
MC/DCNot built inNot built inSupported
Per-test coverageNot built inSupportedSupported
Assertion coverageNot built inNot built inSupported
ReportsSupportedSupportedSupported

✓ Supported · × Not built in. Standard coverage workflows in the versions shown; custom plugins are outside this table.

Supercov requires JDK 17 or newer with Maven or Gradle, and measures JUnit 5, JUnit 4 through Vintage, TestNG, Kotest and Spock per test, instrumenting an isolated copy rather than your build file. If tests still run concurrently it says so and drops condition coverage instead of guessing.

JaCoCo counts branches from bytecode and reports per run, not per test. OpenClover records per-test coverage from source instrumentation; neither computes MC/DC.

Per-test coverage means individual tests, not just test files. Supercov needs a supported runner. Assertion coverage links source to checked properties through agent review; it is not a mutation score or a correctness guarantee. Security review comes from Supercov’s Jev checks; reports means a browsable HTML report from the tool itself.

JaCoCo: bytecode counters for the whole run

JaCoCo instruments bytecode through a Java agent and reports several counters: instructions, branches, lines, methods, classes and cyclomatic complexity. Branches are counted for every if and switch in the bytecode, so each operand of a short-circuit && shows up as its own branch. Exception handling is not counted as a branch.

With the Gradle jacoco plugin applied:

./gradlew test jacocoTestReport

Maven projects bind the jacoco-maven-plugin goals prepare-agent and report in the build; see its agent documentation. The result describes the run as a whole, not each test.

OpenClover: per-test coverage from the source

OpenClover instruments source rather than bytecode. Its distinctive feature is per-test coverage, which it uses to select the tests a change affects. Like JaCoCo it measures lines and branches; neither tool computes MC/DC.

What Supercov adds

With JDK 17 or newer, install Supercov and run your usual build:

brew install supercorp-ai/tap/supercov
supercov -- mvn test
supercov -- ./gradlew test
supercov runs latest gaps

It measures JUnit 5, JUnit 4 through Vintage, TestNG, Kotest and Spock per test, and instruments an isolated copy rather than editing your build file.

Branch coverage asks whether each outcome happened. MC/DC asks a stricter question: whether each condition was shown to change the decision on its own, with the other conditions held fixed. In a compound decision a suite can reach every branch without that evidence; MC/DC explains the pairs it looks for. Assertion coverage then shows which statements a passing test actually checks.

If tests still run concurrently, Supercov says so and drops condition coverage for them rather than guessing which test ran what. The Java guide has the setup and a runnable example.

Keep JaCoCo when its report answers your question, and add OpenClover if you need per-test selection. Choose Supercov when you, or your coding agent, need the missing conditions and checks named. None of these scores proves the program correct.

Feature sources