The term "bug" was used in an account by computer pioneer Grace Hopper, who publicized the cause of a malfunction in an early electromechanical computer.
Hopper did not find the bug, as she readily acknowledged. The date in the log book was September 9, 1947. The operators who found it, including William "Bill" Burke, later of the Naval Weapons Laboratory, Dahlgren, Virginia, were familiar with the engineering term and amusedly kept the insect with the notation "First actual case of bug being found." Hopper loved to recount the story.
This log book, complete with attached moth, is part of the collection of the Smithsonian National Museum of American History.
@dgar I used to have a small portable punch to make changes in programs on tape. Might still have it somewhere....
I was musing by reading up on early computing machines and saw this just the other day, for the first time. What a coincidence.
When you think about it, "patch" isn't an obvious synonym for "fix" or "change." A patch on an inner tube doesn't undo the damage. It just compensates for it. So this origin makes sense.
At least it's post hoc. The IBM1130 system code was pre-assembled with deliberate gaps in it, called "patch areas," where you could tuck opcodes directly into the image.
@dgar I've done this. You rummage around in the bottom of the punch card machine and pick out a handful of chads. Them you stuff the chads into the punched columns you want unpunched. Then you copy that card carefully with the card copying button. You have to be careful, or the chads will fall out. Finally you put the copied card into the punch machine and punch the right holes. It works best when you are punching binary cards, not text cards.

