CMSC 131 Fall 2007Jan PlaneLecture 14:DebuggingLast time: 1.Unit testing and JUnitToday:1.The Eclipse DebuggerCMSC 131 Fall 2007Jan Plane1The problemProblemJUnit can only tell if that passes or fails and whereNeed a way to be able to see what is in memory (variables) at every step to be able to do complete trace [like that call stack examples we have been doing]SolutionThe debugger gives the ability to go through the code – displaying additional information similar to the by-hand call stack that we have been doingCMSC 131 Fall 2007Jan Plane2TerminologyBreak Pointdrop a marker into the code so when it runs the execution will stop at that pointallows you to not have to go step by step through things you believe are correctStep Overtakes one step in the current methodif that step is a method call, it performs that whole method call and steps to the next line in the current methodStep Intotakes one step in the current methodif that step is a method call, it steps into that method so that you can then step through it before getting to the next line in the method you were inCMSC 131 Fall 2007Jan Plane3EclipseRunDebug As…Run As…CMSC 131 Fall 2007Jan Plane4Corner CasesThose that fit betweenor are different than the normalexamples:really longempty stringsingle character
View Full Document