Author: Stan Eisenstat
Subject: Testing your code
Date: Friday, 02 Oct 2020, 10:30:24
As I pointed out in the specification for fiend:
You may use the script /c/cs323/bin/tester to run your own tests.
Here is the description;
# Run all tests in directory BASE for which the expected output ends in .SUFFIX
#
# Example:
#
# % tester /c/cs323/Hwk1/Tests t
#
# will run every executable file in the directory /c/cs323/Hwk1/Tests for which
# there is a corresponding file with suffix .t. That is, if BAD is such an
# executable file and there is a file named BAD.t, then tester will execute
# BAD, capturing the standard output and standard error, and run diff on
# the captured output/error and BAD.t.
Creating a test can be as simple as
% cat > BAD << END ; chmod +x BAD
./parsley <<HERE
Can you parse a sequence of TEXT tokens correctly?
HERE
END
and /c/cs323/Hwk2/parsley can be used to create the .t file.
As for constructing tests, I posted the following on September 3rd:
Here is some advice for finding edge cases:
* Read the specification, very carefully, line by line, looking
for words like "should" or "must" and active verbs.
* Look at the public test cases to see what they do NOT test
but might have.
Best,
--Stan-
PREV
INDEX
NEXT