Evaluation and Testing
How to know your LLM feature works, and keep knowing it: golden sets, scorers, judges, regression gates in CI, fakes, recordings and production feedback.
A normal program either passes its tests or it does not. An LLM feature answers differently from run to run, changes behaviour when you edit one sentence of the prompt, and changes again when the provider updates the model. "I tried it three times and it looked fine" is how quality quietly falls apart. This phase teaches the discipline that replaces it: evaluation (measuring quality on a fixed set of cases) and testing (checking the code around the model).
You build one eval harness by hand across the phase, around one small feature: sorting support tickets into a category and a priority. First a golden set of labelled cases, then scorers (exact match, JSON validity, per-field accuracy, precision, recall and F1), then a runner that compares prompt versions case by case. A scripted "prompt v2" visibly fixes two cases and silently breaks a third. That regression is what the phase is about.
Then the harness goes to work: an LLM judge for answers no rule can score (and its biases), a CI gate with a threshold and an exit status, fakes and recorded responses so most tests are free and repeatable, and online evaluation from real traffic. Examples run in Python, Java and JavaScript against fake models. Two real-model labs let you write a judge prompt and see position bias for yourself.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.