Project 1 Design
Due Date
- 11:59pm, Sunday, February 19, 2006
- No late designs accepted
Objective
The objective of this assignment is to make sure that you begin thinking
about your project in a serious way early. This will not only give you
experience doing design work, but will help you anticipate the number of
hours that you'll need to set aside to be able to complete the project.
A new component to the design is a preliminary component of the final
project, to get you writing code the first week and not waiting until the
second week.
The Assignment
Your design assignment is broken down into two parts.
Functions
You are required to turn in the following:
- Function prototypes for any function you plan to provide.
Full function header comments must be provided. Be sure to pay particular
attention to the quality of your Pre-conditions and Post-conditions - make
sure that they are specific and communicate the appropriate information to
a reader/user of the function.
- Function implementation(s) that open the maze file, read in the maze
from the file and print it to the screen. Simply paste your code for these
functions into the design document.
Test Mazes and Test Cases
You are required to turn in the following:
- Three (3) new mazes that you develop to test your application - focus on
testing the guarantees that were listed in the project description.
- Five (5) test cases that you will use to test the function(s) provided
in the first part. Each test case must test a different aspect of the
function(s), they cannot be variations of the same test.
Recall that test cases are SPECIFIC and MEASURABLE - with 100% certainty you
can say "my program has passed this test". You can describe a test case with
3 pieces of information:
- Description of what you are testing
- Specific input you will try
- Expected output/result you should see
Example:
Let us assume we are testing the following function that accepts a non-empty
string s and a positive integer n and returns the character
of the string that is in the nth position:
///////////////////////////////////////////////////////////////////
// Name: getNthChar
// PreCondition: n is a non-negative number, less than length of s
// PostCondition: if n is invalid or s is empty, returns '\n',
// otherwise, returns the nth character of s
///////////////////////////////////////////////////////////////////
char getNthChar(int n, string s)
{
if (n < 0 || n >= s.length)
return '\n';
else if (s.length == 0)
return '\n';
return s.at(n);
}
Examples of good test cases would be (there are MANY more):
Description
| Input
| Expected Output
|
INVALID: Negative value for n
| n = -1 s = "anything"
| '\n'
|
INVALID: Too large value for n
| n = 10 s = "anything"
| '\n'
|
VALID: first character in string
| n = 0 s = "anything"
| 'a'
|
VALID: last character in string
| n = 7 s = "anything"
| 'g'
|
INVALID: one past end of string
| n = 8 s = "anything"
| '\n'
|
NOTE: These ALL deal with the same variable - so you could only use one of
them. However, they should give you a good idea as to what we are looking for.
This list of test cases that you generate represent a small part of the set
of tests that you should run on your program EVERY TIME you make a modification
to your code. Even if all you do is add a comment, you should run ALL of the
tests again - you never know when a small mistype will result in your program
no longer compiling!
A template for your design document, p1design.txt,
is provided in Ms. Wortman's public directory. Copy that file
/afs/umbc.edu/users/d/a/dana3/pub/CMSC202/p1/p1design.txt
to your local directory and fill in the necessary information.
Submit your modified p1design.txt file to complete this assignment.
Grading
You will receive feedback from a TA on your design within a few days of turning
it in. This will give you an opportunity to address either design
or coding flaws before turning in the project.
Your p1design.txt file will be compared to the header file or files that you
submit when Project 1 is due. Minor changes or those suggested by your TA,
to the design are allowed. A minor change might be changing the way in
which one or two parameters are passed or even the removal, splitting or
addition of one function.
If there are major changes between the design document and the header files
that are part of the final project, you will lose 5 points, unless those
changes were suggested by your TA. This would indicate that you didn't
give sufficient thought to your design before beginning the implementation.
Your p1design.txt file will count as 10% of your project 1 grade
(part of the Correctness). If this file is not submitted by its due date,
or if you submit a new version after its due date, you will lose all 10 points.