CM10135 / Programming II: Tutorial 3
This is an
tutorial. You may want to work on this even (or
especially!) if you are stuck on CW1.
There are two objects of this tutorial:
- To help you get a better understanding of how your code works and
how to debug it.
- To teach you the eclipse Java debugger in particular. Many
of the features of this debugger you will find in other good debugging
platforms or interactive development environments (IDEs) as well.
What to do:
- Dig out your code from tutorial 2.
- You can use your CW1 code if you like, if enough of it is
written, but it's easier to get a real feel for debugging on a program
that's mostly complete. (Anyway, you are using some of your
tutorial 2 code for CW2!)
- You may just want to go through your code as it stands
(especially if it doesn't work), or
you may want to ask someone else in the lab to introduce a bug into
it, & then see how fast you can find it. (not just a sytnax
bug! change a parameter value on a loop or something.)
- The debugger I recommend using is eclipse --- it has become quite
a standard and you are likely to use it at a job in industry or
academia. Also, there are already excellent tutorials on using
eclipse so I don't have to write one. Here are two:
- So have a look at Debugging
a Java Program with Eclipse from developer.com,
- or Debugging
with the Eclipse Platform from IBM.
- Probably the IBM one is better!
page author: Joanna Bryson
8 February 2007