Skip to content

Delta Coverage

Code coverage for what matters โ€” your changes

Delta Coverage is a tool that computes code coverage of new/modified code based on a git diff. Focus on testing what you've changed, not the entire codebase. Available as a Gradle plugin or a standalone CLI tool.

Get Started View on GitHub


Why Delta Coverage?

โšก Instant Feedback
Get coverage reports for your changes in seconds. No waiting for SonarQube scans or external service delays.
๐Ÿงช Testing Pyramid Support
Separate views for unit tests, integration tests, and E2E tests. Enforce different coverage thresholds per test type.
๐Ÿ†“ Free, No Infrastructure
Runs locally and in CI. No servers to maintain, no licenses to pay, no external dependencies.

Quick Start

1. Apply the plugin

plugins {
    id("io.github.gw-kit.delta-coverage") version "3.6.0"
}

2. Configure diff source

configure<io.github.surpsg.deltacoverage.gradle.DeltaCoverageConfiguration> {
    diffSource.git.compareWith("refs/remotes/origin/main")
}

3. Run coverage

./gradlew test deltaCoverage

1. Apply the plugin

plugins {
    id 'io.github.gw-kit.delta-coverage' version '3.6.0'
}

2. Configure diff source

deltaCoverageReport {
    diffSource.git.compareWith('refs/remotes/origin/main')
}

3. Run coverage

./gradlew test deltaCoverage

1. Download the CLI

curl -L -o delta-coverage-cli.jar \
  https://repo1.maven.org/maven2/io/github/gw-kit/delta-coverage-cli/3.6.0/delta-coverage-cli-3.6.0.jar

2. Generate a diff

git diff origin/main...HEAD > changes.diff

3. Run coverage

java -jar delta-coverage-cli.jar \
  --engine JACOCO \
  --diff-file changes.diff \
  --coverage-binary build/jacoco/test.exec \
  --classes build/classes/java/main \
  --sources src/main/java \
  --html --console

That's it! The plugin auto-discovers your test tasks, generates HTML reports, and enforces coverage on new code.

Full Quick Start Guide


Features

  • Two Coverage Engines โ€” Choose between JaCoCo (standard JVM) or IntelliJ coverage (better for Kotlin)
  • Multiple Report Formats โ€” HTML, XML, Markdown, and Console reports
  • Automatic Test Discovery โ€” Report views are auto-created for all test tasks
  • Flexible Diff Sources โ€” Use file, URL, or git to provide the diff
  • GitHub Actions Integration โ€” Post coverage reports directly to PR comments
  • CLI Tool โ€” Run delta coverage without Gradle plugin

How It Works

Delta Coverage takes your test coverage data and filters it to show only the lines you've changed. This gives you actionable feedback on your work, not noise from legacy code.

Delta Coverage HTML Report


What Users Say

"Delta Coverage made our code reviews faster. We stopped arguing about which code needs tests โ€” the report shows it clearly."

"Onboarding new developers is easier. They can focus on testing their changes without worrying about overall project coverage."


Get Started

Ready to try Delta Coverage? The Quick Start guide will have you running in under 5 minutes.

For a comparison with other tools, see Delta Coverage vs SonarQube.