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:
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
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 5 points. This would indicate that you didn't give sufficient thought to your design before beginning the implementation.