ACM Transactions on Software Engineering and Methodology 7 (3): 250-295 (1998)

In Black and White: An Integrated Approach to
Class-Level Testing of Object-Oriented Programs

H.Y. Chen 2 , T.H. Tse 3 , F.T. Chan 4 , and T.Y. Chen 5

[author-izer free download from ACM digital library | review by ACM Computing Reviews]


Because of the growing importance of object-oriented programming, a number of testing strategies have been proposed. They are based either on pure black-box or white-box techniques. We propose in this paper a methodology to integrate the black- and white-box techniques. The black-box technique is used to select test cases. The white-box technique is mainly applied to decide whether two objects resulting from the program execution of a test case are observationally equivalent. It is also used to select test cases in some situations.

We define the concept of a fundamental pair as a pair of equivalent terms that are formed by replacing all the variables on both sides of an axiom by normal forms. We prove that an implementation is consistent with respect to all equivalent terms if and only if it is consistent with respect to all fundamental pairs. In other words, the testing coverage of fundamental pairs is as good as that of all possible term rewritings, and hence we need only concentrate on the testing of fundamental pairs. Our strategy is based on mathematical theorems. According to the strategy, we propose an algorithm for selecting a finite set of fundamental pairs as test cases.

Given a pair of equivalent terms as a test case, we should then determine whether the objects that result from executing the implemented program are observationally equivalent. We prove, however, that the observational equivalence of objects cannot be determined using a finite set of observable contexts (namely, operation sequences ending with an observer function) derived from any black-box technique. Hence we supplement our approach with a "relevant observable context" technique, which is a white-box technique, to determine the observational equivalence. The relevant observable contexts are constructed from a Data Member Relevance Graph, which is an abstraction of the given implementation for a given specification. A semi-automatic tool has been developed to support this technique.

1. This research is supported in part by grants of the Research Grants Council of Hong Kong, the Guangdong Province Science Foundation (#950618), and the Australian Research Grants Council. It is also supported in part by an academic exchange visitorship at the University of Melbourne.
2. Department of Computer Science, Jinan University
3. (Corresponding author.)
Department of Computer Science, The University of Hong Kong, Pokfulam, Hong Kong.
(Part of this research was done when the second author was an academic exchange visitor at the University of Melbourne.)
4. School of Professional and Continuing Education, The University of Hong Kong
5. Department of Computer Science and Software Engineering, The University of Melbourne


  Cumulative visitor count