Prerequisites
- Diffblue Agents installed (no license required)
- A supported AI coding agent platform installed and authenticated
Project requirements
- Java
- Python (Experimental)
| Requirement | Details |
|---|---|
| Build system | Maven 3.8.6+ or Gradle 8.4+ |
| Java version | 8+ |
| Testing framework | JUnit (4, 5, or 6) |
| Mutation testing | Automatically configured (PIT); the appropriate PIT version and JUnit plugin are selected based on your project’s Java version |
| Build state | Project compiles and existing tests pass |
| Version control | Git repository with a clean working tree |
Run the workflow
- Detects your build system, language, and modules
- Configures coverage and mutation testing tools if not already present
- Runs coverage and mutation analysis
- Displays a per-module quality report
Filter by module
Limit the assessment to specific modules with--module:
Filter by package or class
Scope the assessment to a specific package or class with--filter:
Understanding the report
The report shows four metrics for each module and class:| Metric | Meaning |
|---|---|
| Line coverage | Percentage of code lines executed by tests |
| Branch coverage | Percentage of code branches (if/else, switch) executed by tests |
| Mutation score | Percentage of code mutations detected by tests (killed mutants / total mutants) |
| Test strength | Percentage 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 in the virtual environment