The story is told that one of the early electromechanical computers suffered a failure because a hapless insect had crawled into the vitals of the machine and been squashed between the contacts of a relay. The incident was written up in the log-book and spread from there throughout the whole of the infant computer industry. However, although the account seems to be genuine, the word is older: The event was recorded as an amusement for posterity precisely because the term bug was already in use. The term in fact originates not with computer pioneers, but with engineers of a much earlier generation. The first example cited in the Oxford English Dictionary is from the Pall Mall Gazette of 11 March 1889:
Mr. Edison, we were informed, 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.
It seems clear from this that the original bug, though it was indeed an insect, was in fact imaginary.