In engineering, a bug is a design defect in an engineered system—such as software, computer hardware, electronics, circuitry or machinery—that causes an undesired result. Defects outside the scope of design, such as a server crash due to a natural disaster, are not bugs, nor do bugs occur in natural systems such as the weather.
Bug is a non-technical term; more formal terms, besides defect, are error, flaw, and fault. Bugs may be persistent, sporadic, intermittent, or transient; in computing, crashes, freezes, and glitches are types of bugs.