Software Engineering vocabulary · Debugging and Troubleshooting

Off-by-one error

Meaning in software engineering, with examples

nounCommon term

In software engineering, off-by-one error means: A common bug where a loop or calculation goes one step too far or stops one step too early, often because counting starts at zero.

In Turkish: bir eksik/bir fazla hatası, sınır hatası

How it is used

Typical causes are using <= instead of <, or forgetting that the last index is the length minus one. A well-known joke says there are two hard problems in computer science: naming things, cache invalidation and off-by-one errors.

Example sentences

  1. The report missed the last day of the month because of an off-by-one error in the date range.

  2. Check the loop condition; it looks like a classic off-by-one error.

Common collocations

  • classic off-by-one error
  • off-by-one bug
  • fix an off-by-one error
  • fencepost error

More terms: Debugging and Troubleshooting

Practise with graded reading

Reading at the right level is the fastest way to make new words stick. Pick free English books by level: