A persistent error in software or hardware. If the bug is in software, the bad logic can be corrected by changing the program code. If the bug is in hardware, a new circuit has to be designed and the chip replaced. Years ago, Intel took intense heat for a mathematical flaw in one of its CPU circuits, but such hardware imperfections are rare.
Bugs Are Predominantly in Software
Applications have become incredibly complex, and programmers have to be perfectionists to write huge programs with no bugs. Software can be buggy forever because each new version produces different bugs. Hardware bugs are rare but hardware failure is common, mostly due to the gradual degeneration of components.
All the Way Back to the 1800s
Although the derivation of bug is generally attributed to a moth found squashed between the relays of Harvard University's Mark II electromechanical calculator in 1947, the term actually dates back to the 1800s to refer to flaws in mechanical systems. See
buggy,
bug fix,
software bug,
broken,
glitch,
debug,
Heisenbug,
bug bounty and
Web bug.
A Note from the Author
On October 19, 1992, I found my first "real bug." When I fired up my laser printer, it printed blotchy pages. Upon inspection, I found a small, dead beetle lying belly up in the trough below the corona wire (we live in the country). The printer worked fine after removing it!