CS-140 Debugging Guidelines
Sometimes you run into a problem in your code. Whether it breaks during runtime or compile time, please make sure to follow these steps before asking for help:
- Spend at least 10 minutes tryingto figure it out for yourself.
- Use the Eclipse debugger (if we have gotten to Eclipse)
- Set break points at interesting points in your code.
- Run under the debugger until you hit a breakpoint.
- When you hit a breakpoint look at the current value of variables to see if you can figure out what is going on.
- Don't forget to exit the debugger when you are done.
- Print debugger...
- Add print statements to your code to determine the control flow of your code and variable values.
- Run your code with these extra print statements to either figure out exactly what the problem is, or where you need more print statements to gather more information.
- Once you have figured out the problem, don't forget to remove all those print statements that you added.
- Research...
- If you are getting a specific error message from the compiler or run-time, try googling that message. It's amazing how often others on the web have solved the same problem you are facing.
- Check out StackOverflow to see if the question has been asked and answered there.
- Check on Piazza to see if any other students have run into the same problem and have found a solution.
- Post General Questions on Piazza
- Ask a general question and post on Piazza.
- Wait to see if any of your peers can help.
- Post a Private Question on Piazza
- Make sure the latest version of your code is pushed to gitHub
- Create a gitHub issue by filling in the issue form in the web browser.
- Post a link to your issue in Piazza directed to the Professor and TA's.
- We'll answer as quick as we can... if you don't get a response within 24 hours, email as well.