Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.diffblue.com/llms.txt

Use this file to discover all available pages before exploring further.

Run this workflow to measure test coverage, mutation score, and test strength across your project. The report breaks down metrics per module and per class.

Prerequisites

Project requirements

RequirementDetails
Build systemMaven 3.8.6+ or Gradle 8.4+
Java version8+
Testing frameworkJUnit (4, 5, or 6)
Mutation testingAutomatically configured (PIT); the appropriate PIT version and JUnit plugin are selected based on your project’s Java version
Build stateProject compiles and existing tests pass
Version controlGit repository with a clean working tree

Run the workflow

diffblue-agents run test-quality-report
The workflow:
  1. Detects your build system, language, and modules
  2. Configures coverage and mutation testing tools if not already present
  3. Runs coverage and mutation analysis
  4. Displays a per-module quality report

Filter by module

Limit the assessment to specific modules with --module:
diffblue-agents run test-quality-report --module apps/server

Filter by package or class

Scope the assessment to a specific package or class with --filter:
diffblue-agents run test-quality-report --filter com.example.payments

Understanding the report

The report shows four metrics for each module and class:
MetricMeaning
Line coveragePercentage of code lines executed by tests
Branch coveragePercentage of code branches (if/else, switch) executed by tests
Mutation scorePercentage of code mutations detected by tests (killed mutants / total mutants)
Test strengthPercentage of covered mutations detected by tests (killed mutants / covered mutants)

What the metrics tell you

  • High line coverage, low mutation score: Your tests run the code but don’t verify its behavior. Assertions may be missing or too weak.
  • Low line coverage, high test strength: The code that is covered is tested effectively, but not enough code is actually covered.
  • Low line coverage: Parts of your code aren’t reached by any test.

Tool configuration

The workflow automatically configures mutation testing tools if they are not already present:
  • Java: Adds the PIT (Pitest) Maven or Gradle plugin
  • Python: Installs mutmut 3 in the virtual environment
Tool configuration changes are committed to your repository only after a successful run. On subsequent runs, the tools are already configured and the workflow skips this step.

Next steps

Address gaps identified in the report by running the Diffblue Testing Agent:
diffblue-agents run regression-unit-tests