- Make sure you know exactly what data or outcome is wrong
- Make sure you can make that happen on demand
2. Methodically print out (or otherwise inspect) the relevant data at each step going backwards from where the error is
- Keep doing this until you reach a point where the data matches your expectations