No collaboration is allowed on this program assignment. Your program must be an individual and original effort. Except for any situations explicitly identified in this assignment, if any, you may only receive help from your instructor or the tutors provided by the Computer Science Department. See the Syllabus for the significant consequences for disallowed collaboration and/or plagiarism.Due Date and Submission Instructions
Submit the following file(s) on one of the CSL servers using handin as follows:
File(s): BasicLinkedListTest.java, BasicList.java, BasicListIterator.java, and a minimal version of BasicLinkedList.java
You will be practicing the TDD process by developing SUnit tests for a class that represents a simple link-based list ADT (abstract data type). If, after reading he specifications, you are unsure how a method should behave you should try it using the Java Standard Library LinkedList class - your BasicLinkedList is expected to behave in exactly the same way.
Your source code must meet the Programming Guidelines.
Write a mimimal implementation of class and interfaces specified in the Program 6b assignment.
Recall that a minimal implementation allows you to develop and compile tests for a class's methods before attempting to write them correctly. The process of developinig the tests requires that you to understand what the methods are supposed to do before you write them - always good information to have! With the mimimal implementation you can compile and run your tests to verify that they do, in fact, report errors for methods that are known to be incorrect. Recall that a minimally implemented class has no instance variables and no logicexcept for the return statements necessary to satisfy the compiler. Where possible, choose return values that are always wrong (would never be returned by a correct version of the method) so that tests checking for correct behavior will always fail. When no always-wrong value is available then choose something clearly recognizable and remember to not write tests expecting that value to be returned as the correct result.
When writing the minimal implementation of methods that return a generic type you should return null. When calling SUnit.assertEqualsObject to test the returned value be sure to pass it as the actual parameter - not the expected parameter or you will get a NullPointerException while running your test driver - definitely not good form!
In a class called BasicLinkedListTest write SUnit tests (the class you wrote in
Program 1a) for each of the public methods of the BasicLinkedList class including the constructors and iterators.
You must use SampleTest.java as the starting point for your test class. Use the save-as feature of your browser (or wget/curl if you are a cool kid), not cut-and-paste,
to obtain a copy of SampleTest.java
At a minimum you must write the following number of tests (you may write more). Think carefully about methods that change the contents of the list - you must verify that the list's state is correct after such calls.
All of your non-boolean tests must report an error when compiled and run with a minimal implementation of the BasicLinkedList class.
Some of your boolean tests must report an error (all of your true-tests or all of your false-tests for a method depending on what the minimal implementation returns).
All of your
tests must not report an error when compiled and run with a correct implementation of the BasicLinkedList class. You may not have a correct implementation when this assignment is due so develop them carefully. If you would like to see if your tests work with a correct implementation you could substitute BasicLinkedList and BasicListIterator with LinkedList and ListIterator from the Java Standard Library - just be sure to change
you code back to using BasicLinkedList and BasicListIterator before
handing it in!