Definition
Plain language
The version of a program everyone agrees is correct, used as the standard to compare against.
As stated in the literature
A canonical known-good solution used as the oracle for computing expected outputs and for gating or repairing authored test suites.
Also called: reference solution, reference implementations, reference solutions, reference run
Why it matters: A known-good version turns test authoring from a guessing exercise into a mechanical one, and can also be used to throw out or fix tests that the correct code fails.
For example, if you already have a working sorting function, you run each test input through it and record what it returns as the expected answer.
Heard on the show
“Which the reference solution doesn't do.”Episode 233 — Why a Model Can Grade an Answer But Not Write the Answer Key