Chapter 11: Object-Oriented Software Engineering Integration and - - PDF document

chapter 11
SMART_READER_LITE
LIVE PREVIEW

Chapter 11: Object-Oriented Software Engineering Integration and - - PDF document

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


slide-1
SLIDE 1

Page 1

Using UML, Patterns, and Java

Object-Oriented Software Engineering

Chapter 11: Integration and System Testing

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2

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 3

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

slide-2
SLIDE 2

Page 2

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4

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

VIP Seat Interface (in Vehicle Subsystem) Seat Implementation Stub Code Real Seat Simulated Seat (SA/RT)

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5

Example: Three Layer Call Hierarchy

A B C D G F E Layer I Layer II Layer III

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6

Integration Testing: Big-Bang Approach

Unit Test F Unit Test E Unit Test D Unit Test C Unit Test B Unit Test A

System Test

Don’t try this!

slide-3
SLIDE 3

Page 3

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7

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 8

Bottom-up Integration

A B C D G F E Layer I Layer II Layer III

Test F Test E Test G Test C Test D,G Test B, E, F Test A, B, C, D, E, F, G

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9

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

slide-4
SLIDE 4

Page 4

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10

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 11

Top-down Integration Testing

A B C D G F E Layer I Layer II Layer III

Test A Layer I Test A, B, C, D Layer I + II Test A, B, C, D, E, F, G All Layers

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12

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.

slide-5
SLIDE 5

Page 5

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13

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 14

Exercise ch11-03-01

♦Specify a test plan for the following

components using a bottom-up testing strategy

♦Specify a test plan using a bottom-up testing

strategy

J I H G F E D C B A