Page 233 -
P. 233

216   Chapter 8   Software testing




                            Path testing

                     Path testing is a testing strategy that aims to exercise every independent execution path through a component
                     or program. If every independent path is executed, then all statements in the component must have been
                     executed at least once. All conditional statements are tested for both true and false cases. In an object-oriented
                     development process, path testing may be used when testing the methods associated with objects.
                                   http://www.SoftwareEngineering-9.com/Web/Testing/PathTest.html

                                      Whittaker’s book (2002) includes many examples of guidelines that can be used
                                    in test case design. Some of the most general guidelines that he suggests are:

                                      Choose inputs that force the system to generate all error messages;
                                      Design inputs that cause input buffers to overflow;
                                      Repeat the same input or series of inputs numerous times;

                                      Force invalid outputs to be generated;
                                      Force computation results to be too large or too small.

                                      As you gain experience with testing, you can develop your own guidelines about
                                    how to choose effective test cases. I give more examples of testing guidelines in the
                                    next section of this chapter.


                             8.1.3 Component testing

                                    Software components are often composite components that are made up of several
                                    interacting objects. For example, in the weather station system, the reconfiguration
                                    component includes objects that deal with each aspect of the reconfiguration. You
                                    access the functionality of these objects through the defined component interface.
                                    Testing composite components should therefore focus on showing that the compo-
                                    nent interface behaves according to its specification. You can assume that unit tests
                                    on the individual objects within the component have been completed.
                                      Figure 8.7 illustrates the idea of component interface testing. Assume that compo-
                                    nents A, B, and C have been integrated to create a larger component or subsystem.
                                    The test cases are not applied to the individual components but rather to the interface
                                    of the composite component created by combining these components. Interface errors
                                    in the composite component may not be detectable by testing the individual objects
                                    because these errors result from interactions between the objects in the component.
                                      There are different types of interface between program components and, conse-
                                    quently, different types of interface error that can occur:


                                    1.  Parameter interfaces These are interfaces in which data or sometimes function
                                        references are passed from one component to another. Methods in an object
                                        have a parameter interface.
   228   229   230   231   232   233   234   235   236   237   238