23

What is the origin of the expression bug when used to refer to software? Wikipedia says it's from 1843 in Ada Byron's notes on the analytical engine. Another source I found was on dictionary.com:

The latter observation may explain a common folk etymology of the term; that it came from telephone company usage, in which "bugs in a telephone cable" were blamed for noisy lines. Though this derivation seems to be mistaken, it may well be a distorted memory of a joke first current among telegraph operators more than a century ago!

It seems to me that nobody really knows and that it's just a reference that came into being maybe through another domain than software and eventually creeped into it when computers and software were born. I've always thought that it might have been because an actual bug (insect) went into a mechanical calculator and got jammed somewhere which messed the process.

J_A_X
  • 333
  • I've always suspected that it's no coincidence that "bug" and "virus", two computer terms referring to something wrong in a system, mean the same thing medically. – Jeremy Sep 07 '11 at 03:57
  • 6
    @Jeremy "Bug" and "virus" have radically different meanings in software, though. Bugs are simply unintentional defects in software; viruses are software specifically designed to copy itself from system to system without the user's knowledge. – benzado Sep 07 '11 at 05:21
  • 1
    You misread the Wikipedia article; the Ada Byron quote demonstrates the concept of a 'bug', but it's the Edison quote from 1878 that uses the word. – Russell Borogove Sep 07 '11 at 18:57
  • Just a comment about the "joke" among old-time telephone operators that bugs were messing up the lines - they were - they would bore holes in the lead-sheathed splice boxes of the old cable systems. lead cable borer – Phil Sweet Jun 07 '17 at 02:14

4 Answers4

31

The story I've always heard was that Adm. Grace Hopper coined the term "debugging" when a moth was removed from the computer she was working on. Here's a link to Adm. Hopper's bio, including a picture of the notebook page in which the first bug was immortalized:

picture of first computer bug

http://usnhistory.navylive.dodlive.mil/2014/12/09/grace-hopper-navy-to-the-core-a-pirate-at-heart/

Update: Wikipedia shows the same picture, and says that "bug" and "debug" were in use before the "first actual computer bug." Wikipedia's version of the etymology of "bug" says that the term had been in use in engineering for decades before the taping of the moth, and that the moth was taped into the notebook because those who found it knew the term's meaning in engineering. That seems to make more sense -- taping an actual moth into the log book would have been more gross than funny had the term "bug" not already been familiar to those in the group. In my own experience, Adm. Hopper's name has been associated with "bug" every time I've heard or read this story, probably because she often told the story herself. So, while she apparently did not coin the term, I think she deserves significant credit for cementing "bug" in the programmer's daily lexicon.

