What do the bugs mean?
Tags: bug, testing, qa, programming
Published: 2024-05-31 09:05:53

## Introduction 

Bugs are often defined as the resulting undesired behavior—coming from the developer's mistake—in the code. Bugs are, of course, a very human-made thing. This article contextualizes the entire historical background around the word "bug," from Thomas Edison to the famous incident with a moth by Grace Hopper. It goes even further to speak of the significant consequences of software errors: economic losses, and critical failures within various industries. This serves to sharpen the point that human errors in software development should be tested for these consequences to be reduced.

## The origin of termin
The simplest answer to this question most common amongst developers is *‘bug is some undesired behavior caused by mistake in the code’*. In general, this is a right answer that does not conflict with the true meaning of bug definition. But let’s look at how dictionaries define the bug.

> **Webster**: an unexpected defect, fault, flaw, or imperfection.
**Cambridge**: a mistake or problem in a computer program.
**Oxford**: with the sense ‘of or relating to errors or other causes of malfunction in a computer program’.

However, those definitions do not highlight a very important detail that the bug is always caused by **humans**. For instance, if a user splits a coffee on his laptop and it stops working - this is not a bug. However, if the laptop stops working, because voltage regulator modules send 2 V on cpu instead of 1.4 V - this is the bug. With keeping this in the mind let's expand the definition of the bug:

> A bug is a flaw, failure, error, or fault in computer software or system, **caused by humans**, that leads to unexpected or incorrect results,  or to behave in unintended ways.

I don't just want to draw attention to the human factor for no reason, but because in the next articles we will see that all ways to reduce the number of bugs should be aimed precisely at combating the human factor. But for now, let's trace the history of the bug.
In the IT, there is an opinion that the concept of a bug started to be used after a real insect got stuck in the computer relay.

> In 1946, when *Hopper* was released from active duty, she joined the Harvard Faculty at the Computation Laboratory where she continued her work on the *Mark II* and *Mark III*. She traced an error in the *Mark II* to a moth trapped in a relay, coining the term bug. This bug was carefully removed and taped to the log book. Stemming from the first bug, today we call errors or glitch's in a program a bug.    
>*"Danis, Sharron Ann: "Rear Admiral Grace Murray Hopper"". ei.cs.vt.edu. February 16, 1997. Retrieved January 31, 2010.*

