Information and Software Technology 42 (11): 677-686 (2000) |
H.Y. Chen
3 , T.H. Tse 4 , and Yue Tang Deng 5
ABSTRACT |
Given an algebraic specification of a class of objects,
we define a fundamental pair as two equivalent
terms generated by substituting all the variables on both sides of an axiom by normal forms.
For any
implementation error in the class,
if it can be revealed by two equivalent terms in general,
it can also
be revealed by a fundamental pair.
Hence, we need only select test cases from the set of fundamental
pairs instead of equivalent pairs in general.
We highlight an algorithm for selecting a finite set of
fundamental pairs as test cases.
Further, by using the relevant observable contexts technique,
we
highlight another algorithm to determine whether the objects resulting from executing a fundamental
pair are observationally equivalent.
If not, it reveals an implementation error.
Using these algorithms,
we have constructed a system to test object-oriented programs at class-level.
We describe in detail the implementation of a prototype system,
including the data structure of
a Data member Relevant Graph (DRG) for the class,
the procedures for the construction and path
traversal of the DRG,
the generation and execution of relevant observable contexts on the objects
under test,
and the reporting of implementation errors.
The implementation illustrates an innovative
idea of embedding testing algorithms into an interpreter to facilitate software testing.
Keywords: |
1. | This research is supported in part by the Guangdong Province Science Foundation under Grants #980690 and #950618, the Research Grants Council of Hong Kong, the National Natural Science Foundation of China under Grant No. 69873020, and the University Research Committee of The University of Hong Kong. | ||
2. | The ROCS system is part of the Black and White project. If we regard "Black and White" as a Scotch Whiskey, it will be nice to have it "on the ROCS". | ||
3. | Department of Computer Science, Jinan University. | ||
(Part of the work was done when Chen was on leave at The University of Hong Kong.) | |||
4. | (Corresponding author.) | ||
Department of Computer Science,
The University of Hong Kong,
Pokfulam, Hong Kong.
Email: |
|||
(Part of the work was done when Tse was on leave at the Vocational Training Council, Hong Kong.) | |||
5. | Department of Computer Science, Polytechnic University, Brooklyn, NY. | ||
(Part of the work was done when Deng was with Jinan University, China.) |
EVERY VISITOR COUNTS: |