Assigned Date: Monday, Nov. 7, 2005 (sec 2 +1 day)
Due Date: Wednesday, Nov. 16, 2005 (sec 2 +1 day)
Due Time: Noon
Last modified on November 09, 2005, at 02:13 PM (see updates)
This assignment focuses on linked structures, and unit testing.
Design and implement a
CircularQueue ADT using a circular linked implementation (as shown in Figure 5.13 of the textbook). Your ADT should implement
Interface for a class that implements a queue of Objects.
// Effect: Adds item to the rear of this queue.
// Precondition: This queue is not full.
// Postcondition: item is at the rear of this queue.
// Effect: Removes front element from this queue and returns it.
// Precondition: This queue is not empty.
// Postconditions: Front element has been removed from this queue.
// Return value = (the removed element)
// Effect: Determines whether this queue is empty.
// Postcondition: Return value = (this queue is empty)
// Effect: Determines whether this queue is full.
// Postcondition: Return value = (queue is full)
Read the short tutorial Unit testing in BlueJ.
Develop a test plan to test your implementation (see the test plan developed in Chapter 4). Your test plan should include one or more tests for each Queue operation -- tests should be thorough and not redundant.
- Use BlueJ to create a test class. (Within BlueJ, you may need to show unit testing tools. Go to Preferences-->Miscallaneous and check Show Unit Testing Tools.)
- Right-click on
CircularQueue.java. Select Create Test Class. This will generate file
- Right-click on
CircularQueueTest.java. Select Create Test Method. Give it a descriptive name, e.g.,
TestIsEmpty. This will create the method and start recording your actions... (for the rest, see Unit testing in BlueJ).
Your code should be fully documented via javadoc. Your code should throw approppriate runtime exceptions to test preconditions and handle errors.
Include the following in each class:
Certification of Authenticity:
I certify that this submission is entirely my own work,
as per course collaboration policy.
Name: ________________________ Date: ___________
- Open your BlueJ project.
- Ensure it contains the following:
README.TXT should include (in addition to your name and relevant info), a textual description of your test plan.
CircularQueueTest.java should contian the JUnit implementation of your test plan.
- Open (edit) each source file and generate the class interface (javadoc). This can be done within the editor window either by pressing CTRL/J , or selecting the Interface drop-down menu item (on the right). (Note: This is necessary to generate your documentation for grading.)
- Under the Project menu, click Create Jar File... . In the dialog box that opens, select Include Source, and press Continue.
- Email the generated
.jar file to email@example.com, by the due date and time.