How I test AI before it ships
An AI demo shows that something can work. Testing shows that it keeps working with real users, real data and the next prompt change. Every AI system I put into production goes through the same six steps.
The six steps
Agree what "good" means
Together we set task-specific measures: correct answers, answers grounded in your sources, the right fallback when the system is unsure, and response time and cost per conversation.
Build a golden dataset
Realistic questions with expected outcomes from your domain, including the awkward ones. For a real estate lead agent, that was 51 cases.
Run deterministic checks first
Fast, cheap tests for facts that must be exact (prices, dates, IDs) and for required behaviour (AI disclosure, fallbacks).
Use LLM-as-judge for the rest
A second model scores correctness, groundedness, retrieval quality and intent recognition against the expected answers.
Gate every release
The evaluation runs in CI. A change that scores below the agreed baseline does not ship.
Monitor in production
Latency, token cost, retrieval quality and user feedback on a dashboard, so drift shows up before users complain.
Common Questions
How do you test an LLM application before release?
Agree on expected behaviour, collect representative questions and run deterministic checks for exact facts. Evaluate less exact answers against a rubric, review failures and block a release that falls below the agreed baseline.
What is LLM-as-judge and when can you trust it?
It is a second model that scores outputs against a rubric. Compare its judgments with reviewed examples, inspect disagreements and keep exact facts in deterministic tests. A model score alone is not proof of correctness.
How do you catch regressions after go-live?
Track latency, cost, retrieval quality and user feedback in production. Investigate changes and add confirmed failures to the golden dataset so the next release catches them before deployment.
Do you test classical ML models the same way?
The release discipline is similar, but the measurements differ. For classical ML, track experiments, validate on held-out data, register versions and monitor drift after release.
Testing terms in plain language
- Golden dataset
- A golden dataset is a collection of realistic inputs paired with expected outcomes. It includes difficult cases and clear criteria for judging the result. The WhatsApp lead agent used 51 cases to test behaviour against real estate enquiries.
- Deterministic checks
- These tests have an exact pass or fail result. They catch incorrect prices, dates, identifiers or missing disclosures without asking another model to interpret the answer. Run them first so obvious errors are cheap to detect.
- LLM-as-judge
- A separate language model evaluates an answer against a rubric and expected outcome. It helps assess qualities such as groundedness where exact string matching is too narrow. Review its decisions against human-labelled examples before relying on its scores.
- Release gate
- A release gate stops a change when its evaluation falls below an agreed baseline. The same test set runs in CI for each candidate release. A failed gate calls for investigation rather than an automatic deployment.
- Production monitoring
- Testing continues after deployment because users and source data change. Monitor response time, cost, retrieval quality and feedback to spot drift. Use what you learn to update the golden dataset and the next release's checks.
For classical ML models
- Experiment tracking with MLflow, so every run is tied to its code, parameters, metrics and data
- Validation on held-out data before a model is promoted
- A model registry with versions you can roll back
- Drift monitoring after release
What you keep
- The golden dataset
- The automated test suite and CI release gate
- An evaluation report with the baseline
- The monitoring dashboard
Already running an AI application?
An LLM Evaluation Sprint adds a golden dataset, automated checks and a release gate.
Book a free 30-minute call