Lab #2: Introducing the Debugger


Objectives: The objective of this assignment is introduce you to the Smalltalk debugger.
Upon completion, you should be able to:

Procedure:

File in the code to be debugged: DebugLab.st (To do this, save the web page as text in your directory, open up a File List, then file in the file.)

Open the debugger tutorial web page for this lab. Run visualworks simultaneously.
When you have finished the web tutorial, run the example code

AccountList example1

Look at the code example1 (hint: It's a class method!) and try to figure out what it is supposed to do. Examination and manipulation of the values in the example should give you some hints about the problems with the Account operations. The simple workspace code at the end of the web tutorial might also be useful.

Use the debugger to track down the logical errors in the Account class. Fix them.

Notes
The comment for the Account class specifies that:

The AccountList class contains no errors because Dictionaries and collections have no been covered in lecture yet. We have added a printString method to print the accounts.

You are free to create additional code to test the Accounts. If you want us to see this code (i.e., you want to get some credit and are pretty lost), make it a class method of Account called example, and include comments liberally.

Other Resources:
Try the Tracer.st code. It allows you to track changes to the value of an object.
File it in and look at the class comment (click on the class and choose middle-button "Class Comment").

What to Hand in:
Turn in the modified DebugLab.st category file-out. Use code 'lab2'.

For more information on turning in code, look at the Lab FAQ.

For example:

cat filename | elm -s "TI,Lab2,0123456789" mailto:cs2390@prism.gatech.edu">cs2390@prism.gatech.edu

Don't enter in <>!!! You'll get a receipt next time we run the TurnIn system (Wed. night or Thursday morning.)

When you are done, EXIT FROM VISUALWORKS! It's very important that you explicitly exit from VisualWorks, using the File menu. Also, be sure NOT to Save, just Exit.


News Page | CS2390 Sum'97 Home Page | MMC-CaMILE | STABLE
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 7/8/97; 2:26:07 PM