Chapter 23 Object-Oriented Testing

Overview

This chapter discusses the testing of object-oriented systems. The process of testing object-oriented systems begins with a review of the object-oriented analysis and design models. Once the code is written object-oriented testing (OOT) begins by testing "in the small" with class testing (class operations and collaborations). As classes are integrated to become subsystems class collaboration problems are investigated. Finally, use-cases from the OOA model are used to uncover software validation errors. OOT similar to testing conventional software in that test cases are developed to exercise the classes, their collaborations, and behavior. OOT differs from conventional software testing in that more emphasis is placed assessing the completeness and consistency of the OOA and OOD models as they are built. OOT tends to focus more on integration problems than on unit testing. The test plan specification template from the SEPA web site is applicable to object-oriented testing as well.

 

Object-Oriented Testing Activities

 

Testing OOA and OOD Models

 

Assessing the Class Model

  1. Revisit the CRC model and the object-relationship model
  2. Inspect the description of each CRC card to determine if a delegated responsibility is part of the collaborator's definition
  3. Invert the connection to ensure that each collaborator that is asked for service is receiving requests from a responsible source
  4. Using the inverted connections from step 3, determine whether other classes might be required or whether responsibilities are properly grouped among classes
  5. Determine whether widely requested responsibilities might be combined into a single responsibility
  6. Steps 1 to 5 are applied iteratively to each class and through the evaluation of the OOA model

 

Object-Oriented Testing Strategies

 

Test Case Design for OO Software

 

OO Test Design Issues

 

Class Level Testing Methods

 

Inter-Class Test Case Design