-
Notifications
You must be signed in to change notification settings - Fork 0
11 03 16 exam post mortem, debugging
mona edited this page Nov 30, 2016
·
1 revision
Read "Head First" chapters 9-12.
- Overcome your belief that your code is right and computer is right
- Use a real debugger or assertion, not print!
The best case is that you find the bug in unit test and you know the bug manifest in that unit.
The worst case is that your customer detected the bug, that means you need to reproduce.
run code in the debugger which will automatically be triggered at the point of crash. Check belief.
start with breakpoint just before bug exhibited, then check beliefs. Narrow down where beliefs went wrong.
If you can find the earliest place your belief doesn't hold, that the bug may obvious. If not, trace back to determine how to got to that point.
- control branches
- function/method calls
- slices
Try to find the smallest set of wrong values.