Skip to main content

Prerequisites

Activate your license

Run the activation command with your license key:
diffblue-agents license activate <your-license-key>
Verify the license is active:
diffblue-agents license
You should see your license status, edition, and expiry date.

Prepare your project

In your terminal, navigate to your project directory. Before running Diffblue Agents, verify that your project builds and any existing tests pass. See the project requirements for language-specific details.

Trust the project directory

Your AI coding agent must trust the project directory before Diffblue Agents can use it. Open your agent in the project root and approve the trust prompt. If available, select the option to remember this setting for future sessions. You only need to do this once per project.
claude
Select the Yes, I trust this folder option.

Create a branch

Ensure your working tree is clean before creating a branch — commit or stash any uncommitted changes:
git status
Create a branch for the generated tests:
git checkout -b diffblue-agents-tests
Diffblue Agents generates tests in temporary worktrees and cherry-picks passing tests to the current branch. Creating a dedicated branch keeps your main branch clean and lets you review the tests before merging.

Run the regression unit test generation workflow

From the root of your project, start the workflow:
diffblue-agents run regression-unit-tests
Diffblue Agents starts its server, analyzes your project, and runs through the following stages:
  • Detects project configuration and validates the build environment (see prepare project workflow for details)
  • Measures baseline code coverage
  • Determines what needs testing and partitions the work
  • Displays a resource estimate and prompts you to confirm (Y to proceed, n to abort)
  • Generates, compiles, and validates tests for each partition
  • Commits passing tests and rolls back failing tests
  • Reports final coverage and a summary

Review the results

When the workflow completes, it displays a summary:
Runtime: 8m 5s (execution: 7m 42s, approval wait: 0m 23s) | Files Processed: 22 | Callable Functions: 87
Tests Generated: 136 (136 committed, 0 rolled back)

Module        Language  Line Coverage     Lines Covered     Branch Coverage
Total         -         94.5% (+94.5%)    1842/1949 (+1842) 96.3% (+96.3%)
Generated tests are committed to your current branch. Review the commits with git log to see what was added.

Next steps