A case study in class testing

  • Authors:
  • Daniel Hoffman;Paul Strooper

  • Affiliations:
  • University of Victoria, Victoria, B.C., Canada;University of Queensland, St. Lucia, Australia

  • Venue:
  • CASCON '93 Proceedings of the 1993 conference of the Centre for Advanced Studies on Collaborative research: software engineering - Volume 1
  • Year:
  • 1993

Quantified Score

Hi-index 0.03

Visualization

Abstract

In contrast to the explosion of activity in object-oriented design and programming, little attention has been given to object testing. In our approach, a driver class and an oracle class are developed for each class-under-test (CUT). The driver class is based on a testgraph which partially models the CUT as a state machine, but with vastly fewer states and transitions. The oracle class provides essentially the same operations as the CUT, but supports only the testgraph states and transitions. Surprisingly thorough testing is achievable with simple test graphs and oracles. The key is designing the two together, to avoid tests for which input generation and output checking are unaffordable. We illustrate our approach with a test suite developed for a class from a commercial library.