The Moth That Made History
On September 9, 1947, operators working on the Harvard Mark II electromechanical computer at the Naval Weapons Laboratory in Dahlgren, Virginia, traced a malfunction to a moth trapped in one of the machine's relays. They carefully removed the insect and taped it into the computer's logbook alongside the notation: "First actual case of bug being found."
The Mark II was a massive machine that used electromechanical relays to perform calculations. Unlike modern transistor-based computers, its mechanical parts were vulnerable to physical interference. The moth caused a relay to fail, disrupting the machine's operation — quite literally a "bug" in the system.
The Origin of "Bug" in Engineering
While the 1947 moth is the most famous computer bug, the word "bug" was used for technical glitches long before computers existed. Thomas Edison wrote in an 1878 letter about bugs in his inventions, describing unexpected problems that required investigation. Engineers of the early 20th century commonly referred to technical defects as "bugs."
What made the Harvard Mark II incident special was the literal truth of it — an actual bug caused a computer bug. The logbook entry captured this irony perfectly, and the story spread through the computing community, cementing the terminology in popular culture.
Grace Hopper and the Debugging Legacy
Rear Admiral Grace Hopper, a pioneer of computer programming and one of the developers of COBOL, is frequently associated with this story. While she was part of the team working with the Mark II, the moth was found by other operators. Hopper's role was in popularizing the anecdote and the terms "bug" and "debugging" throughout her long and influential career.
Hopper's contributions to computing go far beyond the bug story. She developed the first compiler and championed the idea that programming languages should be closer to English, leading to COBOL and modern high-level languages.
Bug Detection Today
From a literal moth in a relay to complex software defects in modern applications, the concept of "debugging" has evolved enormously. Today, automated bug detection tools use AI to find defects that would take humans hours to uncover, scanning applications across browsers and devices in minutes.
The spirit remains the same: find the problem, document it, fix it, and prevent it from happening again. Tools like Bugster continue this tradition by automatically testing real user flows on every code change.