A “bug” in software, as you’ve probably heard, causes a malfunction or misbehavior. Whence does the term “computer bug” originate? We’ll get to the bottom of it.
The term “bug” refers to a software error that was not intentionally made.
“Computer bug” is used as a term for an unintentional programming error or defect in software or hardware. Many software, firmware, and operating system flaws can be traced back to human error in the creation of the underlying hardware. A software bug is born when a programmer makes a mistake while writing software or writes code that works but has unintended consequences that were not anticipated by the programmer. Debugging is the process of removing bugs from software.
Even in this software-driven age, bugs are a big deal. The National Institute of Standards and Technology (USA) estimated $60 billion in software bugs per year (or 0.6 percent of GDP) in 2002, nearly 20 years ago. Despite the fact that it is difficult to estimate the true cost of software bugs, it is easy to imagine how they could reduce efficiency. The threat to transportation and critical infrastructure, such as power plants, can be very real.
Why are they called bugs?
Before the invention of computers, we don’t know who coined the term “bug” to refer to an engineering defect. Historians can trace its origins all the way back to Thomas Edison in the 1870s, according to written records.
Edison used the term “need to solve” in his personal notes and correspondence to denote a difficult problem that needed to be solved or an engineering flaw that needed to be corrected. When asked about the term’s insect connotations, he wrote in an 1878 letter, “Part of what you said was true; I did find a ‘bug’ in my equipment, but it wasn’t in the phone itself. It belonged to the “callbellum” family. The insect appears to be able to survive in all of the phone’s call apparatuses. “
The term “bug” may have been coined by someone else before Edison’s examples, and he may have simply popularized it among his engineering friends and associates. The term “fly in the ointment,” coined by the Oxford English Dictionary in 1889, describes an insect crawling into a piece of equipment and causing it to malfunction. This suggests that the term “bug” was inspired by an actual insect doing just that.
Ada Lovelace was the first person in history to recognize that software could malfunction due to programming errors. The Commentary on Babbage’s Analytical Engine in 1843 was the first time she mentioned it.
According to Lovelace, the analytical engine would have needed to have been subjected to some sort of analysis in order to get the data it needed to function, and that analysis could have introduced an error. Although the mechanism itself is unwavering, the cards may be giving it the wrong instructions. The actual calculation mechanism could be error-free in its data processing, but Lovelace stipulates that human input data (programmed on cards at that time) could give it incorrect instructions and thus produce incorrect results.
So, what about Grace Hopper’s Moth?
Since the Harvard Mark II computer had a moth fly into the relays and cause a malfunction, books, magazines, and websites have incorrectly reported that the term “bug” was coined by legendary computer scientist Grace Hopper. So goes the story: “The first actual case of a bug being found,” which she then taped into a logbook.
“Bug and “debug” were not coined after a moth flew into a Mark II in 1947, but rather predate the incident. Also, it’s not clear if the moth caused the computer to malfunction, just that it was an amusing discovery while they were fixing other flaws. After telling the story in a widely reported interview in November 1968, Hopper made it famous: “During our time debugging Mark II, we were in a different building, and the windows were unscreened.
The bugs poured in because we were working on it late at night. And one night, she passed out, and we went looking for the bug and found a dead large moth, about four inches in wing span, in one of the relays. We took it out and pasted scotch tape over it, and as far as I know, that’s still in the historical logbook at Harvard (we found an actual bug in the computer).
Her team had been looking for bugs in the computer hardware and software for a long time, but they had finally found an insect inside the computer. Thus, the inscription “The first actual case of a bug being discovered” was added to the sign. It is likely that the Mark IV moth was “beaten to death” by the computer’s electromechanical relays, implying that while the moth was inside the computer, the computer was still operational.
Whether it was Hopper’s logbook or not, the Harvard Mark II logbook is now housed in the Smithsonian National Museum of American History in Washington, DC, and historians don’t know who actually wrote the entry.
Computer bugs are a real and difficult problem for all programmers, and the Mark II moth (Let us call him “Mark”) is an iconic symbol of this.