Lecture Notes for CS 325

Testing Object-Oriented Programs, 27 March 2000


  1. functional testing still applies to objects and methods

  2. structural testing still applies to methods

  3. translucent box testing - structural testing for objects.

    1. testing method and state interaction; not method-only testing

  4. adt testing provides a framework, but inheritance and a less formal orientation

  5. issues

    1. classes and instances - abstract classes

    2. object state is difficult to characterize - non-sequential control flow, global state influences

    3. inheritance hierarchy

      1. some of the testable parts aren't in the class

      2. some of the previously tested components aren't the same

      3. arbitrary patterns of method invocation

  6. state-based (translucent box) testing

    1. characterizing state changes induced by method calls

    2. invoke every method in every state

      1. potentially expensive - state may be large

      2. one invocation per state may not be enough

    3. reduce the state space using equivalence classes

    4. re-introduce special cases

    5. also check the integrity of the data structures making up the state

    6. testing is fairly standard - test harness, special set and examine methods, stubbing out called objects

    7. comments

      1. testing constructors and destructors is difficult

      2. testing effort related to state space

      3. errors not related to state abuse are not detected

      4. establishing a testing order among objects may be hard - bottom up

  7. incrementally testing objects

    1. can the tests in a parent class be reused in a child class

    2. avoid redundant testing, reduce the number of test cases

    3. new, old (recursive), and redefined features

    4. feature interaction between parent and child

    5. select test cases to tickle inter-feature interaction

    6. test-case criteria based on inter- and intra feature interaction patterns

    7. top-down testing


This page last modified on 27 March 2000.