AI testing
How do you test systems that answer the same question a little differently every time? The familiar "step — expected result" pattern works poorly here, so AI has its own ways of being tested. And the ability to check results is becoming the key skill for anyone who builds products with AI agents today.
In ordinary testing the expected result is written down in the requirements: you click a button, you get a specific value. A language model has no single right answer. Ask it the same question tomorrow and you get different wording, a different structure, sometimes different facts. Even temperature 0 doesn't fully fix it: answers drift because of how numbers are computed on GPUs, and because the provider updates the model from time to time.
Code is no different. Code written by an AI agent is still a model's answer, and the same prompt gives slightly different code each time. Comparing it line by line with a reference makes no sense. What you have to check is something else: does it do what it should? And that already looks more like what a tester does, only a tester who can code — an automation engineer, aka AQA. The tools and approaches here are their own, of course.
Evals: automated tests for AI
An eval (short for evaluation) is a set of test cases plus a way to score the answer to each of them. In essence these are automated tests for AI, except the result isn't "pass / fail" but a score: 87 % of answers without errors, 4 made-up facts per hundred, an average of 4.2 out of 5.
Why do you need them? Without evals, every change to an AI product — a new prompt, another model, an updated knowledge base — gets judged by eye: you ran five questions and it seems better. Evals turn "seems" into a number you can compare with the previous version. And you see straight away when fixing one case broke three others.
Answers can be scored in different ways, and a good eval set usually combines several:
- Code checks. Is the JSON valid, are all fields there, are there no banned words, is the answer in the right language. If the answer is unambiguous (a category, a number, yes or no), it's compared exactly. Generated code is run against tests. Cheap, fast and no surprises.
- Comparison with a reference. The answer is compared with a model answer by meaning, not word for word: how close it is to the reference and whether all the key facts are there.
- LLM-as-a-judge. Another model scores the answer against a rubric written in advance: accuracy, completeness, tone, no made-up facts. There's also pairwise comparison: the judge sees two answers and is asked which is better. Judges make mistakes too, so their scores are checked against human ones.
- Human review. Experts read and label answers. It's slow and expensive, but it's what automated judges are tuned against.
- Offline and online. Offline evals run on a fixed set before a release. Online evals look at real traffic: logs, user ratings, A/B tests.
- Benchmarks and your own evals. Public benchmarks such as MMLU or SWE-bench show how good a model is in general. They tell you nothing about your product; for that you need your own set built on your data.
Evals need checking too. If the judge gives top marks to everything and the reference set is long out of date, a nice number means nothing. That's one more job for a tester.
Errors multiply in an AI chain
An AI product is rarely a single model call. Usually it's a chain: understand the question, find the data, write the answer, check it, format it. Every link gets things wrong now and then, and those errors multiply. Five steps, each right 95 % of the time, together give a correct result only about 77 % of the time. Almost one answer in four misses, although every step on its own looks great. So you have to test not only the final answer but every link in the chain.
How AI is tested in practice
Evals are the foundation, but they need a process around them. It's usually made of these parts:
- A golden dataset. Real user questions and the criteria of a good answer to each: not the exact text, but what the answer must and must not contain.
- Checking every link. Separate evals for retrieval, generation and formatting, so that when something fails you know where it broke.
- Repeated runs. One case is run several times and the share of good answers is counted. That's where metrics like pass@k come from: at least one good attempt out of k.
- Regression in CI. Evals run on every change of model, prompt or knowledge base, just as automated tests run on every commit.
- Security. Prompt injection, data leaks, jailbreaks. Prompt injection is number one in the OWASP Top 10 for LLM Applications.
- Production monitoring. Some problems only show up with real users, so a sample of production answers is scored and the bad ones are added to the golden dataset.
For high-risk systems this is no longer just good practice. The EU AI Act requires such systems to be accurate and robust enough, and there is no way to prove that without testing.
Development becomes testing
Since the answer is non-deterministic, working with AI turns into a loop: set the task, get several versions, check them, pick the best. We iterate over prompts and results and keep whatever passes the checks. That looks more like testing than like development in the usual sense. Code is no longer written once; it's picked from attempts. And the quality of the product depends on whoever knows how to pick.
Why a tester may become the best AI engineer
Agentic Engineering is working with AI agents where a person sets the task and owns the result. It needs exactly the skills QA is built on: write a requirement that can't be read two ways; work out how to check the result; find the edge cases; never call a task done until it's verified. So the best Agentic engineer may well turn out to be a QA engineer rather than a former developer — someone who has spent a whole career checking other people's work and knows what "good enough" looks like.
Need to test an AI product or a chatbot, or build any project fast, cheap and well with Agentic Engineering? You're in the right place. All you need is to find an AI&QA engineer