Module 2 of 4
Building test sets
Cases that reflect real use, including the awkward ones.
Four lessonsAbout 15 minutes
EvidenceMeasure, do not assert
Self-checkedAnswers are in the text
Lesson 1
Start from real questions
Collect actual user questions and failures. Synthetic cases are useful for coverage but real ones find the gaps.
Remove personal data and keep the source of each case.
- Real questions first.
- Redact before storing.
- Keep a reason for each case.
Check yourself. Where should the first test cases come from?
Lesson 2
Expected outputs
For factual answers, record the supporting passage and the required facts. For open answers, record the rubric rather than one exact string.
Scoring exact text punishes correct paraphrases.
- Rubrics for open answers.
- Required facts for factual answers.
- Schema for structured output.
Check yourself. Why is an exact-string match a poor test for prose?
Lesson 3
Edge cases
Empty input, very long input, mixed languages, contradictory documents, hostile instructions, missing permissions.
Most incidents live in these cases, not in the happy path.
- Test the empty case.
- Test the hostile case.
- Test the unauthorised case.
Check yourself. Which edge case protects other users' data?
Lesson 4
Keeping the set honest
Version the set, freeze a golden subset for regressions and rotate in new failures.
If you tune on the test set, it stops being a test.
- Freeze a golden subset.
- Add every production failure.
- Do not train on the test set.
Check yourself. Why does tuning on the test set invalidate it?