Great work!

XP to next level

BugEater

Date Range Logic — Overlaps and Inversions

Advanced All professions 104 XP 80 min

Updated: 07/07/2026

Start Module

A single date is simple to validate. A range of dates is where things get interesting. When does a range start — at the beginning of the start day, or at midnight? Is the end date included or excluded? What happens when the end date is before the start date? What if two ranges share an endpoint? These questions have concrete answers, and getting them wrong produces real bugs: double bookings, phantom availability, zero-duration reservations accepted as valid.

This module covers the semantics and testing of date ranges and intervals. You will learn the difference between closed and half-open intervals, why half-open is usually preferable in software, how to detect the "end before start" inversion bug in all its forms, the six ways two intervals can relate to each other according to Allen's interval algebra, and how to derive the minimal overlap detection formula that underlies every booking system.

The module's four lessons progress from foundational interval theory through inversion bugs, overlap detection, and finally the subtle edge cases of zero-duration and contiguous ranges. Mastering this module will make you significantly more effective at testing any system that manages reservations, schedules, subscriptions, or validity periods.

Module content