Project 1 Design
Due Date
- 11:59pm, Sunday, September 24, 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
Functional Design
You are required to turn in the following for the design of your system
- Function prototypes for any functions you plan to provide for the entire
application as described for this project.
- 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.
Board Implementation
You must implement part of your Board function(s) and a main function that
tests the following functionality for a Board:
- Create the initial board using vectors
- Read a board from a file
- Print the board to the screen
Include ALL of this code in your p1design.txt file.
Test Boards and Test Cases
You are required to turn in the following:
- Three (3) new boards 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. Again, focus on
testing the guarantees that were listed in the project description.
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!
File Template
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
Your p1design.txt file will be compared to the header file or files that you
submit when Project 1 is due. Minor changes 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 points. 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.