Leap Year
// Definition
A year with 366 days that adds 29 February to keep the calendar aligned with Earth's orbit. The rule: a year is a leap year if divisible by 4, except years divisible by 100 are not leap years — unless also divisible by 400 (2000 was a leap year; 1900 was not). This three-part rule is a frequent source of off-by-one bugs: developers who only check divisibility by 4 will incorrectly treat 1900, 2100, and 2200 as leap years. In QA, 29 February is a canonical boundary-value test case for any date field: it should be rejected in non-leap years and accepted in leap years. Systems that compute ages or date differences must also handle the February 29 to March 1 transition in non-leap years correctly. The unambiguous formula is: (year % 4 === 0) && (year % 100 !== 0 || year % 400 === 0).
// Related terms
Boundary Value Analysis
Testing values immediately at and around boundaries (e.g., min, max, just-below, just-above). Bugs cluster at edges — this technique catches off-by-one errors that equivalence partitioning alone misses.
Off-by-one Error
A logic error where a loop, index, or boundary check is off by exactly one — iterating one too many or too few times, or including/excluding a value at the edge of a range. Common causes include using < instead of <=, starting a loop at index 1 instead of 0, or miscalculating array bounds. Boundary value analysis targets off-by-one errors directly by testing the values immediately at and on either side of every boundary.
ISO 8601
An international standard that defines unambiguous string representations for dates, times, durations, and intervals, eliminating locale-specific ambiguity (01/02/03 means different dates in different countries). The canonical format for a datetime instant is YYYY-MM-DDTHH:mm:ss.sssZ, where T is a literal separator and Z indicates UTC; offsets are expressed as ±HH:mm (e.g. +05:30). QA relevance: use ISO 8601 strings in all API test fixtures and test data to avoid parser ambiguity across systems and locales; assert that APIs return ISO 8601 timestamps rather than locale-specific strings; and be aware of edge cases at leap-year February 29 boundaries and DST transition instants where a naive local-time string is ambiguous or non-existent.