Rules of Debugging

  1. A computer always does exactly what you tell it to.
  2. You probably have not found a bug in the compiler or language
  3. If your program is doing something unexpected, check your values (output them) throughout your program.
  4. GIGO: Garbage In, Garbage Out. If your output is not what you expect, for the program as a whole or for any part of the program, check your inputs.
  5. Manuals don't do you any good if you don't read them.
  6. Knowing what the program does isn't good enough. You must also be able to state what it should be doing, but isn't.
  7. If you are absolutely sure that there is only one way to do what you want, there is undoubtedly a much better way to do it.
  8. If your program isn't working correctly, you are doing something wrong. You cannot fix it by continuing to do the same thing.
  9. One of the best debugging tools is pencil and paper.

Other debugging links:

http://geekswithblogs.net/sbargelt/archive/2005/05/14/39687.aspx
http://www.debuggingrules.com/Debugging_resources.html