Did you ever had a bug in your code, you could not resolve? I hope I’m not the only one out there, who made this experience …
There exist some classes of bugs, that are very hard to track down:
- timing-related bugs (that occur during inter-process-communication for example)
- memory-related bugs (most of you know appropriate examples, I guess !!!)
- event-related bugs (hard to debug, because every break point you run into makes your IDE the target for mouse release/focus events …)
- OS-dependent bugs
- hardware dependent bugs (occurs on release machine, but not on developer machine)
- …
To be honest, from time to time I fail to fix such a bug on my own … After debugging for hours (or sometimes even days) I feel very demoralized.
What do you do in this situation (apart from asking others for help which is not always possible)?
Do you
- use pencil and paper instead of a debugger
- face for another thing and return to this bug later
- …
Please let me know!
Some things that help:
1) Take a break, approach the bug from a different angle.
2) Get more aggressive with tracing and logging.
3) Have another pair of eyes look at it.
4) A usual last resort is to figure out a way to make the bug irrelevant by changing the fundamental conditions in which it occurs
5) Smash and break things. (Stress relief only!)