Traditional testing assumes code either works or it doesn't. AI features don't work that way. This guide covers what changes and how we test them.
When you write a function, you can assert the output. When you call an LLM, you get a range of possible outputs. That one difference changes how you have to test.
The same prompt can return different outputs on every call. You can't write a
simple assertEqual. Any evaluation method that requires exact string
matching will miss most real failures and cry wolf on acceptable variation.
For most LLM tasks like summarisation, tone, helpfulness, and reasoning quality, there's no single correct answer. Instead of one expected output, you need a rubric that describes a good answer. Agreeing on what "good" means is often the hardest part.
LLMs fail in ways that don't exist in traditional software: hallucination, sycophancy, prompt injection, context confusion. You can't find these by reading the code or checking logs. You find them by probing the model's behaviour directly.
Most AI features in production run into several of these. Here's what each one looks like and what to test for.
The model generates plausible-sounding content that is factually wrong: invented citations, non-existent regulations, made-up product specs. The danger is the confidence: users can't tell the difference.
Small changes to phrasing, such as a different word order or an added sentence, can produce dramatically different outputs. This makes prompt engineering feel like whack-a-mole: fix one thing, break another.
Safety instructions in a system prompt can be worked around. Creative inputs get past them, and users find these paths, on purpose or by accident.
When an AI can call tools or take actions, a wrong answer becomes a wrong action. Agents can pick the wrong tool, pass it the wrong inputs, stop halfway through a task or act without asking.
If your product uses RAG, the LLM's output quality is only as good as what it retrieves. The model can ignore retrieved context, misattribute it, or blend it incorrectly with its training knowledge.
Model providers update their models without always announcing what changed. Prompts that worked before may behave differently after the next update. Without automated evals, you won't know until users tell you.
Exact-match assertions don't work, so you need other ways to measure quality. These are the main approaches, each with its own trade-offs.
A human rates outputs against a rubric. Highest quality signal. Slow and expensive to scale. Essential for establishing ground truth on a calibration set.
A separate, strong model scores outputs against your rubric. Fast and scalable, but the judge has its own biases, so its prompts need careful design.
Scoring criteria written for your use case. For example: does this answer follow our tone policy and answer what the user actually asked?
A fixed set of test cases with expected behaviour. Run automatically on every prompt or model change. The closest thing to unit tests for LLM behaviour.
No single tool covers everything, and the right mix depends on your product. This is what we use most and what each is good at.
AI Agent Skills
Agent skills we build for each product, with our testing knowledge and heuristics built in. They work out what needs testing for a change, test it and report what they found.
SHAP / LIME / PDP
Explainability tools used in ML testing engagements. SHAP and LIME explain individual predictions, while PDP plots reveal how features influence model behaviour globally.
Custom Harnesses
When off-the-shelf tools don't fit, we build lightweight Python eval harnesses around your inputs, outputs and scoring criteria.
Exploratory Testing
Not everything can be automated. Hands-on exploration finds new kinds of failure, especially around guardrails and edge cases, and is part of every engagement.
LLM-as-Judge
A strong model scores outputs at scale. We design the judge prompts carefully and check them against a set of human-rated answers first.
Pytest + CI
For teams that want evals in their existing workflow. Wrapping LLM checks in Pytest means regressions show up in the same pipeline as your other tests.
Every LLM product has different failure modes. Bring yours and we'll figure out where to start.
Book a Free Call