CS340, Lab 1, Spring 2008

Activity 1:  Risk Management

Divide into groups of 4 or 5 students.   Among your group, talk about two major risks in each of the following areas:
For each risk, talk about one or preferably several ways that this risk could be avoided, minimized, or mitigated if it occurred.
Address whether technology can help with this or whether team or process solutions can help.

When called upon, share your set of risks with the instructor and the class.

Working with Large Java Projects:

Educators at NCSU have made available a simplified version of a Monopoly game, called RealEstate.  
We'll use this to explore how to work with large programs in Java, including how to deal with multiple packages, test cases, etc.

Download the Zip file for this program here.  
Within Eclipse, choose Import, then "Existing Project into Workspace", then "Select Archive File".  Once you chose the Zip file, you'll have a project on your system.
You can run it using Main.main() in package edu.ncsu.realestate.gui (try choosing "Run as Java Application" and then picking this class from the choices it gives you.

Activity 2:  Some Basic Eclipse Usage

Step 1: First, note that code and other resources are located in different folders (e.g. src, unittest, testCommon, etc.).
Question: can a Java package exist in more than one folder?  Write your answer down.

Step 2:  Find what classes inherit from the class Card. Use the "Type Hierarchy" feature to do this.

Step 3: What useful search or browing options are available when you high-light a class name and right-click?  Write down two that you think might be very useful.

Step 4:  How can you find out where a method is called anywhere in the current project?  Write down your answer (briefly).

Activity 3:  Unit Testing

Step 1: Listen to the mini-lecture on JUnit Testing.

Step 2: Examine a simple JUnit test class in unittest such as... find a small one you understand.  See if you can understand what it's trying to do.

Step 3: Examine the GameMaster class.
Then examine the GameMasterTest class in the unitest folder.
Discuss with your team what it is trying to do.
In particular, why don't you get a GUI when a GameMaster object is created?  Write down a bit of explanation about the class of the object that is created that prevents a GUI from being created when the game is started and tested.  How does abstraction come into play with this strategy?

Work JUnit testing example from handout with partner for the rest of the lab period.

Read later:  http://en.wikipedia.org/wiki/Mock_object