Lab8 Testing
This lab is designed to demonstrate the importance of testing.
Preparation
Before coming to lab you should have read the brief
text book section on testing, read the
following, and complete the online review questions
(in the format of a WebCT quiz).
Black Box Testing
The text briefly discussed two approaches to testing, "branch
coverage" and "statement coverage". With these two testing
strategies, the test developer (often the same as the code developer)
studies the code and attempts to write tests that exercise every
statement or branch in the program. These are both examples of "white
box testing" because the tester can see the code (I guess white boxes
are supposed to be transparent so you can see inside).
In black box testing, the test developer does not have access to the
source code and must rely on the program specification when
developing the tests.
In this lab you need to develop a test cases that cause
failures of an intentionally buggy version of ChatBotV3.
What to do
- Make a copy in some directory of yours (e.g. lab8) of all of the
files in /afs/cats/courses/cmps012a-cm/lab8
(
cp /afs/cats/courses/cmps012a-cm/lab8/* . don't miss
that last dot).
- Try the program on the hw3Test1.txt sample cases to convince yourself
that the program works for at least some non-trivial input.
- Now create some new test files to try and elicit the erroneous
behavior of the program.
There are three known bugs. Try to find at least two of them.
- When you have found two or more bugs, complete the post-lab quiz (which asks
something you can easily answer once you have a test case that exposes the error).