-
Assignment Documentation
-
For each programming assignment, turn in both the documented source code and a test document. Place your files in a folder with the appropriate name (including your initials), zip it, and submit via Canvas.
-
Development and Style
-
Before writing code, decide on your classes, main data structures, and main algorithms.
-
Start your coding by declaring all the classes, declaring the data, and including "stubs" for the methods. Compile it and then compile it whenever significant changes are made.
-
The "main" class should act as a controller rather than include any detailed methods.
-
As you develop the code, look for places where a data structure (like an array or arrayList or custom structure) should take the place of multiple instance fields.
-
Whenever you find yourself repeating code, consider making an additional method or introducing a loop.
-
Whenever a method becomes "too" long (more than 20 lines?), consider breaking it into smaller methods.
-
Name your variables and methods so that they make sense.
-
Code Documentation
-
For each class, included a description, a list the data, and the key methods.
-
For every method, include a comment explaining what the method does, what is passed in through parameters, and what is returned.
-
For any more complex data structure (array, etc.), comment on what it does.
-
For any more complicated calculation, comment on what it is doing.
-
To keep track of the methods, put a comment after the closing brace of each method indicating something like "end of method A".
-
Test Document
-
Test Cases: Based on what the program is suppose to do, list the test cases you plan to try and why they are important cases.
-
Exceptional Cases: Take the users point of view, and try to anticipate abnormal input or sequences of keystrokes that might crash your program. We are not trying to catch all these abnormalities, but rather trying to determine when the program will work and when it will not.
|