UMBC CMSC 202
UMBC CMSC 202 CSEE | 202 | current 202

Project 1 Design

Due Date

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:

Test Mazes and Test Cases

You are required to turn in the following: 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:

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.


Last Modified: Saturday, 11-Feb-2006 20:31:49 EST