Chapter 11: Object-Oriented Software Engineering Integration and System Testing Using UML, Patterns, and Java Podcast Ch11-03 ♦ Title : Integration Testing ♦ Description : Strategies for Integration Testing, Bottom-up Testing, Top-down Testing ♦ Participants : Barry Kurtz (instructor); Brandon Winters, Sara Hyde, Cheng Vue, Dan Baehr (students) ♦ Textbook : Object-Oriented Software Engineering: Using UML, Patterns and Java by Bernd Bruegge and Allen H. Dutoit Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2 Integration Testing Strategy ♦ The entire system is viewed as a collection of subsystems (sets of classes) determined during the system and object design. ♦ The order in which the subsystems are selected for testing and integration determines the testing strategy � Big bang integration (Nonincremental) � Bottom up integration � Top down integration � Sandwich testing � Variations of the above ♦ For the selection use the system decomposition from the System Design Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3 Page 1
Using the Bridge Pattern to enable early Integration Testing ♦ Use the bridge pattern to provide multiple implementations under the same interface. ♦ Interface to a component that is incomplete, not yet known or unavailable during testing Seat Interface VIP Seat Implementation (in Vehicle Subsystem) Simulated Real Seat Stub Code Seat (SA/RT) Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4 Example: Three Layer Call Hierarchy A Layer I Layer II B C D G Layer III F E Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5 Integration Testing: Big-Bang Approach Unit Test A Don’t try this! Unit Test B Unit Test C System Test Unit Test D Unit Test E Unit Test F Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6 Page 2
Bottom-up Testing Strategy ♦ The subsystem in the lowest layer of the call hierarchy are tested individually ♦ Then the next subsystems are tested that call the previously tested subsystems ♦ This is done repeatedly until all subsystems are included in the testing ♦ Special program needed to do the testing, Test Driver: � A routine that calls a subsystem and passes a test case to it Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7 Bottom-up Integration A Layer I B C D Layer II Test E E F G Layer III Test B, E, F Test F Test Test C A, B, C, D, E, F, G Test D,G Test G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8 Pros and Cons of bottom up integration testing ♦ Bad for functionally decomposed systems: � Tests the most important subsystem (UI) last ♦ Useful for integrating the following systems � Object-oriented systems � real-time systems � systems with strict performance requirements Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9 Page 3
Top-down Testing Strategy ♦ Test the top layer or the controlling subsystem first ♦ Then combine all the subsystems that are called by the tested subsystems and test the resulting collection of subsystems ♦ Do this until all subsystems are incorporated into the test ♦ Special program is needed to do the testing, Test stub : � A program or a method that simulates the activity of a missing subsystem by answering to the calling sequence of the calling subsystem and returning back fake data. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10 A Top-down Layer I Integration Testing B C D Layer II F G E Layer III Test Test A Test A, B, C, D A, B, C, D, E, F, G Layer I Layer I + II All Layers Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11 Pros and Cons of top-down integration testing ♦ Test cases can be defined in terms of the functionality of the system (functional requirements) ♦ Writing stubs can be difficult: Stubs must allow all possible conditions to be tested. ♦ Possibly a very large number of stubs may be required, especially if the lowest level of the system contains many methods. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12 Page 4
Pros and Cons of top-down integration testing ♦ One solution to avoid too many stubs: Modified top-down testing strategy � Test each layer of the system decomposition individually before merging the layers � Disadvantage of modified top-down testing: Both, stubs and drivers are needed Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13 Exercise ch11-03-01 A B C D E F G H I J ♦ Specify a test plan for the following components using a bottom-up testing strategy ♦ Specify a test plan using a bottom-up testing strategy Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14 Page 5
Recommend
More recommend