DEV Community

Discussion on: What is your debugging approach?

Collapse
 
mikestaub profile image
Mike Staub • Edited
  1. Fully understand the bug by describing it as simply as I can. Imagine you are trying to report it on github.
  2. Ask myself what I expected to happen, what actually happened, and what assumptions I hold that make me feels entitled to the expected result. I list these assumptions out. ( rubber duck method )
  3. I go through the list of assumptions and order them by what I think are the least likely to be invalid first.
  4. I walk down the list and verify all the assumptions are actually true. Usually, it is here that I find the 'invalid assumption'. ( here is where we actually use the debugging tools )
  5. If all my assumptions hold, then it simply means I don't understand the system deeply enough and I need to go back to step 3.