10  Bug Recipes

A bug recipe provides distilled knowledge about likely causes of bugs that manifest with particular symptoms. The knowledge will typically be distilled by reflecting on one or more instances of the bug, as recorded in your bug log. We’ll start you out with one bug recipe for NoneType bugs. Then, copy this Jupyter notebook and use the template below to build your own collection.

10.1 NoneType Bugs

Field Description
Symptoms Runtime error with message that mentions NoneType object
Potential Proximal Causes data fault: a data object that I expect to have some other value has the value None.
Potential Root Causes - The data object is the result of a function call that failed to return a value.
- A function has an optional parameter with a default value of None and was invoked without a value for that parameter.
Potential Fixes - Add the missing return statement to the function.
- Provide a value for the optional parameter.
- Make the code work gracefully with None values.

10.2 Bug recipe template

Field Description
Symptoms Fill this in.
Potential Proximal Causes Fill this in.
Potential Root Causes Fill this in.
Potential Fixes Fill this in.