Any fault or defect—often recurring and permanent—in computer hardware or software. The goal of alpha tests and beta tests is debugging, or finding and fixing these errors before the hardware or software is in general release.
The origin of the term "bug" (in this sense) is said to come from several versions of a story dating from the 1940s. The most confirmable of these, occurring in 1945, involves a moth that was caught in a relay, crashing a Mark II electromechanical calculator the Navy had installed at Harvard. (The offending insect was apparently taped into the logbook for the session.) The term "bug" thus came to refer to any computer error, but actually it dates from much earlier than that. In 1878, Thomas Edison used the term "bugs" to refer to "faults and difficulties" in a mechanical system. Surprisingly, even he didn't invent the term; it dates at least from the early days of telegraphy (Edison had worked for Western Union in his youth), and it was a common slang term even then, perhaps deriving from the ubiquitous "wildlife" in less-than-immaculate telegraph offices. (It is said that telegraphers used to compose poetry about the gymnastic feats of cavorting cockroaches.)