Lab2


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:

You will also be familiar with various Squeak/Smalltalk windows Starting the lab:

If all went well in the first lab, you can start Squeak by double-clicking on your personal image.
For purposes of speed and safeguarding against server crashes, it is recommend to work from the temp directory of the local hard drive. C:temp is the only directory that is writable by students.
If Windows prompts you for a program to open the filename.image with you can specify S:appsssqueaksqueak.exe

Improving Code FileOut

Remember, if you are running Squeak from home that you need to follow the instructions from lab1!
You only need to modify your squeak image once, so if you did it for lab1 you are set for the rest of the quarter.

Procedure:

File in the code to be debugged: DebugLab.st
Save the file DebugLab.st (To do this, right-click on the link to save the file in your directory) and open Squeak. Next, right click on the Squeak desktop and select open..., open file list. Highlight the DebugLab.st file in your directory and right click on it. Select the fileIn option from the menu. At this point you should have successfully filed in a file into Squeak.

Open the debugger tutorial web page for this lab.

Try to run the code along with the tutorial:
|bank|
bank := AccountList new initialize.
bank open: 1234 name: 'P. Coad'.
(bank account:1234) deposit:1000.

You copy and paste the text into a Workspace and executing the "do it" command.
Using the tutorial you should be able to find and fix the first error in the lab.

Now instead of running the above code, try running the test code by typing:
AccountList example1
in the workspace and "do it".

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 and syntactical errors in the Account class. Fix them.
There are no errors in the AccountList class.

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.

There are a total of 5 errors in the lab besides the one described in the tutorial.  They are a of mix of logical errors and syntax errors

Finishing the lab:

After you have completed debugging your code, fileout all the code using the same steps as in Lab1.
You should turn in a fileOut of the code you wrote.

Mail the file to your TA any way that is convenient. Here is one way to do so:

   1.Select Run from the Start menu and type in:

          telnet lennon.cc

   2.Login to lennon using your CoC login and password.
   3.Change to your 2390 directory, eg cd ~/cs2390 (or wherever you put your code)
   4.Type:

          /usr/ucb/mail -s "TI,Lab2,My SocialSecurity Number or Student Number" cs2390@prism.gatech.edu < DebugLab.st

     (Replace My SocialSecurity Number or Student Number with your student number, e.g.,
     345544545).

Remember, this is just one way of turning in your code.  You can use whatever e-mail program you are comfortable with as long as you insert the code as the body of the message AND you follow the format for the subject explained above:
"TI,Lab2,My SocialSecurity Number or Student Number"

PLEASE NO ATTACHMENTS!


News Page | CS2390 Sp'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 4/16/98; 11:27:04 AM