AI QUALITY / CHECKLIST
How I test LLM features: a QA checklist
Traditional testing assumes the same input gives the same output, and that there's one right answer to check against. LLM features break both assumptions. Here's the checklist I use to test them anyway, and to decide when they're ready to ship.
Why LLM testing is different
When I test a login form, I know what "correct" looks like. When I test a feature that summarizes a document or answers a question, there may be hundreds of correct answers, and the model might give a different one every time I ask. On top of that, the behavior can change without anyone touching the code: a reworded prompt, a new model version, a different retrieval setting, or a new batch of ingested content can all shift the output.
So I stop asking "does the output match?" and start asking "does the output have the properties it must have, and none of the properties it must not have?" Everything below follows from that shift.
Start with a golden set
Before any checklist, I build a golden set: a versioned collection of test inputs, each paired with the properties a good answer must have. These are not exact expected strings. A good golden set includes:
- Typical cases that represent real usage, ideally sampled from real (anonymized) requests.
- Known hard cases: ambiguous questions, long documents, conflicting sources.
- Unanswerable cases, where the right behavior is "I don't have that information."
- Adversarial cases: injection attempts, requests for data the user shouldn't see.
- Every bug you've ever found, added as a regression case the moment it's fixed.
The golden set is the most valuable QA asset on an AI project. Treat it like code: review it, version it, and grow it.
The checklist
I group checks by the kind of risk they cover. Tick them off as you go; your progress is saved in this browser.
How to score it
Not every check needs an AI to grade it. I layer the scoring from cheapest and most reliable to most expensive:
- Deterministic checks first. Schema validation, length limits, regex for PII patterns, banned phrases, and whether citations resolve. They're fast, free, and never flaky.
- LLM-as-judge for the rest. Groundedness and relevance need judgment, so a second model scores each answer against a written rubric. Calibrate the judge against a sample of human-labeled answers before you trust it.
- Humans for a sample. A person reviews a slice of every run, especially new failures and anything safety-related.
Because outputs vary, I run each case more than once and look at pass rates, not single pass/fail results. A case that passes 7 out of 10 times is a finding, not a pass.
Here's what a property-based test looks like in practice:
# Golden set: inputs + required properties, versioned with the code
CASES = load_golden_set("summaries.yaml")
@pytest.mark.parametrize("case", CASES)
def test_summary(case):
out = summarize(case.source)
assert len(out.split()) <= 60 # format
assert not PII_PATTERN.search(out) # safety
for fact in case.must_mention: # coverage
assert fact.lower() in out.lower()
assert judge.grounded(out, case.source) >= 0.8 # groundedness (LLM-as-judge)
None of these assertions checks for an exact string, and all of them would catch a real problem.
Turning it into a release gate
A checklist only matters if it changes what ships. I agree on gate criteria with the team before testing starts, so the release decision isn't negotiated under deadline pressure. A typical gate:
- Zero critical failures in safety and security, with no exceptions.
- Groundedness and relevance at or above the last approved baseline.
- No unexplained regressions: every newly failing case is reviewed and either fixed or accepted, in writing.
- Performance and cost within budget.
After release, the same checks keep running on a sample of production traffic, because the next model update or content batch can change behavior again.
Testing LLMs isn't about proving the output is right. It's about proving the risks are known, measured, and acceptable before users find them.
Want to see some of these checks in action? The ai-eval demo on my home page scores three model answers for groundedness, invented facts, PII leaks, and prompt injection.