CategoryEngineering
PublishedMARCH 17, 2026

Evals Are the New Unit Tests for AI Features

Evals Are the New Unit Tests for AI Features

Evals are the new unit tests. How we test AI features after every model, prompt or data change: golden datasets, automated scoring, CI gates and human checks.

An AI feature can break without anyone touching its code. A provider updates a model. Someone shortens a prompt. A merchant uploads a new catalog. The tests still pass, and the feature quietly gets worse.

That is the problem evals solve. They are to AI features what unit tests are to normal code: the thing that tells you, before your users do, that a change made something worse.

This post covers how we test AI features at Blank, and how those checks fit into the same pipeline as the rest of our code.

Why Unit Tests Are Not Enough for AI Features

A unit test checks that a function returns an exact result. Give it 2 and 2, expect 4. AI features do not work that way. The same question can get ten different answers, and several of them can be correct.

The output is not exact, but it is not random either. A good answer has properties you can check. It mentions a real product. It quotes the right price. It answers in the shopper's language. It does not promise something the store does not offer.

The inputs change without a commit. Models, prompts and data all change behaviour, and only one of them lives in the codebase. Evals have to run whenever any of them changes, not just when code changes.

So we keep our unit and end-to-end tests for the code around the model, and add evals for the model's behaviour.

Build a Golden Dataset From Real Conversations

Evals are only as good as the cases in them. Invented test questions are too clean. Real users are vague, misspell things and ask two questions at once.

Start from real conversations. On Totebot, our AI shopping agent platform, every conversation is logged and every message gets a sentiment score. That gives us a steady supply of real questions, and the negative ones point straight at where the agent struggles.

Pick cases on purpose. A good golden dataset covers the common questions, the hard ones and the ones that went wrong before. Every bug we fix in an AI feature becomes a new case, so it cannot come back unnoticed.

Store the context with the case. An answer about stock is only right or wrong relative to the stock at the time. Each case keeps the input and the data the agent saw, so the result is repeatable.

Describe what good looks like, not the exact words. For each case we write down what must be true of a good answer: which products it may recommend, which facts it must get right, what it must never say.

Keep it small enough to run often. A few dozen sharp cases that run on every change beat a thousand that run once a month.

How a change to an AI feature is checked: a prompt, model or data change runs the fast eval set, is compared to the baseline, goes through a risk check and the full eval set, and only then reaches main

The layers that check an AI answer: code checks for facts, format and tools, an LLM judge for helpfulness and tone, traces, screenshots of the real UI, and people reading a sample of conversations

Score Automatically Wherever You Can

Most of what makes an AI answer right can be checked with plain code, and plain code is fast, cheap and never changes its mind.

Facts against the data. Does every recommended product exist? Is it in stock? Does the quoted price match the catalog? These are simple lookups.

Format and structure. Is the output valid where it needs to be? Did the agent call the right tool, like adding to the cart, with the right arguments?

Hard rules. Right language, reasonable length, no made-up discount codes, no answers outside the store's topic.

We run these first. If an answer fails a hard check, nothing else matters.

Use LLM-as-Judge, With Care

Some qualities are hard to check with code. Was the answer helpful? Did it understand what the shopper really meant? Was the tone right for the brand? For these we use a second model as a judge, and we treat it like any other measuring tool: useful, but only once you know how it errs.

Ask narrow questions. "Rate this answer from 1 to 10" gives noisy results. "Does the answer recommend a product that fits the stated budget? Yes or no" gives useful ones. We break quality into a short list of yes-or-no questions.

Check the judge against people. Before we trust a judge, we compare its scores with our own on a sample of cases. If it disagrees with us often, we fix the questions before we use the scores.

Do not let a model grade its own homework. The judge should be a different model from the one being tested. Judges also tend to prefer longer, more confident answers, so we score length separately.

Judges inform, they do not decide alone. A judge score can flag a problem. For anything involving money, personal data or promises to a customer, a deterministic check or a person makes the final call.

Regression Gates in CI

Evals that someone runs by hand when they remember are not evals. They are a ritual. We run them in the same pipeline as every other check.

A change to a prompt, model or retrieval is a code change. Prompts live in the repository and go through pull requests. Switching a model is a configuration change in a pull request, not a toggle someone flips in a dashboard.

Fast set on every pull request, full set before release. The small golden set runs with the rest of the checks on each pull request. The full set runs before anything reaches production. It is the same idea as running the tests for what changed on a pull request and the full suite before main.

Compare to the baseline, not to perfect. No AI feature scores 100%. The question for every change is whether it is better or worse than what is running now. A drop beyond a set threshold blocks the merge.

Run noisy cases more than once. Model outputs vary. A case that fails once in five runs is telling you something, and a single run will hide it.

Model changes are high risk by default. A model swap can change every answer at once, so it always gets a person's review on top of the evals.

Screenshots and Traces Show What Scores Miss

A score tells you that something got worse. It rarely tells you why.

Screenshots of the real build. An answer can be correct and still look broken: a product card that does not render, a streamed answer cut off mid-sentence, a chat bubble overflowing on a phone. Screenshots of the real build in our checks catch what text-based scoring never sees.

Traces for every eval case. For each case we keep the full path: what the agent searched for, which products it retrieved, which tools it called, how long each step took and what it cost. When a score drops, the trace usually shows the cause in minutes. Often it is retrieval, not the model.

Humans Still Read the Conversations

Automated scoring covers what you already know to look for. People find what you did not know to look for.

We regularly read a sample of real conversations, with a bias toward negative sentiment and unusual requests. Every new kind of failure we find becomes a new eval case and, where possible, a new automated check. Over time the human work shifts from catching known problems to finding new ones, which is the only part people are truly needed for.

Test the Behaviour, Not Just the Code

AI features fail differently from normal code. They fail gradually, quietly and after changes nobody thought were risky. The answer is not to avoid changing them. It is to make every change prove itself, the same way the rest of our code does.

Treat prompts and models as code, keep a golden set built from real use, score what you can automatically and keep people reading what matters. Then a model update is just another pull request. If you are building AI into your product, this is the part we would set up first. Read more about how we approach AI solutions and why AI projects fail.

Share this post:
Launch Your AI Project

We collaborate with future and technology focused brands and companies.