Chapter 7: Implementation Issues

In Chapter 2 we looked at how you would find the use cases that dictate the set of requirements for your software, and in Chapter 3 we went on to discover how to create the object model that describes the objects and their implementation. We now turn to the issue of implementing these objects in code.

The interfaces of the classes you design offer a contract specifying their behavior. This behavior may be implemented most easily in an object-oriented programming language such as C++. If done correctly, the code ensures and enforces the contracts offered by the class interfaces.

Writing reliable and robust C++ is an exercise in realizing these contracts in the code itself. You will use a variety of techniques to ensure that your implementation corresponds to the commitments described in your design. These techniques include:

Each object you create must be testable as a stand-alone entity, and all of the interactions among the objects, described in your sequence and collaboration diagrams, must be testable and verified before the product is shipped. At each level of abstraction you must be able to describe, test and verify the interactions among the objects and components of your design.

The use cases become the foundation of your testing, providing scenarios which must be examined in detail, looking at every possible interaction between the system and the user and probing for conditions under which the product might fail.

Building a reliable and robust product requires planning and extensive testing. It is not possible to begin this work once the programming is completed; the testing must be "cooked in" to the product from the very beginning. Test planning begins with the creation of use-cases and tracks along with the implementation from the first lines of code.

© 1998 by Wrox Press. All rights reserved.