Developer Builds QR Encoder From Scratch, Finds 50 Tests Still Missed Two Real Bugs
A developer rebuilt the popular JavaScript QR code library qrcode in 844 lines of Node.js for a hackathon that banned external dependencies, ending up with 50 passing tests. Despite thorough unit testing against ISO/IEC 18004 specification examples, two bugs went undetected by the entire test suite. The first bug was discovered in four seconds on day three simply by pointing a phone at a generated QR code — something the developer had avoided doing earlier. A reference tool available via a single npm install command would have caught both bugs on the first day, but was not used because it felt like breaking the hackathon's spirit. The write-up uses the experience to examine the limits of unit testing for visual or behavioral outputs, and questions how much borrowed code in typical Node projects is truly understood by the developers shipping it.
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