Drawing App Logic as State Machines Exposed 10 Bugs Passing Tests Missed
A developer building LinkUnzip, a Chrome extension for previewing and saving single files from a remote zip, had 39 passing end-to-end tests. To probe the interactions between components, they modeled the app as state machines covering jobs, connections, and downloads, which surfaced 10 bugs the tests never exercised. The approach involved drawing diagrams directly from the code rather than from memory and checking every state against each possible incoming message or event. One key bug arose when Chrome restarted an idle service worker, causing completion messages to be dropped before state restoration finished and a successful extraction to be wrongly reported as failed. The fix was to delay handling replies until loading completes. The article argues that such bugs hide in transitions and timing gaps that conventional tests rarely cover.
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