To develop test cases/test-script file that exposes defects in 8 different buggy implementations of Swap_Substring.
Two students should work together at ONE workstation.
mkdir closed-lab04
cd closed-lab04
/class/sce/now/221/closed-labs/catalogs/closed-lab04by typing the "link" command:
ln -s /class/sce/now/221/closed-labs/catalogs/closed-lab04 drivers
ls -lYou should see something like the following:
lrwx------ 1 yourname cls-su99 52 Jul 19 15:04 drivers -> /class/sce/now/221/closed-labs/catalogs/closed-lab04The l at the beginning of the first line (which is so long it wraps around) means that drivers is a link to, or local nickname or alias for, the directory that appears after ->.
There are 8 test drivers, Bug_A through Bug_H, each of which is an executable version of the driver Swap_Substring_Test, which you saw in the warm-up, except that each uses a different buggy implementation of Swap_Substring. For each of Bug_A through Bug_H, your job is to provide a test case that reveals a defect in its version of Swap_Substring. (This is what you'd like to be able to give back to the developer if you were the tester in a real-world situation.)
You can perform testing either interactively, as described in the warm-up exercise, or by using a test-script file. To test Bug_A, for example, interactively, type the command:
drivers/Bug_ATo test Bug_A, for example, using a test-script file, type the command:
drivers/Bug_A < test-in > test-outAs described in the warm-up, this second command causes Bug_A to run taking input from the file test-in and sending its output to a file named test-out. To inspect the file test-out to see what happened, type the Unix command:
less test-outThere are three possible outcomes to a test case:
ERROR DETECTED:
expected // some value appears here
observed // a different value appears here
EXECUTION TERMINATING
Process shell finished
In this case you will need to try some new test cases, possibly by adding them
to test-in.
Keep doing this until your test plan includes a test case that reveals
a defect.-------------------------------------------------
| t1 = "Swap_It_Out"
| pos = 5
| len = 0
| t2 = ""
-------------------------------------------------
Swap_Substring (t1, pos, len, t2); |
-------------------------------------------------
| t1 = "Swap_?It_Out"
| pos = 5
| len = 0
| t2 = ""
-------------------------------------------------
ERROR DETECTED:
expected t1 = Swap_It_Out
observed t1 = Swap_?It_Out
EXECUTION TERMINATING
Process shell finished
This response from the test driver indicates that the test case
with incoming values of t1 = "Swap_It_Out", pos = 5,
len = 0, and t2 = "" exposed a bug.
(If you are using a test-script file, this will be the last message in
test-out.)
On a piece of paper, write down the
exact incoming values that exposed a bug in Bug_A.
(NOTE: In the file test-in, the quote marks in
"Swap_It_Out" and "" DO NOT appear. See the
warm-up exercise.)
The instructor will need to see this documentation when
checking your work.
Repeat this process until you have found and recorded a defect-revealing test case for each of Bug_A through Bug_H.
Let your instructor know when you have recorded the test cases that reveal defects in each of Bug_A through Bug_H. And remember, the first group to successfully complete this task wins fabulous prizes!