CSC 357 Program 2 Test Plan
This is an input/output test plan for programming assignment 2, in the standard 357 format. Additional explanatory information is in the test plan for programming assignment 1
The test-execution script is run.csh. It assumes a program named nwc exists in this directory. The script must be run on falcon or hornet in order to find testing files with specific UNIX paths.
Most testing input is from files in the inputs subdirectory. Cases 1, 2, 7, and 8 have no command-line file inputs. Cases 19-22 take input from files in standard locations in the falcon/hornet file system. The expected-output subirectory has the expected output for each test case. The naming convention for the output files is
case-number:input- filename.[err]outwhere the .errout files are those that produce error messages to stderr.
Here is an excerpt of a typical case from run.csh:
The timelimit command takes a run-time limit in seconds, the program to run, and its arguments. All of the test cases except the last have a time limit of 15 seconds each. The time limit on the last case is 30 seconds. The executable for timelimit is in ~gfisher/classes/357/bin. If you're curious, its C source code is in ~gfisher/classes/357/src/timelimit.c (copyright Phil Nico).# # Case 4. # if ($1 == "-v") echo Case 4 timelimit 15 ./nwc inputs/10-wds > output/4:10-wds.out
The script diff-case uses UNIX diff to compare actual and expected outputs. The script takes the case number, the output file, and the number of points for case. It produces no output if there are no differences.
Depending on an implementation, some of the test cases may take a while to run. Since no terminal-visible output appears when a correct program runs, you'll see no sign of progress. If you would like to see output progress as each case runs, use the "-v" option.
Inputs: | |||||
Case | file arg(s) | -n arg | Output | Remarks | Points |
1 | nonexistent | nonexistent file; output message is to stderr, with no output to stdout | 2 | ||
2 | xxx | usage message; output message is to stderr, with no output to stdout | 2 | ||
3 | empty | empty.out | empty input file | 2 | |
4 | 10-wds | 10-wds.out | ten different words in input file, exactly ten words long | 10 | |
5 | 10-wds-rpts | 10-wds-rpts.out | ten different words in input file, with some words repeated | 10 | |
6 | 10-wds-cases | 10-wds-cases.out | ten different words in input file, with some words repeated and in different cases | 5 | |
7 | < empty | empty.out | empty input from stdin, instead of command-line file name | 2 | |
8 | < 10-wds | 10-wds.out | non-empty input from stdin | 2 | |
9 |
10-wds-cases
10-other-wds | 10-of-20-wds.out | two input files, ten different words each | 10 | |
10 |
10-wds-cases
10-other-wds more-wds | 3-in-files.out | three different input files | 5 | |
11 |
10-wds-cases
nonexistent 10-other-wds more-wds | 3-in-files.out | three different input files and one nonexistent file | 2 | |
12 |
10-wds-cases
10-other-wds more-wds | 20 | 20-wds.out | three different input files, 20-word output table | 6 |
13 |
10-wds-cases
10-other-wds more-wds | 50 | 33-wds.out | three different input files, 33-word (max-length) output table | 6 |
14 | many-1-wd | many-1-wd.out | one word repeated 100,000 times, on one line | 5 | |
15 | many-wds | many-wds.out | many different words, on one line | 5 | |
16 | 1-long-wd | 1-long-wd.out | one very long word | 5 | |
17 | man-tcsh | man-tcsh.out | output of running "man tcsh" | 3 | |
18 | man-tcsh | 20 | 20-wds-man-tcsh.out | 20-word output table for man-tcsh | 2 |
19 | /usr/dict/words | usr-dict-words.out | the large file of words in the UNIX dictionary | 4 | |
20 |
/usr/dict/words
/usr/dict/words /usr/dict/words | usr-dict-words-3.out | /usr/dict/words three times | 3 | |
21 | /usr/man/man1/* | usr-man-man1.out | every file in section 1 of the UNIX man pages; 675 files, 5.419 Mbytes total size | 3 | |
22 |
/usr/dict/words
/usr/man/man1/* | both-dict-man.out | both /usr/dict/words and /usr/man/man1/* | 3 | |
23 |
/usr/dict/words
/usr/man/*/* | all-man.out | /usr/dict/words and every file in every section of the UNIX man pages; 13106 files, 46.005 MBytes total size | 3 |