Skip to content
Bugwise
Menu

Off-by-one error

A bug where a count or boundary is wrong by exactly one, like counting days instead of nights.

Definition

Off-by-one errors come from mixing up "less than" and "less than or equal", or counting the start and end points twice. They hide at boundaries, which is exactly where boundary value analysis looks.

In practice

A hotel stay from 20 to 21 October is shown as "2 nights" and charged twice.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.