AI coding agents are becoming part of everyday software development. Instead of only suggesting a line of code, an agent can understand a development task, inspect a repository, modify multiple files, run tests, and prepare the resulting changes for review.
That creates a new testing problem.
When developers write traditional application code, they test the code itself. When developers use an AI coding agent, they also need to test whether the agent consistently produces the expected type of change.
A single successful run does not tell us much. An agent may solve the same task differently on another run. It may also pass the existing test suite while missing an important requirement, changing unrelated files, or introducing a design that does not fit the project.
Repeatable evaluations, commonly called evals, provide a way to test this behavior systematically.
An agent eval defines a realistic development task, establishes what successful completion means, runs the agent against that task, and records the result. The same evaluation can then be run again after changing the agent instructions, tools, skills, or configuration.
This turns AI agent testing into a repeatable engineering process instead of a manual experiment.
What Is a Repeatable Eval?
A repeatable eval is an automated or semi-automated test designed to measure how well an AI agent handles a specific task.
Consider a normal coding task:
Add pagination to the customer API.
Requirements:
- Use a default page size of 25.
- Allow a maximum page size of 100.
- Reject invalid page values.
- Add automated tests.
- Do not change unrelated endpoints.
A developer could manually give this task to an AI agent and inspect the result.
A repeatable eval goes further by defining the expected conditions:
Task:
Implement pagination for GET /api/customers.
Expected results:
- Pagination parameters are supported.
- Default page size is 25.
- Maximum page size is 100.
- Invalid values are rejected.
- Automated tests are added.
- Existing API behavior is preserved.
- Unrelated files are not modified.
The important difference is that the task can be executed repeatedly.
If the agent instructions are changed, the same evaluation can be run again to determine whether the change actually improved the agent.
Why AI Coding Agents Need Evals
Traditional unit tests generally start with known inputs and verify predictable outputs.
AI agents operate differently.
The same instruction can produce different implementation choices. An agent may decide to modify a controller directly in one run and introduce a service abstraction in another. Both implementations may compile, but only one may fit the architecture of the application.
There are several dimensions worth evaluating.
Functional correctness
The agent should actually implement the requested behavior.
For example, if an agent is asked to add pagination, the evaluation should verify that valid requests return the expected page and invalid requests are handled correctly.
Repository changes
The agent should modify the appropriate files without unnecessarily changing unrelated parts of the application.
For example:
Controllers/CustomersController.cs
Services/CustomerService.cs
Tests/CustomerServiceTests.cs
may be reasonable changes for a pagination task.
Unexpected changes to deployment files, unrelated controllers, or configuration files should be investigated.
Test coverage
An agent should not only modify production code when the task requires a behavioral change.
The evaluation can verify that appropriate automated tests were added or updated.
Project conventions
An agent should work with the architecture already present in the repository.
For example, if the application already uses dependency injection and a repository pattern, the agent should generally follow those conventions instead of introducing a completely different approach.
Regression behavior
An evaluation can also protect against mistakes that an agent previously made.
If an agent repeatedly breaks authentication while modifying an API, that scenario can become a permanent evaluation case.
The workflow becomes:
Agent mistake
|
v
Reproduce the problem
|
v
Create an evaluation
|
v
Improve the agent
|
v
Run the same evaluation
|
v
Check the result
This is one of the strongest reasons to maintain an eval suite.
What Should an Agent Eval Contain?
A useful evaluation normally contains several parts.
Component | Purpose |
|---|
Task | Describes the engineering work |
Context | Provides the repository and relevant requirements |
Acceptance criteria | Defines what successful completion means |
Checks | Verifies expected behavior |
Test data or fixture | Provides consistent conditions |
Result | Records the outcome |
For example, a conceptual evaluation definition might look like this:
name: customer-api-pagination
task: |
Add pagination to the customer API.
checks:
- pagination_is_supported
- default_page_size_is_25
- maximum_page_size_is_100
- invalid_values_are_rejected
- automated_tests_are_added
- unrelated_files_are_unchanged
The exact implementation depends on the evaluation tooling being used, but the underlying idea remains the same: define the task and make success measurable.
Creating a Practical Eval
The best evaluations start with real engineering work rather than artificial coding exercises.
A useful task might be:
Add validation to the customer registration endpoint.
Requirements:
- Email is required.
- Email must have a valid format.
- Name cannot be empty.
- Duplicate email addresses must be rejected.
- Existing successful registrations must continue to work.
- Add automated tests for valid and invalid requests.
This gives the agent enough context to perform meaningful work.
The evaluation can then check:
1. Validation exists.
2. Required fields are handled.
3. Duplicate emails are rejected.
4. Existing behavior is preserved.
5. Tests cover valid input.
6. Tests cover invalid input.
7. The application builds successfully.
The more measurable the requirements are, the more useful the evaluation becomes.
Running Evals After Agent Changes
The biggest value of repeatable evaluations comes from comparing results over time.
Imagine that a development team updates its custom agent instructions.
Before the change:
Evaluation result: 5 of 7 checks passed
After the change:
Evaluation result: 7 of 7 checks passed
That provides stronger evidence that the change helped.
The same approach can be used when changing:
- Agent instructions
- Custom agent definitions
- Repository guidance
- MCP tools
- Development workflows
- Prompt templates
- Validation rules
The evaluation should remain the same while the agent configuration changes.
This gives teams a controlled way to measure the effect of those changes.
Evals and Unit Tests Are Not the Same
Agent evaluations should complement normal software tests rather than replace them.
Area | Unit Tests | Agent Evals |
|---|
Main target | Application code | AI agent behavior |
Input | Test data | Engineering task |
Expected result | Runtime behavior | Repository and task outcome |
Primary purpose | Prevent code regressions | Prevent agent regressions |
Test execution | Usually deterministic | May involve variable agent behavior |
Prompt changes | Not relevant | Can be evaluated |
Repository instructions | Not normally tested | Can directly affect results |
Code quality | Usually limited | Can include project-specific checks |
For example, a unit test can prove that a pagination method returns 25 records.
An agent eval can check whether the agent correctly implemented pagination, added the required tests, followed the existing architecture, and avoided unnecessary changes.
Both provide different forms of protection.
Best Practices for Repeatable Agent Evals
Start with important development tasks
Do not build your first evaluations around trivial tasks.
Good candidates include:
- Fixing recurring bugs
- Adding API endpoints
- Modifying authentication
- Updating database access
- Refactoring duplicated code
- Adding automated tests
- Updating CI workflows
- Implementing validation
These tasks provide useful signals about real agent performance.
Make acceptance criteria specific
Avoid requirements such as:
Write clean code.
This is difficult to evaluate consistently.
Prefer:
Use the existing CustomerRepository.
Do not introduce a second database abstraction.
Add tests for duplicate email addresses.
The second version gives the evaluation something concrete to verify.
Test normal and boundary conditions
An API task should not only test the happy path.
Consider:
Valid input
Missing input
Invalid input
Boundary values
Unexpected input
Existing behavior
This helps identify implementations that appear correct but fail under realistic conditions.
Keep the evaluation environment stable
Repeatability depends on consistent conditions.
If the repository state, test data, dependencies, or external services change between runs, differences in results can become difficult to interpret.
Use controlled fixtures and stable test conditions wherever possible.
Turn important failures into permanent evals
If an agent causes a serious regression, do not rely on memory.
Capture that scenario as an evaluation.
Over time, the eval suite becomes a collection of lessons learned from actual development work.
Common Mistakes
Checking only whether the project builds
A successful build does not mean the task was completed correctly.
The agent may compile the application while missing validation, tests, security requirements, or expected business behavior.
Using vague tasks
A task such as:
Improve the customer API.
does not provide enough information for a useful evaluation.
Define the expected behavior and constraints.
Checking only the agent's final message
The agent's explanation can sound correct while the repository tells a different story.
Evaluate the resulting files, tests, behavior, and build status.
Making evaluations too strict
An evaluation should measure required behavior rather than force one implementation unnecessarily.
For example, if either a service or handler implementation is acceptable, do not create a check that requires one specific class name unless the architecture requires it.
Creating too many evaluations too early
Start with a small set of high-value tasks.
A collection of meaningful regression cases is more useful than dozens of simple evaluations that do not represent real development work.
Troubleshooting Failed Evals
When an evaluation fails, first determine what actually went wrong.
The agent misunderstood the task
Review the task description and acceptance criteria.
If important requirements are implicit, make them explicit.
The agent changed unrelated files
Add clear repository constraints and create a check for the expected change surface.
The result changes between runs
Look for ambiguous instructions, unstable test data, external dependencies, or evaluation checks that depend on implementation details.
The agent passes but the implementation is poor
The evaluation probably does not cover an important requirement.
Add a check for the missing behavior instead of relying on manual memory.
The evaluation itself is incorrect
An evaluation can contain mistakes just like application tests can.
Review the expected result, test setup, fixtures, and validation logic before changing the agent.
Advantages of Repeatable Agent Evals
Repeatable evaluations provide several practical benefits:
- They make AI agent behavior easier to measure.
- They help detect regressions after agent configuration changes.
- They make agent improvements easier to compare.
- They preserve important failure scenarios.
- They encourage clearer engineering requirements.
- They complement existing unit and integration tests.
- They provide a repeatable feedback loop for AI-assisted development.
The most important benefit is consistency.
Instead of asking whether an agent "feels better," a development team can run the same tasks and compare observable results.
Disadvantages and Limitations
Evals also have limitations.
AI-generated solutions can vary between runs, which means evaluation design needs more care than a simple deterministic unit test.
A poorly designed evaluation can also create false confidence. If the evaluation does not check security, maintainability, backward compatibility, or performance where those areas matter, an agent can pass while still producing an unsuitable change.
There is also a maintenance cost. As the application architecture changes, old evaluations may need to be updated.
For this reason, an eval suite should be treated like other engineering tests: review it, maintain it, remove obsolete cases, and add new cases when important failure modes appear.
A Practical Workflow for Development Teams
A useful workflow looks like this:
Create or configure agent
|
v
Select realistic engineering tasks
|
v
Create repeatable evaluations
|
v
Run baseline evaluations
|
v
Improve agent instructions or tools
|
v
Run the same evaluations
|
v
Compare results
|
v
Review generated code
|
v
Run normal application tests
|
v
Approve the change
The human review step remains important.
An evaluation can tell the team whether predefined conditions were satisfied. It cannot replace engineering judgment for every architectural, security, or product decision.
The goal is not to remove developers from the process. The goal is to make the agent's contribution easier to measure and improve.
Summary
Testing an AI coding agent requires a different perspective from testing application code.
Unit and integration tests verify whether the resulting software behaves correctly. Repeatable agent evaluations add another layer by checking whether the AI agent can consistently perform realistic engineering tasks according to defined requirements.
A good eval should describe a real development problem, establish clear acceptance criteria, inspect the resulting repository, and remain reusable after changes to the agent.
The most valuable evaluations usually come from real failures. When an agent repeatedly makes an important mistake, turn that scenario into a repeatable test. This creates a growing regression suite for the AI development workflow.
As coding agents become more involved in repository-level development, teams will need ways to measure not only whether the generated code works, but also whether the agent consistently works within the project's architecture, testing practices, and engineering constraints. Repeatable evals provide a practical foundation for doing that.
Join the conversation! Your thoughts help the community grow.