Lab 7
Background Reading
Objects First
with Java, Chapter 7
Unit Testing in BlueJ
and The BlueJ Environment Reference Manual
(both documents were provided on the SYSC 1101
Software CD, and can be downloaded from the BlueJ Web site via this URL:
www.bluej.org/doc/documentation.html).
Attendance
To receive credit for attending this lab, you must email a jar file containing the project that you worked on during the lab session, by no later than 4:45 p.m., February 28, 2006.
Before submitting your project, please review the Assignment and Lab Exercise Submission Instructions, which are posted on the course Web site.
Package your project in a jar file called lab7_abcdefghi.jar (where abcdefghi is your 9 digit Carleton student number). Use your Carleton Connect account or your Engsoc account to email this file to bailey@sce.carleton.ca. In the subject line, type:
Today's Lab Work
Work on Assignment 2. At a minimum, you should be able to complete part 1 (Exercise 7.14) and part 2 (Exercise 7.18), and make a reasonable amount of progress on part 3 (Exercises 7.20 and 7.22).
Where feasible, develop JUnit test classes to your code. For example, in Exercise 7.18 you will be writing two methods that return String objects. Writing tests for these methods is simple. (In fact, because these methods are so simple, do we really need to write tests for them? What are the pros and cons of doing this?) Much of the code you'll write for Exercises 7.20 and 7.22 is a good candidate for automated unit testing. On the other hand, perhaps Exercise 7.14 is best tested interactively, because a Game object obtains input from a player (by using the Parser object), and the look() method outputs results to the console. This suggests that determining if this part of program is correct is best handled by having a player invoke the command and observe the resulting behaviour.