What is a bug, why does it happen, how to avoid it and the most known mistakes – WAU
What is a bug? The concept can be understood as an “unexpected error”. However, the origin of this word goes back to World War I and ended up becoming a great curiosity that is part of the history of programming – and with female protagonism.
Today we understand what a bug is as an unexpected error when running a program. However, its history is much more linked to hardware than to software.
Before telling how it all started, you need to know two things: the first is that the bug is an English word that means insect and the second is that the first computers in the world were not PCs – personal computers.
This means that machines at the time of World War I occupied the space of a university classroom – for our bug story, the class was at Harvard. It was there that the Mark I was developed and allocated, being the first programmable mainframe in the world, used by the United States Navy.
A renowned computer scientist, Grace Hopper, was responsible for the Mark I, having worked in the leadership of the programming team that developed it. After days of dealing with miscalculations, the team no longer knew what to do to repair the errors. It was then that Grace found among the pieces and threads of Mark I a dead moth.
The scientist collected the body of the insect, taking it to her room and registering on September 9, 1944 the first case of a bug. Currently, our computers are already much smaller and problems with moths no longer affect us, but that doesn’t mean that the bugs are gone.
Here, you will learn:
Bug working opportunities
Did you know that many companies offer buggy work? We can call it “insect hunting” and it is a job opportunity for many people, who are paid to find the bugs before their real customers or consumer personas.
With bug reports, programmers are able to fix them before release – although some still manage to escape. The main point of this test phase is avoid losses in sales and negative impacts to the developer and software brand. In addition, security flaws are corrected, avoiding exposure of sensitive information.
Bug bounties can work for several types of companies, such as Netflix, Microsoft, Google, Samsung and others. There are two moments when this happens: in the alpha and beta tests.
Below, we explain better about each one.
At alpha versions are the first to be tested. sThey are so called because their testing takes place on the development platform itself and by primary users.
These users are nothing more than the employees of the development company, but not the same ones who work on the application’s programming.
After this step, comes the beta.
The beta test version is aimed at real users of the program, that is, we consumers who buy the final product.
In this type of test, there is a brief season of free registration for people to participate in the assessment. This group is considered lucky by many, as they end up knowing the software well before the general public.
Reasons for bugs to happen
As we said, today we know what bugs are the most because they hinder the use of intelligent applications and programs.
That is, they are errors that happen in programmable lines of code to develop the software we use. So, that means that can the programmer himself avoid them?
Not quite, although research tells us that programmers do spend more time fixing bugs than they do programming. Software usually has hundreds of lines of code, each of which generates one or more commands that will be activated when we, the users, interact with the application.
So, some bugs can occur because of the change between environments – where it was made and where it is installed.
Bugs can also occur as amount of commands sent, which overlaps with its processing capacity and ends up generating a failure, the program closes on its own or is inert.
The fact is that avoiding a bug is very difficult, because in addition to the variables that the programmer does not control, there are errors that every human being is likely to make.
You may also be interested in these other content!
What is 504 gateway timeout and how to resolve it permanently!
Logic behind the bug
To put it simply, let’s think about a computer game. For it to work well, several teams of programmers worked in blocks.
The menu was developed separately from the scenario items, for example, with each function within the game being a variable code. Then, any interaction will be a command for the software to execute.
Say you want to move forward with your game character, using your keyboard or mouse to move around.
But what if you want to jump while walking? This can happen in two ways:
- your character will continue to move forward, jump and walk forward again;
- your character stops walking, jumps and stands still.
Remember that we said that the programming teams usually work separately, and develop each isolated part? Well, in case number 1, we have a great example of when the programming team is well engaged and has efficient communication, because your character did all the commands that were requested.
However, notice that in case number 2 the character interrupted the walk command to execute the jump command, right? The problem here is the lack of integration between the different commands, in which the software understands that there is no continuity but only triggers. That is, if the right trigger is triggered, it works, if it is not the right trigger, nothing is done.
Then, you would need to use the mouse or keyboard to trigger the walk command again and then move on with the character.
As we said, if the team is well connected and communicates efficiently, the bugs decrease.
However, these are not the only reasons: programming logic is the other reason behind what is bug.
This means that the programming commands – the variables if , else and then they are examples – they respect a logic of mathematical and rational thought. The programmer needs to describe the complete logic for the command to be executed as imagined.
In the second example, where the character doesn’t walk when jumping, the code may have been formatted like this:
- if Up arrow then walk;
- if space then jump.
Then, the software understands “if” the up arrow is triggered “then” the character walks. Like, “if” the space is triggered “then” the character jumps. For it to do both functions at the same time, it could be done like this:
- if Up arrow then walk;
- if space then jump;
- if up arrow and space else walk and jump.
Realize that just adding a third command that joins both actions would solve this specific bug. This third line shows other (else) command path for the software to run, showing that he can do both actions together.
Ways to reduce bugs
There are some techniques that can help to reduce the occurrence of bugs in systems. Some we have already mentioned, but they refer to the moment of developing software: integrated communication between the teams of programmers and dynamic workflow, but that allows registration of the information exchanged.
SWOT Analysis can be a great option when creating these projects. Thus, any team involved in the process can follow what needs to be done, corrected or monitored.
When it comes to us, simple users, the tips are different. See more below!
Do not overload
To avoid problems with bugs in the software, it is good not to overload the processing with excessive unnecessary commands.
Did you know that multiple clicks will not unlock your computer? On the contrary, you are overloading its processing capacity with useless commands.
The key here is to take a deep breath and wait. If it doesn’t, restarting your device is the option.
Above, we said that different programs can conflict with each other, as they have hundreds of command lines and one variable can “run over” the other. A good way to avoid bugs when running software is to avoid system conflicts.
Here you need to understand at least the purpose of the programs you are using and avoid running those that are similar.
Because it is possible that they use the same files and commands when communicating with Windows or iOS. For example, operating system firewall and an online game or program that uses the Internet.
The firewall’s function is to block improper entries and exits on your web connection, just what your game or program is trying to do and that’s why it was blocked.
Known bugs in history
Now that you understand what a bug is, can you imagine which were the best known of humanity?
In addition to the moth on the Mark I, of course, the Millennium Bug is perhaps the most famous of them. In the past, programmers used only a couple of numbers to identify years, so 1980 was written only as 80.
The problem is that after the midnight turn of December 31, 1999, computers interpreted the 00 of 2000 as 1900. If you don’t remember, or are too young to know, panic started, mainly because of the belief that the world would end at the entrance of the new millennium. So, what was a bug became the prediction of the end of humanity.
Another known failure occurred in 1998, when a probe was sent to Mars. The developer was wrong in the units of measurement, using feet and miles instead of meters and kilometers – standard at NASA. The result was a collapse on Martian soil, losing thousands of dollars.
As you can see, bugs can be unpredictable, but there are some ways to get around the situation and avoid them.
Want to have a blog for your business, bug free? Check out our WordPress guide for corporate blogs now!
We are a family owned and operated business.