A step-by-step guide to debugging.
1. Do some simple checks and see if it was something obvious.
2. Make a list of everywhere the problem could conceivably be.
3. The bug will be somewhere in the difference between that list and reality.
OK, that's an exaggeration, sometimes the bug is where it should be, but sometimes it really is a matter of "what unexamined assumptions have I made, and which is most likely to be wrong?"
1. Do some simple checks and see if it was something obvious.
2. Make a list of everywhere the problem could conceivably be.
3. The bug will be somewhere in the difference between that list and reality.
OK, that's an exaggeration, sometimes the bug is where it should be, but sometimes it really is a matter of "what unexamined assumptions have I made, and which is most likely to be wrong?"