Debugging
Generally speaking, the cycle for debugging problems has the following steps:
- Detecting the problem. A new problem or defect is discovered
- Analyzing and assigning priority to this problem, to be sure that we spend time on meaningful problems and focus on the most important ones
- Investigating what exactly causes the problem. Ideally, this should end with a way of replicating the problem in a local environment
- Replicating the problem locally, and getting into the specific details on why it happens
- Fixing the problem
As you can see, the general strategy is to first locate and understand the problem, so we can then properly debug and fix it.
In this chapter, we'll cover the following topics to see effective techniques on how to work through all those phases:
- Detecting and processing defects
- Investigation in production
- Understanding the problem in production
- Local debugging
- Python introspection...