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

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:
claude
You only need to do this once per project directory.

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
  • Measures baseline code coverage
  • Determines what needs testing and partitions the work
  • 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 | Files Processed: 22 | Callable Functions: 87 | Tests Generated: 136

Metric              Before    After     Increase
Line Coverage       0.0%      94.5%     +94.5%
Branch Coverage     0.0%      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