Silent calendar bug corrupted five years of Korean astrology charts, tests missed it
A developer building a Korean saju (BaZi) astrology service discovered that a third-party calendar library was returning the same solar term timestamp for every year, regardless of the year passed as input. The bug meant that birth charts for anyone born on or near a solar term boundary between 2020 and 2030 — except 2026 — may have been calculated incorrectly, sometimes by as much as twelve hours. The flaw went undetected for five years because the test suite's expected values had been derived from the same faulty library, making the tests confirm the library's output rather than astronomical reality. A secondary issue compounded the problem: all test probes had been chosen on the same side of the real boundary, so they would have passed even against an independent correct dataset. The developer has since replaced the dependency with verified astronomical data and redesigned the tests to assert that different years must produce distinct solar term instants.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in