Page 1 Group: John Hernandez, Nile Graham, and Richard Rifino Professor Cohen 30 Nov. 2010 Types of Software Bugs One of a programmer’s nightmares is for there to b e a software bug in the program or database that he or she is working with. A software bug means that the programmer made a mistake at some point in their source code, and that their program has either crashed or behaved in a way that the programmer did not want. There are various types of software bugs, and each one is related to a certain type of problem made in the program’s or database’s source code. The types of software bugs are Arithmetic Bugs, Logic Bugs, Syntax Bugs, Resource Bugs, Multi-Threading Programming Bugs, and Teamworking Bugs. Arithmetic and Syntax Bugs are similar in the ways that they deal with logical reasoning. Arithmetic Bugs occur when there is a division by zero, arithmetic precision is lost by rounding, or when there is a numerically unstable algorithm. These are things that do not make sense in mathematical calculations on paper and in logic as much as they are wrong in the computer’s language. In addition, Syntax Bugs occur when a programmer accidentally inputs a wrong operator. For example, if a programmer uses the assignment operator “=” instead of the comparison operator “==” when saying that the word “one” is equal to the number 1. Another software bug, Logic Bugs cause infinite loops and errors in loops that return a value that is either one too many or one too little of the expected/desired value. This happens when a programmer does not give the program a way of leaving the loop that it has created, or forgets that the computer starts at the number 0 rather then 1 when iterating through the loop.
Page 2 Also, Resource Bugs occur when there is an uninitialized variable, the use of an instruction with the wrong data type, or buffer overflow. Uninitialized v ariables happen when a programmer uses a variable in their source code that is not introduced before it is used. Also, sometimes programmers use a function that is not compatible with the data that they are working with, for example, a programmer can not slice a string data type if they are using Python. Finally, buffer overflow happens when a programmer tries to store more data then is allowed by available memory. Finally, a programmer can accidentally create a deadlock in which two items are waiting for the other to finish, so neither ever do, or the programmer can create comments that are out of date or not related to the program, or create a difference between documentation and what the program actually is. These are known as Multi-Threading Programming Bugs and Teamworking Bugs. All in all, software bugs occur only when a programmer makes a mistake, and the only sure way to get rid of the bugs is to go through the program, find the mistake, and fix it. This process is known as debugging, and it can be very difficult to do, especially when there are hundreds of lines of source code. A bug can be as small as a wrong letter in a variable, or as big as a loop that iterates through unintended data. So, a programmer has to be both a creator and an exterminator.