Follow mowebtech on Twitter

Wednesday, 16 January 2013

Types of Programming Error

Logic Error
This is perhaps the most serious of all errors. When a written program in any language compiles and runs properly only to provide incorrect output, the flaw lies in the underlying programming logic. It's an error which has been inherited from a flaw in the base algorithm. The very logic on which the entire program is based is flawed, in such a case. These types of errors need a fundamental change in your approach to find a solution. You need to start digging at the algorithmic level to narrow down to the cause of such an error.

Syntax Error
 Every computer language like C, Java, Perl and Python has a specific syntax in which code needs to be written. When a programmer doesn't adhere to the 'grammar' specifications of a computer language, a syntax error results. These kinds of errors are easily rectified during the compilation phase.

Compilation Error
Compilation is the process where a program written in a high level language is converted to machine readable form. Many types of errors can occur during this phase, including syntax errors. Sometimes, the syntax of a source code might be flawless, but a compilation error might still occur. This may be due to a problem in the compiler itself. These errors are rectifiable in the development phase.

Run Time Error
The program code has compiled successfully and an executable file has been created. You breathe a sigh of relief and run the program to test its working to find an error. This is a 'Run Time Error'. These may result from the failure on part of the developer to anticipate actual program deployment conditions. These can be rectified by going back to the coding phase.

Arithmetic Error
Many programs use numerical variables and the algorithm may involve several mathematical calculations. Arithmetic errors crop up when the computer cannot handle problems like 'Division By Zero' leading to an infinite result. This is again a logical error which can only be corrected by changing the algorithm.

Resource Errors
When the value of a variable overflows its maximum allowed value, a resource error may result. Buffer overflow, usage of an uninitialized variable, access violations and stack overflows are examples of some common errors.

Interfacing Error
These may arise due to mismatch of a software program with the hardware interface or application programming interface used. In case of web applications, an interface error may result from incorrect use of a web protocol.

No comments:

Post a Comment