given, when, then

A way of describing a test or requirement as a starting situation, an event, and the expected outcome.

In more detail

It is the same idea as arrange, act, assert, phrased in words a non-programmer can follow. It comes from behaviour-driven development, where scenarios are written in this form before the code. It is also a useful shape for test names: the subject, the behaviour and the condition.

Related terms

Taught in

References