Unit tests must be performed in isolation, that is, a class must not be able to access any other classes in the program. Classes must be tested in isolation to ensure that each class functions independently from the others. However, some classes depend on other classes, and will not function without them. To remedy this situation, a number of stubs will be created. A stub is simply a dummy class that simulates the behavior of a class for testing purposes. These stubs will be stored in CVS under src/test/sam/unit/stubs. In order to unit test a class that imports another SAM class, the class must be copied into this directory before test cases are run.
Unit Tests will be written using a Black Box methodology (see section 4.2), and the particular tests will be chosen by some or all of Equivalence Partitioning (see section 4.2.1), Boundary Value Analysis (see section 4.2.2) and Random Selection (see section 4.2.3). For the more important logic classes, Glass Box testing will also be used if time permits (see section 4.3).
For classes that involve the creation and/or manipulation of a graphical user interface (GUI), Unit Testing is more difficult, since these classes rely on external user events to trigger functions, which cannot be easily reproduced. Therefore, Unit Testing will only be done on GUI classes if it is deemed suitable and helps, rather than hinders, development. For more details on how GUI classes will be tested, see section 7.