Professional Documents
Culture Documents
ST L08 Integration Testing
ST L08 Integration Testing
Integration Testing
© 2016
Lecture Learning Objectives
Objectives
▪ Examine the goals of integration testing and its
approaches
Outcomes
▪ Understand what integration testing is and when it is
applied
▪ Know how to approach integration testing along with
advantages and disadvantages of each approach
2
Outline
3
08 | Integration Testing
5
Guiding Questions
6
What is Integration Testing?
Integration testing is
performed to detect
defects in the interfaces
and interaction between
integrated components or
systems.
7
When is integration testing applied?
8
Goal and Importance of Integration Test
Integration testing has two major goals:
10
A stub is:
Driver and Stub • a computer program statement
substituting for the body of a software
public class myCalculator { module that is or will be defined
//method under test elsewhere (IEEE, 1990)
public int Add(int iNum1, int iNum2) { }
}
• or a dummy component or object used to
simulate the behavior of a real
component (Beizer, 1990) until that
component has been developed.
14
Guiding Questions
15
Integration Testing Procedures
16
Plan for Integration Testing
When planning for integration testing, you should
consider the following questions:
1. What modules or objects should be assembled and tested
as a group?
2. What are the functional subassemblies?
3. What are the critical features?
4. How much testing is appropriate?
5. Are there any implementation-based testing objectives?
6. How much scaffolding code or test support code is
required?
7. How will problems be isolated?
8. How is testing coordinated with system and unit testing?
17
Plan for Integration Testing
18
Plan for Integration Testing
Entry criteria to integration testing phase in
any SDLC:
▪ Unit tested components/modules.
20
Design Integration Test Case
21
Design Integration Test Case
22
An Integration Test Case Example
TC TC Steps Expected
Objective Results
1 Check the 1.User inputs ‘test01’ for The screen of
interface Username and ‘1234’ for student list is
link Password. displayed with
between the 2.User clicks on Login button. default of 25
Login and items (added
List of newer is on the
Students top of list).
module.
23
An Integration Test Case Example
TC TC Steps Expected Results
Objective
2 Check the 1.User clicks on button Add on - Data is saved and
interface link screen of student list. screen of Add New
between the At the screen of Add New Student is closed.
List of Student: - Student A
Students and Nguyen Van is on
2.User inputs:
Add Student the top of list on
• First Name: A
module. the screen of
• Last Name: Nguyen Van
student list.
• Date of Birth: 12/04/1991
• Gender: Male
• Faculty: CNTT
3.User clicks on button Save
24
An Integration Test Case Example
TC TC Steps Expected
Objective Results
3 Check the 1.User selects student A Student A
interface Nguyen Van from the list of Nguyen Van is
link students. removed from
between the 2.User clicks on button the list of
List of Delete. students.
Students 3.User selects option Yes on
and Delete the confirmation message
Student box.
module.
25
Build Integration Testing Environment
▪ Interface simulators
26
Section Questions
▪ Best practices/Guidelines
29
Guiding Questions
Big bang approach: What does it mean? What are
advantages and disadvantages of this approach?
30
Big Bang Approach
Introduction
▪ Considers the whole system as a subsystem.
Login
▪ Tests all the modules in a single test session.
▪ Only one integration testing session.
List of
Advantages students
▪ Low resources requirement
▪ Does not require extra coding
Add Delete
▪ Suitable for small systems Students Students
Disadvantages
▪ Wait for all modules developed.
▪ Difficult to trace root cause of bugs
▪ Hard to create test cases
31
Top-down Integration Approach
32
Top-down Integration – Depth-first
3 3’
1. M1 M2 M5 M8 or M1 M2 M6
2. M1 M3 M7
3. M1 M4
33
Top-down Integration – Breadth-first
1. M2 M3 M4
2. M5 M6 M7
3. and so on, follows
34
Steps for Top-down Integration
1. The main control module is used as a test driver and stubs
are substituted for all components directly subordinate to
the main control module.
35
Steps for Top-down Integration
TOP-DOWN
Login
List of
Stub
students
2 3
Add Delete
Students Students
36
Top-down Integration Approach
Advantages
▪ Fault localization is easier.
Disadvantages
▪ Throw-away code programming
37
Bottom-up Integration Approach
38
Steps for Bottom-up Integration
39
Bottom-up Integration
Login
List of
Driver
students
1 2
Add Delete
Students Students
BOTTOM -UP
Figure 13.3 – Bottom-up integration approach
41
Bottom-up Integration Approach
Advantages
▪ Fault localization is easier.
Disadvantages
▪ Critical modules (at the top level of software architecture)
which control the flow of application are tested last and
may be prone to defects.
43
Sandwich Integration Approach
TOP-DOWN
Login
List of
students
Add Delete
Students Students
BOTTOM -UP
Figure 13.4 – Sandwich integration approach
44
Sandwich Integration Approach
Advantages
▪ Top and bottom layers can be done in parallel
Disadvantages
▪ Still requires throw-away code programming
45
Best Practices/Guideline
46
Best Practices/Guideline
47
Section Questions
What does big bang integration mean?
50
References
http://www.guru99.com/integration-testing.html
51
Questions & Answers
52