![Photo of the origin entry log in journal with the taped moth](https://shorturl.at/Abj8S)
Picture 1 - Photo of the origin entry log in journal with the taped moth.    
**Disclaimer**. I want to note in advance that a good historical analysis was done by *Peggy A. Kidwell*, and my favorite work is the article 'Stalking the Elusive Computer Bug' published in 1998 in the IEEE Annals of the History of Computing. If you are interested in delving deeper into this issue, I recommend referring to this article, as well as to the works of his. Below, I will provide only a brief overview of this article with some additional illustrations.

A funny fact, but in the 1945 edition of the Oxford dictionary, you can find a definition for "**debugging**," but not for "**bug**." What does all this mean? The story about the moth is essentially true, however, the entry in the journal dates back to 1947, not 1946. So, in the early days of programming, among Harvard staff, the term "**bugs**" was used before the story with the Mark computer. It turns out they adapted the terms "**bug**," "**debug**," and "**debugging**" from technical slang prevalent in the USA.

The word "**bug**" and its relation to technology, or more particularly to computers, in reality, dates back to the time of Thomas Edison. He wrote the first documented use of the term "**bug**" in a letter describing problems he is having with his phonograph:
> "It has been just so in all of my inventions. The first step is an intuition—and comes with a burst, then difficulties arise—this thing gives out and then that—'Bugs'—as such little faults and difficulties are called."

These problems are the kinds one of the U.S. engineers had long held to have been called about quite a while ago. This became popular because the term is short, and means the flaw is small and manageable. This conceptual history of the terminology is well-traced in sources ranging from dictionaries to anecdotes.    
**1924**: In a comic strip from a 1924 telephone industry journal, a naive character learns that a man works as a "bug hunter" and gives him a backscratcher. The man explains that "bug hunter" is just a nickname for a repairman.    

**1931**: The first mechanical pinball game, Baffle Ball, was marketed as being "free of bugs."     
**1940**: The term bug is used to describe a defect in direction-finding equipment in the film Flight Command.    
**1942**: In a book, Louise Dickinson Rich refers to an ice cutting machine needing the "bugs" removed before it could resume operation.    
**1944**: Isaac Asimov refers to bugs as issues with a robot in his short story "Catch That Rabbit."    
The lexicon of computer science grew increasingly formal, arguably from the 1950s and certainly from the 1961's, as the Association for Computing Machinery (ACM) and other professional groups started publishing standardized glossaries. By the early 1960s, terms like "**bug**" and "**debug**" were used in mainstream language. As computing technology advanced, it also became widely used in the popular press and in everyday language. For instance, "Grin and Bear It" contained jokes about "computer bugs". Advertisements for services of various kinds assured the consumer with such slogans as "We'll Get the Bugs Out."

## The cost of bugs
It seems that computer bugs are like small, innocent pranks that prevent the engineering system from working at full capacity. But are they really that harmless?

In 2002, software bugs cost the United States economy approximately $59.5 billion, which is a small figure considering the overall GDP of the USA. However, with the growth of digital services, the cost of bugs for the economy has grown proportionally. According to research by Tricentis, in 2016, software failures in the US cost the economy $1.1 trillion in assets. In total, software failures at 363 companies affected 4.4 billion customers and caused more than three and a half years of lost time. Since 2016, the damage to GDP has grown by almost one and a half times, and it is now estimated at 7% of the US GDP.

![Cost of software bugs on the USA economic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qinvol2ll0zh86dahju.png)
Picture 2 - Cost of software bugs on the USA economic

We've all heard about the famous Y2K bug, but do you know how much it cost the economy? To address the potential fallout, organizations globally invested heavily in Y2K remediation efforts. The total cost of these preventive measures is estimated to have ranged between $300 billion and $600 billion. This expenditure was incurred by governments, businesses, and other entities to update software, replace hardware, and implement extensive testing and contingency plans. Significant financial resources were allocated to ensure critical systems would transition smoothly into the new millennium. Governments, especially in developed countries, undertook extensive campaigns to prepare public services and infrastructure. Businesses, particularly those in finance, utilities, and transportation, conducted exhaustive checks and upgrades to mitigate the risks.

But even with such investments to fix this bug, minor problems were still recorded:

- The US official timekeeper, the Naval Observatory, reported the date as 19100 on its website.
- In Japan, the system collecting flight information for small planes failed.
- In Australia, bus ticket validation machines failed.
- In the US, over 150 slot machines at race tracks in Delaware failed.
- In Spain, a worker was summoned to an industrial tribunal on February 3, 1900.
- In South Korea, a district court summoned 170 people to court on January 4, 1900.
- In Italy, Telecom Italia sent out bills for the first two months of 1900.
- In the UK, some credit card transactions failed.

Bugs are expensive, but they also lead to not just financial losses, but far more serious consequences.

### Intellectual Damage, which hampers the development of humanity
**1962**: NASA’s Mariner 1 Incident: In one of the earliest and most expensive software errors, NASA's Mariner 1 spacecraft, aimed at Venus, veered off course due to a missing hyphen in the code. This led to the spacecraft being destroyed shortly after launch, costing NASA $18 million. This incident underscored the critical need for meticulous coding and testing in software development.    
**1996**: Ariane 5 Rocket Failure: A software error in the Ariane 5 rocket caused it to deviate from its path and self-destruct 37 seconds after launch. The problem stemmed from code reused from the Ariane 4, which was not compatible with the new rocket's flight conditions. The failure resulted in a loss of over $370 million, underscoring the critical need for software adaptation and testing in space missions.     
**1999**: Mars Climate Orbiter Loss: NASA's Mars Climate Orbiter disintegrated upon arrival at Mars due to a software error involving unit conversion from English to metric measurements. The $327 million mission failure highlighted the importance of consistency and precision in software used for interplanetary exploration.
### Political Damage (which almost triggered a war between nuclear powers):    
**1980**: NORAD False Missile Alert: A software error caused NORAD to report a false missile attack on the United States. The mistake was due to a faulty circuit that the software did not account for, nearly triggering a nuclear response. This event highlighted the severe implications of software errors in military and defense systems.     
**1983**: Soviet False Missile Alert: A Soviet satellite falsely reported incoming US missiles, almost leading to a nuclear counterstrike. The officer on duty trusted his instincts and chose not to react, preventing a potential disaster. This incident again emphasized the dire consequences of software errors in critical systems.
### Environmental Damage (which also showed that bugs could be used as weapons):
**1982**: Siberian Gas Pipeline Explosion: In a Cold War incident, the CIA allegedly inserted faulty software into a Soviet gas pipeline control system, leading to an explosion visible from space. While the precise cost remains undisclosed, this event is remembered as one of the most monumental non-nuclear explosions, illustrating the destructive potential of intentional software bugs.
### Bugs can also claim lives:
**1985-1987**: Therac-25 Radiation Overdoses: A software bug in the Therac-25 radiation therapy machine resulted in patients receiving massive overdoses of radiation, causing several deaths and serious injuries. This tragic case demonstrated the fatal risks associated with software failures in medical devices and the essential need for rigorous testing and validation in healthcare technology.    
**1994**: RAF Chinook Helicopter Crash: A software fault in the flight control system caused a Chinook helicopter to crash in Scotland, killing all 29 passengers. Initially blamed on pilot error, later investigations revealed the software glitch as the true cause, stressing the importance of reliable software in aviation safety.     
**2000**: Panama City Radiation Overdoses: Faulty therapy planning software from Multidata caused radiation overdoses in patients, resulting in several deaths. This incident reiterated the deadly risks of software errors in medical applications and the crucial need for stringent testing protocols.