Nepedia
Back to Discover
Advanced Reader
💻

Software bug

technology Maturity 11-13 war conflict Next article →

This article covers sensitive topics: war_conflict. Parents can manage visibility in Parental Controls.

A software bug is a defect within a computer program. These defects can range from minor issues to severe failures. A minor bug might be a simple misspelling in a user interface. A severe bug can cause a program to crash or fail entirely. Because these errors are so common, they have significant real-world impacts. A 2002 study by the National Institute of Standards and Technology found that software bugs cost the US economy approximately $59 billion annually. This amount represents about 0.6 percent of the United States' gross domestic product.

Software bug displayed on two screens at La Croix de Berny station in France - 2021-10-28
Software bug displayed on two screens at La Croix de Berny station in France - 2021-10-28

Understanding how a bug occurs requires looking at the software development lifecycle. A mistake might be made by an analyst during the very early stages of planning. If this mistake is not caught, it can evolve into a defect in the final version of the software. This process is known as mistake metamorphism. Throughout the development cycle, these issues can be called many things. They might be described as an anomaly, a fault, a failure, or an exception. In some cases, they lead to a crash, a glitch, or a side effect.

Software bugs can lead to serious and even tragic consequences. In the 1980s, bugs in the Therac-25 radiation therapy machine were directly responsible for patient deaths. In 1996, the European Space Agency lost a US$1 billion prototype of the Ariane 5 rocket. The rocket was destroyed less than a minute after launch due to a bug in its guidance computer. Additionally, an RAF Chinook helicopter crashed in 1994, killing 29 people. While it was first blamed on pilot error, it was later thought to be caused by a bug in the engine-control computer. These examples show how critical software reliability is to safety.

There is a debate regarding the term "bug" itself. Some experts argue the word should be replaced with "defect." They believe "bug" implies the error happened on its own. They argue "defect" more clearly shows that a human caused the mistake. Others suggest the term can be used to hide intentional design decisions. For instance, in 2011, Apple called a location-tracking behavior a bug. However, some critics challenged this, stating that the company was actually tracking users.

Developers use many techniques to prevent and find bugs. Modern programming languages are often designed to avoid the vulnerabilities found in older languages like BASIC or C. For example, newer languages like C# and Rust use lessons from the past to improve safety. A compiled language can detect typos, such as a misspelled identifier, before the program actually runs. This is different from an interpreted language, where the error might not appear until the code is executed during runtime. Some languages even remove complex features to ensure the code remains simple and correct. Java, for example, does not support pointer arithmetic to prevent memory corruption.

When bugs do occur, programmers must use debugging to fix them. The first step is usually to reproduce the bug reliably. If a programmer cannot make the error happen again, they cannot find the cause. Some bugs are called "heisenbugs" because they seem to disappear when you try to study them. To help, programmers use a debugger, which is a program that examines the inner workings of another program. A debugger allows a person to execute code line-by-line and view variable values. Another method is instrumentation, where logic is added to the code to output information during execution.

Managing bugs is a structured process often involving many people. When a bug is found, it is documented and categorized. Teams often perform a process called triage to decide which bugs to fix first. During triage, managers look at the severity and priority of each issue. Severity measures the impact of the bug, such as data loss or a system crash. Priority determines how quickly the bug must be resolved based on schedules.

Classpath bugs
Classpath bugs

Different development philosophies also impact how bugs are handled. Agile development involves frequent software releases with small changes. In this method, defects are often revealed through user feedback. Another approach is test-driven development, or TDD, where unit tests are written while the code is being created. Some people believe in the power of open-source software to reduce bugs. This idea, known as Linus's law, suggests that having many people examine the code makes bugs easier to find. However, others argue that complex, undocumented code can still hide vulnerabilities even when many people are looking at it.

746 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
File:Software bug displayed on two screens at La Croix de Berny station in France - 2021-10-28.jpg
Software bug displayed on two screens at...
File:Classpath bugs.png
Classpath bugs.png
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.