What Are the Three Main Types of Bugs?
The three major types of bugs are typographic errors (typos), syntax errors, and algorithmic errors. This Tech Note will not address algorithmic errors in detail, due to the individuality of each algorithm. The definitions of each type of bug are as follows: • A typo, or typographic error, is a simple typing error. If it occurs while you are typing a function name, it can be easy to find — but if you mistype a variable name, it can lead to unexpected results that can be extremely difficult to track down and eliminate. For example, typing cod(pi) when you meant to type cos(pi) will return an error message that is easy to understand: ??? Undefined function or variable ‘cod’. However, if you type x=cos(y); when you meant to type x=cos(t); and t is a different size than y, you will likely receive an error message about the size of the array when you try to manipulate it later in your code, long after the assignment statement has been executed. Tracing the error back to this line may be di