Introduction

There are a number of different kinds of bugs. Following are the three main types of bugs that get harder and harder to fix.

  1. Compile time errors — bugs caught by the compiler.
  2. Terminating Runtime errors — bugs caught by the runtime resulting in the termination of the program.
  3. Non-Terminating Runtime errors (Logic errors) — bugs that occur at the runtime, and are most often unwanted or unexpected results in response to user actions. Logic errors are generally the hardest to fix, since their origin is not always known.

Although in this lab, you will be learning how to debug your code using the Eclipse Debugger. Using it to find errors should only be done after you have done some "mental analysis" regarding what and where the errors could be. Whenever an error occurs in your code, you should first have a look at your code and think about how or why the error occurred. Most of the time, you will be able to locate the error just by carefully examining the syntax of your code, or reflecting on the logic you have applied. Hence, you should resort to a debugger only after you have done some thinking and examining your code manually and are still unable to locate the error.