The software engineering approach of Structured Systems Analysis may be useful in this. Debugging is a process which involves locating and removing the errors. Syntax errors V.S Logic errors Syntax errors are caused by incorrect use of programming language and the compile can identify these syntax errors. So it s easy to remove. Logic errors means that the program can be compiled and the executable file is generated, but output of the program doesn t satisfy requirement specifications.
Logic errors are more difficult to be found and removed.
The aim of this step is to isolate the locations of the failures. If the program executes correctly until statement 1 and produces an incorrectly output in statement 2, it s obvious that the failure must be between statement 1 and statement 2. Then some methods, such as trace or a few output statements can be added at a point about the midway between statement 1 and statement 2. This process can be proceeded recursively until the failure is identified. In this approach, a series of structured questions are posed and answered to identify the failure.