The Art of Debugging

Credit to Remy Sharp

1 - Reproduce the Bug

  • When does it happen?
  • What actions does the user take?
  • How is the system configured?
  • What is the minimum set of steps?
  • Can we make it happen consistently?

2 - Find the Bug

  • Observe state and behavior
  • Use print statements, logger, or debugger
  • Narrow down scope
  • Identify specific methods and arguments/data
  • Verify via unit tests

3- Fix the Bug

  • Use unit tests to trigger problem
  • Carefully edit code to fix bug
  • Test fix
  • Perform regression tests
  • Look for any related issues
  • Commit and deploy fixed code
"/js/highlight.pack.js"