In computing, a bug refers to an error, flaw, or fault in a computer program that causes it to produce incorrect or unexpected results. The term originated from actual insects causing malfunctions in early electromechanical computers but now refers to any software defect.