Skip to content

Debugging

General approach to debugging

  • DBG-1 Have you set a maximum time for quick and dirty debugging?
  • DBG-2 Do you research an issue to ensure an easy answer is not readily available?
  • DBG-3 Do you use all available debugging tools? (e.g., warning messages, execution tracing and profiling, scaffolding, interactive debugging, etc.)
  • DBG-4 Do you assume that errors are your fault?
  • DBG-5 Do you avoid the trial-and-error, superstitious approach to debugging?
  • DBG-6 Do you use several different techniques to find errors and alternate approaches?
  • DBG-7 Do you get help when appropriate?
  • DBG-8 If an issue appears that it will take longer to identify or fix than initially thought, do you notify project management as appropriate?
  • DBG-9 Do you move on when appropriate?
  • DBG-10 Do you verify that the fix is correct?
  • DBG-11 Do you use debugging as an opportunity to learn?

Techniques for Finding Errors. Have you tried to

  • DBG-12 ... Use all the data available to form a hypothesis?
  • DBG-13 ... Refine the test cases that produce the error?
  • DBG-14 ... Reproduce the error several different ways?
  • DBG-15 ... Generate more data to generate more hypotheses?
  • DBG-16 ... Use results of negative tests?
  • DBG-17 ... Brainstorm for possible hypotheses?
  • DBG-18 ... Narrow the suspicious region of the code?
  • DBG-19 ... Check code that's changed recently?
  • DBG-20 ... Expand the suspicious region of the code?
  • DBG-21 ... Integrate incrementally?
  • DBG-22 ... Be suspicious of routines that have had errors before?
  • DBG-23 ... Use brute force?
  • DBG-24 ... Check for common errors?
  • DBG-25 ... Use confessional debugging?
  • DBG-26 ... Take a break from the problem?

Techniques for Fixing Errors. Have you tried to

  • DBG-27 ... Understand the problem?
  • DBG-28 ... Check your work?
  • DBG-29 …Verify that the fix is correct?
  • DBG-30 ... Relax?
  • DBG-31 ... Confirm the error diagnosis?
  • DBG-32 ... Save the original source code?
  • DBG-33 ... Fix the problem, not the symptom?
  • DBG-34 ... Change the code only for good reason?
  • DBG-35 ... Understand the program as well as the problem?
  • DBG-36 ... Make one change at a time?
  • DBG-37 ... Look for similar errors?
  • DBG-38 ... Have a break?