Caleb
  • 3,364
  • Hahaha, that's awesome and I guess I was partially right :) –  Sep 07 '11 at 03:13
  • 2
    yeah, but it seemed that the terms existed before. Apparently there is a reference to "debugging" in the oxford dictionary in the aviation engine testing field in 1945 and bug was used well before. The notebook moth is a joke, as the term was used before. As the note say, "first actual case". – Nikko Sep 07 '11 at 05:33
  • 17
    The irony of someone named Grace Hopper (Grasshopper) coining the term 'bug'... – Jordaan Mylonas Sep 07 '11 at 05:35
  • 6
    You all realize that it is entirely false? – Nikko Sep 07 '11 at 05:43
  • 1
    @Nikko, You mean, the picture of the actual defect card with the taped moth to it that was in a museum is false? – J_A_X Sep 07 '11 at 05:53
  • 10
    The question is about the origin of the word "bug" in software. The thing is, the term was already used, as the note reads: "first actual case". – Nikko Sep 07 '11 at 05:55
  • 1
    This answer is about the word "debug"; the question was about "bug". – benzado Sep 07 '11 at 05:57
  • @Nikko, Agreed, it has everything to do with software, hence why the references to Edison and the war are irrelevant since they're hardware based. – J_A_X Sep 07 '11 at 06:02
  • @benzado, I realize that the original question was about "bug," not "debug." I answered this back on StackOverflow, where the two terms are inextricably linked, and where the emphasis of the question seemed to be more on the idea than on the specific word. – Caleb Sep 07 '11 at 06:27
  • @Nikko, I added the "update" section to point back to the Wikipedia article specifically because I realized that "debug" (not to mention "bug") was not coined by Adm. Hopper. Nevertheless, if you ask anyone who knows something about computing lore about "bug", Adm. Hopper's name and this story are bound to come up, and the moth taped in the notebook will forever be "the first computer bug." She may not have coined the term, but she unquestionably cemented it in the daily lexicon of computing. – Caleb Sep 07 '11 at 06:35
  • 3
    -1 Most of this answer is about "debugging". The answer doesn't even mention Wikipedia's etymology, and in any case that's not a good enough source. If you read the Wikipedia etymology it even says: "The invention of the term "bug" is often erroneously attributed to Grace Hopper". It doesn't even give an etymology of bug in software. – Hugo Sep 07 '11 at 08:23
  • @Hugo, and yet, you think that Wikipedia is a better source? – J_A_X Sep 07 '11 at 08:41
  • @J_A_X No. Answers here should be full answers not ones where you need to go away to find the answer, so if you're going to reference Wikipedia, at least make sure it doesn't contradict your answer. And even if it doesn't contradict your answer, no, I don't think Wikipedia, as a tertiary source, is the best source. – Hugo Sep 07 '11 at 08:52
  • 3
    What I meant is chances are this incident had no impact in the popularization of the usage of "bug" in softwares – Nikko Sep 07 '11 at 09:36
  • 3
    @Nikko, I would disagree, considering that Ms. Hopper was a very prominent figure in software. She invented COBOL and set a lot of important standards within the military for their software systems. She even has a destroyer named after her. If anything, she introduced the naming of bug/debugging to the larger community. – J_A_X Sep 07 '11 at 23:54
  • 2
    How can we be sure? Does her story had much impact when people ignored what the term "bug" meant? – Nikko Sep 08 '11 at 03:55
  • 1
    Probably the incident had little effect simply because the term was already in wide use. Note the line immediately after the moth in the notebook: "First actual case of a bug being found," Bugs in machinery (in the sense of errors of function) were widely talked about, but an actual, 6-legged bug being found to be the bug was cause for comment. – WhatRoughBeast Jun 07 '17 at 01:38
24

Use of bug in the general sense of a disruptive person is in Shakespeare Henry VI, part III - Act V, Scene II: King Edward:
“So, lie thou there. Die thou; and die our fear; For Warwick was a bug that fear'd us all.”

Samuel Johnson's dictionary defines bug as “A frightful object; a walking spectre” from ‘bugbear’, a Welsh term for a mythological monster

The earliest use in the software sense seems to be Edison:

... Edison in the year 1889: In that year, the Pall Mall Gazette reported that "Mr. Edison...had been up the two previous nights discovering a 'bug' in his phonograph—an expression for solving a difficulty, and implying that some imaginary insect has secreted itself inside and is causing all the trouble."

mgb
  • 24,191
  • 2
    The stories about finding bugs in vacuum tubes and never seemed quite convincing; I suspect the better question is to ask about the origin of "bug" in engineering (going back further than computers). – benzado Sep 07 '11 at 05:23
  • 8
    @benado - the point of the Grace Hopper 'bug' was that the term was already common enough to be ironic – mgb Sep 07 '11 at 05:49
  • 1
    Yeah, I got that. It clearly it came to software from engineering, and to engineering from, well, Shakespeare. So I'm saying I'm more interested in the early engineering uses. – benzado Sep 07 '11 at 05:59
  • @benzado, I didn't ask for the origin of 'bug' in engineering, I asked for it in the software realm. For hardware, it's very understandable why some would call it a bug because it's physical, but trying to understand why we would use it in software today is very different. – J_A_X Sep 07 '11 at 06:01
  • 2
    I understand that what I am interested in isn't what you asked. The path of "bug" from the engineering realm and the software realm is pretty clear to me (both mean a defect). The path from "walking spectre" to engineering defect is a little more interesting (to me). You don't need to clarify your question (J_A_X) or your answer (Martin), I get them, I was just making a comment. – benzado Sep 07 '11 at 06:20
  • @J_A_X But the moth was removed from the computer's hardware. It shows the term was commonly used in engineering, but not that the term had crossed over to software. – Hugo Sep 07 '11 at 08:25
  • @Hugo, actually, the moth was present in the hardware relay (old day "software"; kind of like a punch card) while they were doing software tests to see if it would pass. The log of which said that it failed because a bug interrupted the process. The simple fact that this is actually documented properly is much better than anything else that's been given as an answer. – J_A_X Sep 07 '11 at 08:44
  • 1
    @J_A_X The Harvard Mark II read programs from tape (the "software") and executed it using those relays (or switches, like in a processor). Anyway, regardless of software/hardware nit-picking, it's certainly a nice story :) – Hugo Sep 07 '11 at 09:03
  • I do remember when everyone was talking about the Hopper origin of the term and it is plausible that even with older usage, she made it really stick in the software context. But I was so excited to read a bio of Edison and see the quote about the phonograph -- I think I saw him quoted as saying something like, "There has never been a phonograph without a bug in it:" I thought I was on to something but found, in OED about 30 years ago that they too had found Edison's usage of the term. – releseabe Jul 11 '21 at 12:35
  • Just watching Edison, the Man a 1940 film starring Spencer Tracy and the word is used in this film -- perhaps this the very first time "bug" appeared in a film in the sense under discussion. – releseabe Dec 29 '21 at 11:17
