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.
ErrataSubmit the following file(s) on one of the CSL servers using handin as follows:
File(s): BasicArrayListTest.java, BasicList.java, and a minimal version of BasicArrayList.java
touser: eaugusti
assignment/subdirectory: 102-program02a
ObjectivesYou will
be practicing the TDD process by developing SUnit tests for a class that represents a simple array-based list ADT (abstract data type).
Your source code must meet the Programming Guidelines.
Write the BasicList interface and a mimimal implementation of BasicArrayList class found in the Program 2b
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 logic
except 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.
In a class called BasicArrayListTest write SUnit tests (the class you wrote in Program 1a) for each of the public methods of the BasicArrayList class including the constructors.
You must use SampleTest.java as the starting point for your test class. Use the save-as
feature of your browser, 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 BasicArrayList 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 BasicArrayList class. You may not have a correct implementation when this is due so develop them carefully!