edge case

An input at the limits of what code must handle, such as an empty list, zero, a single item or the largest allowed value.

In more detail

Bugs cluster at edges, so tests should include them alongside ordinary cases. Off-by-one errors are the classic edge-case failure.

Examples

Go: add a table row for empty input before adding the branch that handles it
In this course: For numbers that means zero, one, negative values, the boundary and one past it; for text, the empty string, one character, spaces and accented letters. A name like test_discount_edge is not enough: say which edge and what should happen there.

Related terms

Taught in

References