16

Here: hyperdictionary

I find this explanation:

Admiral grace hopper (an early computing pioneer better known for inventing cobol) liked to tell a story in which a technician solved a glitch in the harvard mark ii machine by pulling an actual insect out from between the contacts of one of its relays, and she subsequently promulgated bug in its hackish sense as a joke about the incident (though, as she was careful to admit, she was not there when it happened). For many years the logbook associated with the incident and the actual bug in question (a moth) sat in a display case at the Naval Surface Warfare Center (NSWC). The entire story, with a picture of the logbook and the moth taped into it, is recorded in the "Annals of the History of Computing", Vol. 3, No. 3 (July 1981), pp. 285--286.

The text of the log entry (from September 9, 1947), reads "1545 Relay #70 Panel F (moth) in relay. First actual case of bug being found". This wording establishes that the term was already in use at the time in its current specific sense - and Hopper herself reports that the term "bug" was regularly applied to problems in radar electronics during WWII.

Indeed, the use of "bug" to mean an industrial defect was already established in Thomas Edison's time, and a more specific and rather modern use can be found in an electrical handbook from 1896 ("Hawkin's New Catechism of Electricity", Theo. Audel & Co.) which says: "The term "bug" is used to a limited extent to designate any fault or trouble in the connections or working of electric apparatus." It further notes that the term is "said to have originated in quadruplex telegraphy and have been transferred to all electric apparatus."

The latter observation may explain a common folk etymology of the term; that it came from telephone company usage, in which "bugs in a telephone cable" were blamed for noisy lines. Though this derivation seems to be mistaken, it may well be a distorted memory of a joke first current among telegraph operators more than a century ago!

Actually, use of "bug" in the general sense of a disruptive event goes back to Shakespeare! In the first edition of Samuel Johnson's dictionary one meaning of "bug" is "A frightful object; a walking spectre"; this is traced to "bugbear", a Welsh term for a variety of mythological monster which (to complete the circle) has recently been reintroduced into the popular lexicon through fantasy role-playing games.

As for "debugging", wikipedia notes that the Oxford English Dictionary entry for "debug" contains a use of "debugging" in the context of air-plane engines in 1945.

For the use of "bug" in software, then, at first in the history of computers there was no real software, the program was hardcoded with hardware parts. So it seems sensible to say that the term transitioned from hardware to software when the latter started to be independant from the former..

EDIT

I found in Robert Leckie's book "Strong Men Armed: The United States Marines Against Japan" that he refers to a "faulty" airplane as "a plane full of bugs". I think it was then a Navy/Marine expression at that time (the book was written in 1962 though).

Nikko
  • 335
11

The earliest evidence of "bug" being used in the context of a computer (and in software) was on 17th April 1944, pre-dating the famous 1947 moth found in the Harvard Mark II.

The ASCC Mark I arrived at Harvard in February of 1944 and was installed with the assistance of IBM engineers (see Fig. 2 ). I.B. Cohen has examined a photocopy of the logbook kept by Robert Campbell, a young physicist at the Computation Laboratory. It tersely summarizes hours spent finding and correcting errors. On 17 April 1944, Campbell wrote, "Ran test problem. Mr. Durfee from I.B.M. was here to help us find 'bugs.'"

I. Bernard Cohen, professor of the history of science at Harvard, also reported this:

A photocopy of the logbook is in library of the Computer Museum, Boston. Both the Annals papers are short and interesting reads on how the term "bug" found its way into programming.

Hugo
  • 67,535