1 Integration-Testing-I
1 Integration-Testing-I
. Mohapatra
Prof. Durga Prasad
Professor
Dept.of CSE, NIT Rourkela
Introduction
• In the modular design of a software system where
the system is composed of different modules,
integration is the activity of combining the modules
together when all the modules have been prepared.
• Integration of modules is done according to the
design of software specified earlier.
• Integration aims at constructing a working software
system.
• But a working software demands full testing and
thus, integration testing comes into the picture.
Introduction cont …
•Why do we need integration testing? When all
modules have been verified independently, then why is
integration testing necessary?
6
Integration Testing
•Non incremental Approach
–Also known as big-bang integration
9
Types of incremental integration testing
1. Top-down integration
2. Bottom-up integration
10
Top-down integration Testing
• The strategy in top-down integration is to look
at the design hierarchy from top to bottom.
• Start with the high-level modules and move
downward through the design hierarchy.
• Modules subordinate to the top module are
integrated in the following two ways:
–Depth first integration
–Breadth first integration
11
Depth first integration
• In this type, all modules on a major control path
of the design hierarchy are integrated first.
• In the example shown in below figure, modules 1,
2, 6, 7/8 will be integrated first. Next, modules 1,
3, 4/5 will be integrated.
Breadth first integration
• In this type, all modules directly subordinate at
each level, moving across the design hierarchy
horizontally, are integrated first.
• In the example shown in previous figure, modules
2 and 3 will be integrated first.
• Next, modules 6, 4, and 5 will be integrated.
Modules 7 and 8 will be integrated last.
However, in practice, these two sequences of top-
down integration cannot be used every time. In
general, there is no best sequence, but the following
guidelines can be considered:
1. In practice, the availability of modules matters the
most. The module which is ready to be integrated, will
be integrated and tested first. We should not wait to
test it according to depth first or breadth first
sequence, but use the availability of modules.
2. If there are critical sections of the software, design
the sequence such that these sections will be added
and tested as early as possible. A critical section might
be a complex module, a module with a new algorithm
or a module suspected to be error prone.
3. Design the sequence such that the I/O modules are
added as early as possible, so that all interface errors
will be detected earlier.
Top-Down Integration Procedure
1. Start with the top or initial module in the software.
Substitute the stubs for all the subordinate modules of top
module. Test the top module.
2. After testing the top module, stubs are replaced one at a
time with the actual modules for integration.
3. Perform testing on this recent integrated environment.
4. Regression testing may be conducted to ensure that new
errors have not appeared.
5. Repeat steps 2-4 for the whole design hierarchy.
Example
Example cont…
Drawbacks of top-down integration
• Stubs must be prepared as required
• Stubs are often more complicated than
they appear
• Before the I/O functions are added, the
representation of test cases in stubs can
be difficult
Bottom-up Integration Testing
•The bottom-up strategy begins with the terminal or
modules at the lowest level in the software structure.
After testing these modules, they are integrated and
tested moving from bottom to top level.
•Since the processing required for modules
subordinate to a given level is always available, stubs
are not required in this strategy.
•Bottom-up integration can be considered as the
opposite of top-down approach.
•Unlike top-down strategy, this strategy does not
require the architectural design of the system to be
complete.
•Thus, bottom-up integration can be performed at an
early stage in the developmental process.
• It may be used where the system reuses and modifies
components from other systems.
Steps in bottom-up integration
1. Start with the lowest level modules (modules from which no
other module is being called), in the design hierarchy.
2. Look for the super-ordinate module which calls the module
selected in Step 1. Design the driver module for this super-
ordinate module.
3. Test the module selected in Step 1 with the driver designed in
Step 2.
4. The next module to be tested is any module whose
subordinate modules (modules it calls) have all been tested.
5. Repeat Steps 2 to 4 and move up in the design hierarchy.
6. Whenever, the actual modules are available, replace stubs and
drivers with the actual one and test again.
Example
Comparison between top-down and bottom-up testing
Issue Top-Down Testing Bottom-Up Testing
It discovers errors in high-level
Architectural High-level design is validated at a
design, thus detects errors at an early
Design later stage.
stage.
Since we integrate the modules from It may not be possible to show the
top to bottom, the high-level design feasibility of the design. However,
System slowly expands as a working system. if some modules are already built
Demonstration Therefore, feasibility of the system as reusable components, then it
can be demonstrated to the top may be possible to produce some
management. kind of demonstration.
28
Integration Testing Effort
•The integration testing effort is computed as the
number of test sessions.
• A test session is one set of test cases for a specific
configuration.
•The total number of test sessions in a decomposition-
based integration is computed as:
• Number of test sessions = nodes - leaves + edges
Summary
Discussed basics of different approaches for integration
testing.
Discussed decomposition-based integration in detail.
◦ Big bang integration
◦ Top-down integration
Breadth First Integration
Depth First Integration
◦ Bottom-up integration
◦ Sandwich integration
Explained how to compute the integration testing effort .
30
References
1. Rajib Mall, Fundamentals of Software Engineering,
(Chapter – 10), Fifth Edition, PHI Learning Pvt.
Ltd., 2018.
2. Naresh Chauhan, Software Testing: Principles and
Practices, (Chapter – 7), Second Edition, Oxford
University Press, 2016.
Thank You