What it is
A test set is a list of past cases where you already know the right answer. You run the agent over all of them and count how often it gets each one right.
For an invoice agent, each case is an old invoice with the fields your team entered. For a support agent, it is an old ticket with the reply your team sent, or the right category.
How it works in practice
Each case has three parts. There is the input, the answer you expect and a way to score it.
Some answers can be checked by code. An invoice total is right or wrong, and a program can check it at once.
Drafted text needs a rubric, such as "names the order and promises no refund". A person scores it, or a model does, once its scores agree with a person's.
Pick cases the way the work arrives. Include the common ones, the awkward ones and the ones that went wrong before.
A first set can be small, a few dozen cases. It grows each time the agent gets something wrong in use.
Why an agent needs one
A model can give a different answer to the same input. OpenAI's guidance says this is why ordinary software testing is not enough on its own.
Changes also cut both ways. A new line in the prompt can fix one case and quietly break another.
Then there are changes you don't make. Providers retire models, and the replacement may behave differently on your cases.
Without a test set, the only measure is that it seemed fine last time someone looked. With one, each change gets a score before it reaches your team.
What it means for a buyer
The test set is how you and a builder agree what "good enough" means. Set the pass mark before the build starts, and write it into the scope.
Your team should choose the cases and check the answers. They know which mistakes are costly.
Keep it in your own repository, beside the code and prompts. It lets you switch models or builders and prove the agent still works.
When our pilot tests an AI step, it is judged this way. The pass mark is agreed first, on cases your team checks.
Common mix-ups
- A demo. It shows examples someone chose. A test set scores cases nobody picked for the occasion.
- The examples in the prompt. Keep test cases out of them. If a case appears in both, the score looks better than the agent is.
- Software tests. They confirm a piece of code does one exact thing. A test set measures how often a model is right.
- One overall score. A good average can hide a poor score for one supplier or type of request. Score each type on its own.
What to ask
- How many cases are there, and where did they come from?
- Who checked the expected answers?
- What is the pass mark, for each type of case?
- Does it run after every change and every model switch?
- Can we see the result of the last run?
