lecturenotes10_10 - Debugging October 10, 2008 An Approach...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Debugging October 10, 2008
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
An Approach to Debugging You know your program has a mistake when: 1.The code is finished and you think it should work but it doesn’t run 2.It runs, and gives an answer, but it isn’t correct, or 3.it seems to run, but never finishes In ALL cases, the biggest challenge is locating the line that the error is in, fixing it is usually much easier!
Background image of page 2
Manual Debugging Most programming languages have a built in debugging function. These have varying levels of complexity “Manual” debugging is the simplest, most effective and will work in any language (also has the added benefit of teaching you more about programming!)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
For code that doesn’t run at all Use breakpoints (here I break the rule about not using built-in debuggers) OR comment out most of the code to see how far it gets Use the “DISP” command liberally. You can remove all this later, but in the meantime it will tell you exactly where you are getting to Remove semicolons to see what is being computed
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/25/2009 for the course BEE 1510 taught by Professor Staff during the Fall '05 term at Cornell University (Engineering School).

Page1 / 10

lecturenotes10_10 - Debugging October 10, 2008 An Approach...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online