Zero Dependencies, 456 Tests, and One Bug All of Them Missed
The test suite was green. All of it. Every assertion about the QR encoder I'd written passed, the way it had passed for weeks. I held my phone up to the screen anyway, more out of habit than suspicion, and the camera just sat there. No beep, no flash, no redirect. Nothing. A perfectly scannable-looking grid of black and white squares that no scanner on Earth could actually read. That…
The test suite for a photo timeline app, named Darkroom, was functioning perfectly. The app allows users to view their photos on a Wi-Fi network, sorted by the date they were taken. Darkroom was unique in that it had no dependencies listed in its Cargo.toml file, meaning all its functionality was custom-built. Despite this, the app had 456 automated tests that all passed, demonstrating the robustness of the code.
However, the app was missing one crucial feature - the ability to generate QR codes. This oversight led to a bug that went unnoticed by the extensive test suite. The bug was discovered when external QR code decoders were used to scan the generated codes, revealing a single bit of incorrect ordering. This seemingly small mistake had a significant impact on the functionality of the app.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.