Debugging
Types of Bugs
- Define syntax and semantic errors.
- Compare and contrast syntax errors and semantic errors.
- Give examples of syntax errors and semantic errors in Python.
- Given a bug in Python code, identify whether it is a syntax error or a semantic error.
The Process of Debugging
- State the 4 main stages involved in debugging.
- Describe the sort of actions that can be taken during the stages of debugging.
- Use the
ipd
module for debugging.
- Use
ipdb.pm()
for an immediate debugging post mortem.
- Use
ipdb.set_trace()
to set debugging break points in Python code.
- State the 4 main commands that are used after a call to
ipdb.pm()
or ipdb.set_trace()
to step through code.
- Interactively inspect the values in variables while debugging.