Debugging

Types of Bugs

  1. Define syntax and semantic errors.
  2. Compare and contrast syntax errors and semantic errors.
  3. Give examples of syntax errors and semantic errors in Python.
  4. Given a bug in Python code, identify whether it is a syntax error or a semantic error.

The Process of Debugging

  1. State the 4 main stages involved in debugging.
  2. Describe the sort of actions that can be taken during the stages of debugging.

Debugging Tools in Python

  1. Use the ipd module for debugging.
  2. Use ipdb.pm() for an immediate debugging post mortem.
  3. Use ipdb.set_trace() to set debugging break points in Python code.
  4. State the 4 main commands that are used after a call to ipdb.pm() or ipdb.set_trace() to step through code.
  5. Interactively inspect the values in variables while debugging.