The following guide was created as part of a teacher's assistant guide for Bowdoin College computer science TAs. These are good strategies about how to help a student debug their program.
THE DEBUGGING GUIDE
1. Ask the student what they have been trying
2. Have them walk through what is happening
3. Where do they think the bug is?
4. Why do they think its going wrong?
5. What does the error say?
6. What does the debugger say?
7. Did they use print statements? Have them add print statements to check where things are going wrong or find out why something is going wrong? Was it ok when it got here before it failed there?
8. Google the error. Stack overflow will have huge amounts of information on most things
9. Did they import/include everything they needed?
10. Are all their files present? Does the terminal look different than the editor?
11. Vim the file in the terminal and make sure it looks ok there.
12. Have other students in the room had this issue? How did they fix it?
13. Comment out sections of code and see how it runs without that section of code
14. Make sure they have allocated memory for things if that is necessary in this language
15. Look at stack call (list of methods called beforehand)
16. When was the last time the program ran? What have they changed since it worked last