Test Case Planning Exercise
The objective for this exercise is to, as a team, describe a set of
test cases to be used in evaluating whether a program meets its specifications.
The specifications for the program to be tested are as follows:
- The program encrypts or decrypts the contents of a file on a character-by-character basis,
based on the ascii value of the character in the file and an integer value (0-127)
supplied by the user.
- To run the program, the user provides command line flags -e or -d (for encrypt/decrypt),
an integer value (0-127) and the name of the file. The user can provide these arguments
in any order.
- If any arguments are missing or invalid or the file cannot be read/written
an appropriate error message is provided and the program terminated.
- To encrypt the file, for each character in the file,
the encryption value (0-127) is added to the ascii value of the character.
If the result exceeds 127 then 128 is subtracted from the result.
The new value is the ascii value of the encrypted character to replace the original,
e.g. "hello" encrypted with 3 produces "khoor".
- To decrypt the file, the encryption value is subtracted from the ascii value
for each character, adding value 128 if the result is less than 0. ("khoor" decrypted
with 3 produces "hello").
You can establish your own format for describing the test cases,
but the following information must be present for each test case:
- a short, unique, identifying name for the test case,
- why that test case is present (what does it test that the other cases don't)
- the data to be entered to run the program (both from the
command line and interactively), the content of the file
being encrypted/decrypted, and the location/state of the file
- the expected results of the test