1first bluej day, houston, texas, 1st march 2006 debugging in bluej davin mccall
TRANSCRIPT
![Page 1: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/1.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 1
Debugging in BlueJ
Davin McCall
![Page 2: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/2.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 2
Overview
• What is debugging?
• Object inspector
• Method invocation
• “Traditional” BlueJ debugger window
• Demo
• Questions
![Page 3: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/3.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 3
Debugging…
• Locate the source of a bug• Run through the part of the program
where we think the bug is occurring, watch program behaviour
• In BlueJ this is normal operation!! (to some extent) - inspectors, method invocation
• BlueJ also has a (simple) more traditional debugger
![Page 4: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/4.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 4
Debugging (cont’d)
• Set “breakpoints” which will halt the program execution when reached
• Once execution is halted, can continue execution line by line (“stepping”), either following or stepping over function calls
• Inspect values of variables in currently executing methods (the stack). Inspected objects shown in familiar inspector windows
![Page 5: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/5.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 5
Stepping
• Stepping through code …
• Might let us see what is going wrong
• Also serves as a good way to demonstrate control structure behavior, program flow, etc
![Page 6: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/6.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 6
BlueJ as a debugger
• Even without the debugger window, BlueJ offers unique features which can be used for debugging and testing
• Construct objects on the fly
• Call arbitrary methods interactively
• Inspect objects and classes to see field values
![Page 7: 1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall](https://reader036.vdocuments.mx/reader036/viewer/2022082507/5697bff31a28abf838cbc816/html5/thumbnails/7.jpg)
First BlueJ Day, Houston, Texas, 1st March 2006 7
Conclusion
• BlueJ provides basic debugging functionality
• Some of BlueJ’s core features (interactive invocation and inspection) are also useful for debugging
• Debugging techniques can serve another purpose: demonstrating code behaviour