Post on 06-Oct-2020
transcript
software evolution & architecture lab
Software Testing
Beat Fluri
Integration Testing
Dr. Beat Fluri © 2011
V-Model
2
User needs
System Spec
SubsystemDesign/Spec
UnitDesign/Spec
Unit
Subsystem
System
Delivery
Specification Implementation
Unit Test
Integration Test
Dr. Beat Fluri © 2011
Integration Testing
Integration testing is a search for components faults that cause intercomponent failures
Breaking up component isolation step-by-step
Integration strategyWhich components are the focus of the integration test?
In what sequence should component interfaces be exercised?
Integration testing in object-oriented development begins earlyWithin a class (integrating methods)
Within a class hierarchy (integrating superclasses)
Between a client and its server
Within a package (integrating classes)
... 3
Dr. Beat Fluri © 2011
Dependency Analysis
Integration strategy follows sequences in which components have to be tested
Dependency analysis among components is used to define the sequences
Dependency analysis: approachTake component diagram, e.g., UML class diagram
Make topology (i.e., directed graph) of the dependencies
4
Dr. Beat Fluri © 2011
Dependency Analysis
5
CC C
P
A S
O M
CP
*
*
* *
Dr. Beat Fluri © 2011
Dependency Analysis
6
S
M CP
O A
CC
CP
depends on
Dr. Beat Fluri © 2011
Big Bang Integration
Demonstrate stability by attempting to exercise an entire system with a few test runs
Integrate all components at onceMonolithic system
Components tightly coupled
No doubles are necessary
ProblemsFault locations are difficult to find
Big bang test suites are usually to small to reveal all interface faults
Try to avoid big bang integration!
7
Dr. Beat Fluri © 2011
Big Bang Integration
8
S
M CP
O A
CC
CP
Driver
Dr. Beat Fluri © 2011
Bottom-up Integration
Demonstrate stability by adding components to the system under test in uses-dependency order, beginning with components having the fewest dependencies
ApproachTest leaf components in dependency graph with drivers for each leaf. Use doubles when necessary
Repeat: test components on the next level; until the entire system is tested
9
Dr. Beat Fluri © 2011
Bottom-up Integration
10
S
M CP
O A
CC
CP
Driver
Dr. Beat Fluri © 2011
Bottom-up Integration
11
S
M CP
O A
CC
CP
Driver
Driver
Dr. Beat Fluri © 2011
Bottom-up Integration
12
AdvantagesEarly integration of leaf components
Parallel development on components in subtrees of dependency graph
Reduces the number of doubles (only for cycles)
DisadvantagesMany drivers have to be developed
Interaction testing is limited to collaborations implemented in the component (root of subtree)
Postpones checking critical control interfaces and collaborations until the end (root of dependency graph)
Dr. Beat Fluri © 2011
Top-down Integration
Demonstrate stability by adding components to the system under test in control hierarchy order, beginning with the top level control objects
ApproachTest component(s) at the highest level first. Use doubles for lower level components
Continue in a breath-first order at each level in the dependency graph until all components are integrated
13
Dr. Beat Fluri © 2011
Top-down Integration
14
S
M CP
O A
CC
CP
Driver
Dr. Beat Fluri © 2011
Top-down Integration
15
S
M CP
O A
CC
CP
Driver
Driver
Dr. Beat Fluri © 2011
Top-down Integration
16
AdvantagesEarly demonstration of end-to-end functionality
Fewer drivers necessary than with bottom-up integration
Test cases can be reused to drive lower-level tests
DisadvantagesDevelopment and maintenance of doubles
Test cases in high-level components may not be sufficient for lower-level components
Dr. Beat Fluri © 2011
Collaboration Integration
Demonstrate stability by adding sets of components to the system under test that are required to support a particular collaboration
ApproachMap collaborations onto the dependency graph
Choose a sequence in which to apply testing on collaborations
Test collaboration in the chosen sequence
17
Dr. Beat Fluri © 2011
Collaboration Integration
18
O
S
M CP
A
CC
CP
Dr. Beat Fluri © 2011
Collaboration Integration
19
O
S
M CP
A
CC
CP
Driver
Dr. Beat Fluri © 2011
Collaboration Integration
20
S
M CP
O A
CC
CP
Driver
Dr. Beat Fluri © 2011
Collaboration Integration
21
O
S
M CP
A
CC
CP
Driver
Dr. Beat Fluri © 2011
Collaboration Integration
22
AdvantagesFew drivers and doubles necessary
Focus on end-to-end functionality; useful for system scope testing
Reuse of collaboration integration test suite for system test
DisadvantagesInter-collaboration may not be tested thoroughly
Participants in a collaboration are not exercised separately (big bang)
Probably many doubles for testing initial collaborations
Dr. Beat Fluri © 2011
Backbone Integration
Combination of top-down integration, bottom-up integration, and big bang integration to verify interoperability among tightly coupled subsystems
Used, for instance, for embedded system applicationsBackbone provides services that are essential for running tests and the application
Creating doubles for the entire backbone would be impractical
ApproachTest each component in backbone in isolation and do a bottom-up integration or big bang integration of the backbone
Do a top-down integration on the application control components
23
Dr. Beat Fluri © 2011
Backbone Integration
24
Backbone
To
p-d
ow
n I
nte
gra
tio
nB
ott
om
-up
In
teg
ratio
n
Dr. Beat Fluri © 2011
Backbone Integration
25
AdvantagesMitigates the disadvantages of top-down and bottom-up integration
DisadvantagesDoubles and drivers are necessary