Copyright RIT 2006
$Id: writeup.xml,v 1.0 2006/11/01 15:42:00 vcss231 Exp vcss231
$
Term 20092: This lab is to be submitted by the end of the day, Sunday Feb. 21st. This applies to all sections of the course!
In this lab you will perform software maintenance on a course registration program. Software maintenance, as you learned, is the last phase of the Software Life Cycle and involves finding and fixing bugs or system deficiencies addressed in problem reports, adding new features (enhancements), and updating code as needed for business or product changes (requirements changes). In this lab, you will do all 3 forms of maintenance. You will discover that modifying and debugging another person's code is not always fun or easy.
This lab will be done in teams of two students each. Your instructor will form the teams for this lab and will tell you which team you are on when you arrive for lab.
As you finish each activity, be sure your team carefully tests your code changes. You will make only one submission for all the maintenance activities in this lab.
You are to work on this lab in teams of size 2. Students who do not abide by this rule will not get full points for in-class participation.
Review your class notes for the preceeding week.
A sample data file can be found here (/~vcss231/pub/lab10/Binaries/input1.txt) .
The program outputs prompts for the above input. After the registration ends (i.e. all input has been read), the program outputs, for every course, the list of registered students (in the order in which they registered). Similarly, for every student the program outputs the list of courses the student has registered for (in the order in which the student registered for these courses).
We have provided you with a sample run of the registration. Click here (/~vcss231/pub/lab10/Binaries/input1.txt) to see the input file that produced this output (/~vcss231/pub/lab10/Binaries/output1.txt) This output was produced by redirecting the given input file to the standard input.
The registration system consists of 3 classes: Registration, Course, and Student. The UML diagram class diagram below shows each of the classes and the relationships in this program.

Registration System Classes and Collaborations
The Registration class is the main class which handles the interface with the user. It is responsible for reading and interpreting the user's input and recording appropriate actions. The class defines a constant array with all the course names, and it stores two arrays, one of objects from the class Student, and the other of objects from the class Course. The index of a course in course array is exactly 1 less than the corresponding course number, similarly the index of a student in the student array is one less than her/his registration ID. The registration class handles all the requests by calling "registerStudent" or "withdrawStudent" methods on the specified object from the class Course.
A brief description of the remaining classes is given below:
The Hogwarts School of Witchcraft and Wizardry is currently using the software to register their students for Potions, Transfiguration, and Charms. However, recent changes in the Ministry of Magic regulations call for the following changes:
Until now, the maximum number of students in each course was set to 3. However, now there can be up to 6 students in Charms, not more than 4 students in Potions, and maximum of 5 students in Transfiguration.
In addition to printing the lists of students in each course, the regulations now require, for every course, to clearly state the number of registered students and the maximum allowed capacity of the course.
Students have been complaining that sometimes their course lists do not seem correct if they attempt to withdraw from a course. No other documentation is available.
The files that you need to complete this lab are contained in the jar file located here (/~vcss231/pub/lab10/Binaries/lab10.jar) . Download the jar file and unpack it in an appropriate location in your account.
DO NOT attempt to change any code until you understand what the registration program does, the design of the program, and the output that it produces. Modifying code before understanding the program will simply be a waste of your time, and may introduce additional errors!
The lab10.jar file contains the code that
implements the registration system. You should find three files in this
directory: Registration.java,
Course.java, and Student.java.
We have only provided you with one sample data file, /~vcss231/pub/lab10/Binaries/input1.txt. It will be up to your group to determine the test cases for your code, i.e. to develop your own test data files.
As you complete each portion of this lab, make a copy of it and store
it in directories Task1,
Task2,
and Task3. This will give you an easy way to "fall back"
if you find you have introduced bugs in later activities.
Make sure you run the registration using the test data shown above so that you get a feel for what the program is doing.
Do not proceed to the next step in this lab until you understand what the program is doing and how it works with the data in the input files.
When modifying a source code, it is a good practice to put a comment in front of every line that has been changed, along with an identifier (such as initials) of the person who changed the line, the date of the change, and a brief description of the nature of the change. An example of such a comment is the first comment within the main method in the Registration class. Include such comments with every modification you make.
Make the requirements change to reflect the new maximum course capacities. After completing your coding changes, test your solution to be sure it works properly. Do not go on to the next activity until you are sure your changes are correct.
Make sure that you take advantage of features in the language that might make a similar change in the requirements easier to make in the future. The constants 4, 5, and 6 should appear only once in all your code (including all three classes).
Remember that any changes you make to the code must be documented. Your documentation should state the changes that were made, and why they were made. Note that as soon as you change any code, you have become a contributor to the program.
When you have made the necessary changes to the program, very
carefully test your code. Then copy the working version into the
directory Task1 for safekeeping. Do not continue
with the next activity until you are sure your code works properly.
Make the enhancement to report the number of registered students and the capacity of every course.
Replace the output statement "These students currently registered for this course." with the following print statement.
|
Of course, substitute your own variable names for
registered-students
and
capacity.
Your programs will be tested using a system that requires the output from your program to match the output from the solution exactly. When you decide where the print statement should be located, you can use cut and paste to insert the sample print statement into the correct location in the program.
Click here (/~vcss231/pub/lab10/Binaries/output1b.txt) to see a sample of what your output should look like after adding this enhancement.
Don't proceed to the next activity until you are sure that the
enhancement is working correctly. When you are sure that the changes you
have made are correct, copy the working version of your code for this activity
into the Task2 directory and then continue with the next
activity.
Address the problem report that indicates that after successfully withdrawing from a course, the students sometimes still see the course listed on their transcripts.
To correct this problem, start by building some test inputs to test the basic behavior of the registration system. First, try simple inputs that test the registration and withdrawal requests. If you don't find any errors with these test cases, try building more complex cases. For example, what happens when somebody withdraws from a course they did not register for? Or, what happens when a student attempts to register for a full course, then somebody withdraws and then the first student tries to register again?
As you can see, this simple program produces a very large number of test cases and each one is critical to ensuring quality!
However, since it's the end of the quarter (whew), here are two hints that should help: Check the basics. It's a single problem.
When you have addressed this problem, submit your code using the following command:
|
Grade Breakdown: