Developing a Test Plan for PA2


1 Types of Test Plans: When developing test plans we normally distinguish between "black box" and "white box" (or "clear box") testing. In the first, you don't know anything about the internal details of the modules you are testing (you just know method signatures), hence you about the best you can do is to try all combinations of inputs. In the second, you know about the internal details, hence can design tests that "fully exercise" the code (i.e., tests that ensure that every line of code is executed at least once for every possible state of the system).
2 Thinking About Testing for PA2: When developing a test plan for PA2 you should, obviously, make sure that you test every method. But, you must do more than that.

First, you must think about how the state of the DiscChanger impacts the execution of each method. So, you should certainly:

and you should think about whether you need to:

Second, you must think about how state transitions impact each method (i.e., how the DiscChanger might be used over time and how this might cause difficulties). For example:

3 Some Tests You Might Use: To help get you started, several tests are available on-line. The name of each file ends with a number, indicating the size of the DiscChanger it was designed for. The first line of each file contains the correct output (preceeded by //).

The following files contain some basic test loadDisc(), getID(), next(), previous(), and eject() methods:

The following file contains a test of the on() and off() methods:

The following file contains a test of the loadDisc() method under both full and empty conditions:

Copyright 2010