expected value
The answer a test claims the code should produce, written into the test before comparing it with the real result.
In more detail
Work it out by hand and write it as a literal number or string. Never compute it by calling the code under test, because a test that agrees with the implementation by construction can never disagree with a bug.
Related terms
- assertion — A check that a condition is true, which stops a test or program with a failure if it is false.
- arrange, act, assert — A three-step shape for a test: set up the starting state, perform the one behaviour under test, then check the observable result.
Taught in
- Arrange, Act, Assert — Automated Testing, TDD & Quality Engineering