# Bug
A flaw, error, or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.
**Pronunciation:** /bʌɡ/
**Difficulty:** Beginner
**Synonyms:** Defect, Flaw, Error, Fault, Issue, Glitch
**Categories:** Software Development, Quality Assurance, Computer Science
**Tags:** Error, Defect, Flaw, Debugging, Software Quality
Canonical: https://scaleengineer.com/glossaries/bug
---
## Definitions

- **Bug in Software Development:** In the context of software development, a **bug** is an error, flaw, or fault in the design, development, or operation of computer software that causes it to produce an incorrect or unexpected result, or to behave in unintended ways. It is a deviation from the expected behavior.

### Key Concepts
*   **Bug Lifecycle**: The process a bug goes through from when it's first reported until it's resolved. This typically includes states like: New, Assigned, Open, Fixed, Pending Retest, Retest, Verified, Closed, Reopened.
*   **Severity vs. Priority**: **Severity** measures the impact of the bug on the system (e.g., Blocker, Critical, Major, Minor, Trivial). **Priority** determines how soon the bug needs to be fixed (e.g., High, Medium, Low). A high-severity bug might have a low priority if it affects a rarely used feature.
*   **Bug Report**: A detailed document that describes the bug, including steps to reproduce it, the actual result, the expected result, environment details (OS, browser), and screenshots or logs.

### Examples
*   A calculation error in a financial application.
*   A button that does nothing when clicked.
*   A security vulnerability that allows unauthorized access.
*   A memory leak that causes the application to slow down and eventually crash.

In this context, **defect**, **issue**, and **fault** are often used interchangeably with bug.

## Etymology

The term "bug" was popularized by computer pioneer Grace Hopper. In 1947, her associates discovered a moth stuck in a relay of the Harvard Mark II computer, which was causing errors. They removed the moth and taped it into the logbook, with the caption "First actual case of bug being found." The term "bug" to describe a technical problem had been in use in engineering since the 19th century, but this event cemented its use in the computing world.

## First used

1947

## Historical context

The term **bug** to describe a flaw has roots in 19th-century engineering terminology. Thomas Edison used it in his notes in the 1870s to refer to problems with his inventions.

Its specific application to computing was famously documented on September 9, 1947. Technicians, including Grace Hopper, working on the Harvard Mark II computer found a moth trapped between the points of a relay, which was causing the machine to malfunction. They removed the insect and taped it into their logbook, with the annotation: "First actual case of bug being found." This event is widely credited with popularizing the term **bug** and its derivative, **debugging**, within the field of computing.

As software grew in complexity through the 1960s and 1970s, bugs evolved from physical hardware obstructions to complex logical errors in code. This shift necessitated the development of formal software engineering and quality assurance disciplines. With the personal computer boom in the 1980s and the rise of the internet, the impact of software bugs became more widespread, leading to the creation of sophisticated bug tracking systems (like Bugzilla and Jira), automated testing frameworks, and dedicated QA teams to manage and mitigate these **defects** throughout the software development lifecycle.

## Q&A

- **What is the difference between bug severity and bug priority?:** Severity describes the impact of the bug on the application's functionality (e.g., a crash is high severity), while priority describes the urgency of fixing the bug from a business or project perspective (e.g., a typo on the homepage might be low severity but high priority).
- **Who is famously associated with popularizing the term 'bug' in computing?:** Grace Hopper, after her team found a moth stuck in a relay of the Harvard Mark II computer in 1947.
- **What is the primary purpose of a bug report?:** The primary purpose of a bug report is to provide a developer with all the necessary information to reproduce, understand, and fix the bug. This includes steps to reproduce, expected vs. actual results, and environment details.

## Usage examples

- The QA team found a critical **bug** in the checkout process that was preventing users from completing their purchases.
- I spent all day debugging to find the source of that memory leak; it turned out to be a nasty **flaw** in a third-party library.
- We need to raise the priority of this **issue**; it's a blocker for the upcoming release.
- The latest software update introduced a new **defect**, causing the application to crash on startup for some users.

## Related terms

- Debugging
- Software Testing
- Quality Assurance (QA)
- Patch
- Hotfix
- Regression

## Popular related terms

- Debugging
- Glitch
- Error
- Software Development Lifecycle (SDLC)
