Integration
Testing
PHAN THI HONG
2021
Tài liệu được lưu hành theo giấy phép Creative Commons Attribution-NonCommercial 4.0 International
Lecture Examine the basic concepts of
Objectives integration testing and its approaches
2
What Is Integration Testing?
Integration testing is performed to detect defects in the interfaces
and interaction between integrated components or systems.
Integration Testing
Introduction to Integration
Testing
Strategies for Integration
Testing
Best Practices/Guideline
References
3
When Is Integration Testing Applied?
Integration Testing
Introduction to Integration
Testing
Strategies for Integration
Testing
Best Practices/Guideline
References
4
Goal and Importance of Integration Testing
Integration testing has two major goals:
to detect defects that occur on the interfaces of units;
Integration Testing to assemble the individual units into working subsystems and
finally a complete system that is ready for system test.
Introduction to Integration
Testing The importance of integration testing stems from three
Strategies for Integration reasons as outlined below:
Testing
Best Practices/Guideline Interface errors between modules created by different
References programmers and even by the same programmers are rampant.
Some modules are more error prone than other modules, because
of their inherent complexity.
Unit testing of individual modules is carried out in a controlled
environment by using test drivers and stubs.
5
Driver and Stub
Integration Testing
Introduction to Integration
Testing
Strategies for Integration
Testing
Best Practices/Guideline
References
Source: Roger S. Pressman, Software Engineering: A Practitioner's Approach 7th edition, p.458
6
Driver and Stub
A Driver is
a software module used to invoke a module under test and,
Integration Testing often, provide test inputs, control and monitor execution, and
report test results (IEEE, 1990)
Introduction to Integration most simplistically a line of code that calls a method and
Testing passes that method a value.
Strategies for Integration
Testing A Stub is
Best Practices/Guideline a computer program statement substituting for the body of a
References software module that is or will be defined elsewhere (IEEE,
1990)
or a dummy component or object used to simulate the behavior
of a real component (Beizer, 1990) until that component has
been developed.
7
Big Bang Integration Approach
Introduction
Considers the whole system as a subsystem.
Integration Testing Tests all the modules in a single test session.
Only one integration testing session.
Introduction to Integration
Testing Advantages
Strategies for Integration Low resources requirement
Testing Does not require extra coding
Best Practices/Guideline
Suitable for small systems
References
Disadvantages
Wait for all modules developed
Difficult to trace root cause of bugs
Hard to create test cases
8
Top-down Integration Approach
Top-down integration testing is an incremental approach to
construction of the software architecture.
Integration Testing Modules subordinate (and ultimately subordinate) to the main
control (main program) module are incorporated into the
Introduction to Integration structure in either a depth-first or breadth-first manner.
Testing
Strategies for Integration
Testing
Source: Roger S. Pressman, Software
Best Practices/Guideline Engineering: A Practitioner's Approach
7th edition, p.460
References
Depth-first approach Breadth-first approach
9
Steps for Top-down Integration
TOP-DOWN
Integration Testing Login
Introduction to Integration 1
Testing
Strategies for Integration List of
Stub
students
Testing
Best Practices/Guideline 2 3
References
Add Delete
Students Students
10
Top-down Integration Approach
Advantages
Fault localization is easier
Integration Testing Possibility to obtain an early prototype.
Introduction to Integration Critical modules are tested on priority; major design flaws
Testing could be found and fixed first.
Strategies for Integration Disadvantages
Testing
Best Practices/Guideline Throw-away code programming
References Late interaction tests between the main program, the
application layer and the hardware.
Difficult to create test cases
11
Bottom-up Integration Approach
Bottom-up integration testing, as its name implies, begins
construction and testing with atomic modules(i.e., components
at the lowest levels in the program structure).
Integration Testing
By moving in an opposite direction, the parent nodes are
Introduction to Integration replaced by throw-away codes (drivers) instead of the children.
Testing
Strategies for Integration Components are combined to
Testing form clusters 1, 2, and 3. Each
Best Practices/Guideline of the clusters is tested using a
References driver.
Components in clusters 1 and 2
are subordinate to Ma.
Drivers D1 and D2 are removed
and the clusters are interfaced
directly to Ma.
Source: Roger S. Pressman, Software Engineering: A
Practitioner's Approach 7th edition, p.462
12
Steps for Bottom-up Integration
Integration Testing Login
Introduction to Integration 3
Testing
Strategies for Integration List of
Driver
students
Testing
Best Practices/Guideline 1 2
References
Add Delete
Students Students
BOTTOM -UP
13
Bottom-up Integration Approach
Advantages
Fault localization is easier
Integration Testing No time is wasted waiting for all modules to be developed
unlike Big-bang approach
Introduction to Integration
Testing Less throw-away code programming
Strategies for Integration Disadvantages
Testing
Best Practices/Guideline Critical modules (at the top level of software architecture)
References which control the flow of application are tested last and may be
prone to defects.
Early prototype is not possible
Late to identify design errors
14
Sandwich Integration Approach
Sandwich integration testing combines top-down approach and
bottom-up approach.
Integration Testing Generally, higher level modules use a top-down approach
(stub)
Introduction to Integration
Testing Normally, lower-level modules use a bottom-up approach
Strategies for Integration (driver)
Testing Testing converges to the middle
Best Practices/Guideline
References
15
Steps for Sandwich Integration
TOP-DOWN
Login
Integration Testing
Introduction to Integration
Testing List of
Strategies for Integration students
Testing
Best Practices/Guideline
References
Add Delete
Students Students
BOTTOM -UP
16
Sandwich Integration Approach
Advantages
Top and bottom layers can be done in parallel
Integration Testing Integration is done as soon a component is implemented
Introduction to Integration Less stubs and drivers needed
Testing Easy to construct test cases
Strategies for Integration
Testing Disadvantages
Best Practices/Guideline Still requires throw-away code programming
References
Partial big bang integration
Hard to isolate problems
17
Best Practices/Guideline
First determine the integration test strategy that could be
adopted and later prepare the test cases and test data
Integration Testing accordingly. Integration is done as soon a component is
implemented.
Introduction to Integration
Testing Study the architecture design of the application and identify the
Strategies for Integration critical modules. These need to be tested on priority.
Testing
Best Practices/Guideline Obtain the interface designs from the architectural team and
References create test cases to verify all of the interfaces in detail.
Interface to database/external hardware/software application
must be tested in detail.
18
Best Practices/Guideline (cont.)
Always have the mock data prepared, prior to executing. Do
not select test data while executing the test cases.
Integration Testing
❑ Key units should be integrated first, key units may be:
Introduction to Integration Functional units of the system.
Testing Units with close relationships with others
Strategies for Integration
Testing Ensure the defects get fixed without side-effects.
Best Practices/Guideline
References Report integration test defects and store the defect reports.
19
❑ Roger S. Pressman, Software Engineering: A Practitioner's
Approach 7th edition, McGraw-Hill Companies, Inc., 2010:
Chapter 17, p.449 - p.480
Integration Testing
❑ Ilene Burnstein, Practical Software Testing - A Process-
Oriented Approach, Springer-Verlag New York Inc., 2003:
Introduction to Integration
Chapter 6 – section 6.8
Testing
Strategies for Integration
❑ Paul C. Jorgensen, Software Testing – A Craftman’s
Testing
Approach, 2002: Chapter 13
Best Practices/Guideline
References
❑ [Link] (accessed
on August 25th, 2021)
20