Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

AI comparison

Evals vs unit tests

Unit tests check that code does exactly what it should every time; evals score how well a model-backed feature does over many cases, because its outputs vary.

Evals and Unit tests side by side
AspectEvalsUnit tests
ResultA score, such as 46 of 50Pass or fail
Output checkedVaried text, judged by rules, references or a judgeAn exact, known value
Speed and costSlower, may call a modelFast and free
When it failsLook at which cases got worseA specific assertion broke

Choose Evals when

  • The output is generated text or a model decision
  • You compare prompts, models or retrieval settings
  • Good enough is a threshold, not a single answer

Choose Unit tests when

  • The code is deterministic, such as parsing or validation
  • You check the code around the model
  • You want a fast check on every save

Learn it hands-on

These free lessons teach it with commands to run in a lab and checked tasks. Read them whole with no account.

Related terms

Eval
An eval is a repeatable test of an AI feature: a fixed set of inputs, a way to score each output, and a result you can compare between versions.
Golden set
A golden set is a fixed collection of inputs with agreed good answers, used as the trusted reference an AI feature is scored against.
LLM as judge
LLM as judge is using a language model to score another model's output against a rubric when a simple code check cannot decide.

← All AI terms