Prerequisites
- Diffblue Agents installed with an active license
- A supported AI coding agent platform installed and authenticated
Project requirements
Your project must meet the following requirements before running the workflow.- Java
- Python
| Requirement | Details |
|---|---|
| Build system | Maven or Gradle |
| Java version | 8+ |
| Testing framework | JUnit (4, 5, or 6) |
| Build state | Project compiles and existing tests pass |
| Version control | Git repository with a clean working tree |
You can use your AI coding agent platform to help fix failing tests before running the workflow.
Run the workflow
Diffblue Agents automatically detects the project language, build system, and test framework.- Open a terminal at the root of your project.
- Trust the project directory if you have not already done so.
-
Create a branch for the generated tests:
Creating a dedicated branch keeps your main branch clean and lets you review the tests before merging.
-
Start the workflow:
-
Diffblue Agents displays a resource estimate including expected duration and estimated AI coding agent token consumption, then prompts you to confirm:
Press
Yto proceed ornto abort. Token estimates are indicative — actual costs depend on your subscription with the AI coding agent platform.
Preview the workflow
To validate your project setup and preview the scope of work before running the full test generation workflow, use the planning workflow.regression-unit-tests-planning workflow:
- Verifies your project configuration
- Measures baseline coverage
- Partitions the work
- Provides a resource estimate (expected duration and estimated AI coding agent platform token consumption)
Filter by module
For multi-module projects, you can limit test generation to specific modules using the--module flag:
Skip the approval prompt
To run the workflow without the interactive approval prompt, pass--auto-approve:
--auto-approve explicitly to suppress the informational message.
What the regression-unit-tests workflow does
Theregression-unit-tests workflow runs through the following stages:
-
Plan — prepares the project (see prepare project workflow for details), measures baseline coverage, and determines what needs testing. This is the same phase that runs when you use
regression-unit-tests-planningabove. -
Approve — displays a resource estimate and prompts you to confirm before proceeding. Press
Yto continue ornto abort. If you pass--auto-approve, the workflow skips this step. -
Generate tests — for each partition, Diffblue Agents:
- Plans test generation for the target code
- Delegates test writing to your AI coding agent platform
- Compiles and runs the generated tests
- Validates that tests pass and improve coverage
- Commits passing tests
- Rolls back tests that fail validation
- Cherry-pick and report — cherry-picks committed tests to your branch and displays a summary.
Understand the results
When the workflow completes, the summary includes:| Field | Description |
|---|---|
| Tests generated | Total number of tests written by the agent platform |
| Files processed | Number of source files that were targeted for test generation |
| Line coverage before | Baseline line coverage before the workflow ran |
| Line coverage after | Line coverage after committed tests are included |
| Runtime | Total workflow execution time. If you used the approval prompt, this includes a breakdown of execution time and approval wait time |
Troubleshooting
- If the workflow fails during validation, verify that your project builds and tests pass before re-running. See the project requirements for language-specific commands.
- If cherry-pick conflicts are reported, you made changes to the same files while the workflow was running. Resolve conflicts with standard git conflict resolution.
- See the troubleshooting page for more common issues.