Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.03 KB

debugging.md

File metadata and controls

38 lines (27 loc) · 1.03 KB

Debugging

Debugging your code is a skill of its own. Here is a list of debugging techniques that you might want to try:

Easy Bugs

  • read the code
  • read the error message
  • inspect variables with print(x)
  • inspect the type of variables with print(type(x))

Difficult Bugs

  • take a break
  • reproduce the bug
  • reproduce the bug with minimal input data
  • drop assertions in your code
  • clean up your code
  • write more tests
  • explain the problem to someone else
  • step through the code in an interactive debugger
  • google the error message

Very Difficult Bugs

  • sleep over it
  • ask for a code review
  • write down what the problem is
  • draw a formal description of your program logic (flowchart, state diagram
  • draw a formal description of your data structure (class diagram, ER-diagram)
  • background reading on the library / algorithm you are implementing

Also see: