The Problematics of Testing Object-Oriented Software

Within object-oriented approaches, testing has almost been ignored in favor of analysis, design, and coding. However, object-orientedness does not solve the problem of testing by itself and may even induce new problems. <p> Most work in testing has been done with "procedure-oriented" software in mind. Traditional methods, despite their efficiency, cannot be applied without adaptation to object-oriented systems. In an object-oriented system, the basic unit of testing is a class instead of a subprogram; testing should hence focus on classes and objects. Moreover, it is not possible to test the operations of a class in isolation, as they interact with each other by modifying the state of the object they are applied to. <p> Sometimes testing object-oriented software can benefit from object-oriented technology, for instance, by capitalizing on the fact that a superclass has already been tested, and by decreasing the effort to test derived classes, which reduces the cost of testing in comparison with a flat class structure. <p> The object-oriented paradigm can also be a hindrance to testing, due to the nature of some aspects of its very nature: encapsulation, inheritance and polymorphism. <p> In the presence of encapsulation, the only way to observe the state of an object is through its operations; there is therefore a fundamental problem of observability. Inheritance opens the issue of re-testing. Should operations inherited from ancestor classes be re-tested in the context of the descendant class? A case analysis will show that there is no definite answer. <p> Polymorphic calls are difficult to test. A test suite must ensure that all possible cases of bindings are covered. Moreover, when extending a software by a new derived class (programming by extension), calls with possible bindings to operations of this new derived class must be re-tested.

Ross, M.
Brebbia, C.A.
Staples, G.
Stapleton, J.
Published in:
SQM'94 Second Conference on Software Quality Management, Edinburgh, Scotland, UK, July 26-28 1994, 2, 411-426

 Record created 2005-09-20, last modified 2018-01-27

External link:
Download fulltext
Rate this document:

Rate this document:
(Not yet reviewed)