Why an AI feature needs a different kind of testing
A conventional test sends an input and asserts one expected output. That breaks down on an LLM feature for three reasons.
- The output varies. The same input can produce different wording, and sometimes a different answer. An exact-match assertion either flakes or checks nothing useful.
- Quality moves without a code change. A new model version from the provider, an edited system prompt, a re-indexed knowledge base or a changed tool definition can each make the feature better on one task and worse on another.
- Failures rarely look like errors. There is no stack trace. There is a confident wrong answer, a tool called with the wrong argument, or a policy quoted that does not exist.
So the work is measurement: a dataset of the cases that matter to your business, a criterion for each, and a score you can compare from one change to the next.
What a dataset covers
| Area | Example checks |
|---|---|
| Correctness | The answer agrees with your source documents or a reference answer |
| Tool use | The right tool, with the right arguments, in the right order |
| Abuse and leakage | Prompt injection through user content; the system prompt or another user’s data showing up in an answer |
| Edges | Questions outside the feature’s scope, empty retrieval results, ambiguous requests |
| Cost and speed | Latency and token use per task, so a quality gain is not paid for silently |
Where the suite lives
The evaluation suite sits in your repository next to the feature. It runs as a CI job on every change to a prompt, a model setting or the retrieval index, and on a schedule to catch provider-side model updates. The pull request shows which cases got better, which got worse and whether an agreed threshold was crossed. Your engineers can run it locally, extend it and keep it after the engagement ends.
The detail differs by product. AI agent testing covers tool calls, multi-step tasks and side effects. AI chatbot testing covers conversations, policies and hand-off to a person.
If you want the testing of the whole product handed over, not only the AI feature, see QA outsourcing services.