O'Reilly logo

A Practical Guide to Testing Object-Oriented Software by David A. Sykes, John D. McGregor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing Abstract Classes

We usually expect the root class of an inheritance hierarchy—and even some of its direct descendents—to be abstract. In this section, we discuss possible ways of testing abstract classes, such as Sprite and MovableSprite. Execution-based testing of classes requires that an instance of the class be constructed. Most object-oriented programming languages, including C++ and Java, support syntax for identifying abstract classes. Language semantics generally preclude instances of abstract classes from being created. This presents a problem for testing because we cannot create the instances we need. We have identified some different approaches to testing abstract classes. Each has strengths and drawbacks. We present these approaches ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required