0% found this document useful (0 votes)
18 views

16 Integration Testing

Integration testing
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

16 Integration Testing

Integration testing
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

10/6/2023

Integration Testing
and
Integration Methodologies

Software Testing
(STE -22518)
CO 5 I

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule


1

Revision

 V Model
 Methods of testing :
 Static, Dynamic
 White Box, Black Box
 Levels of Testing
 Modular Software Architecture
 Calling Functions, Called Functions
 What is Unit ?
 What is Unit Testing ?
 How to design test cases for unit testing ?

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 2

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 1
10/6/2023

Business Acceptance
Requirements Testing

System System
BRS Testing
Requirements

Static High Level Integration


Black Box SRS
Design testing
Testing Dynamic
Black Box
HLD Low Level Component testing
Static Design Testing
Dynamic
White Box White Box
Testing LLD Unit testing
Coding
testing
Methods of Methods of Dynamic
Static Testing Source Executables testing
1. Inspections, Code Unit Testing, Component
2. Reviews, testing, Integration
testing, System Testing
3. Walk Through Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 3
and Acceptance Testing.

Ends in Large Installation Testing in user


test environment
Customer verifies all Acceptance
requirements testing

Quality
Verifies non functional
test requirements are
Ensures all functional satisfied
and non functional System
T testing
E requirements after
Function Verifies that functional
S system integration test requirements are
T satisfied
I Ensures that all
N components work Integration
G
together on integration testing
Logical
Organization of
testing.
Ensure that each ( Not necessarily
Unit Unit Unit
component works test test test how it‟s actually
as specified done! )
Code
Starts with Small Nishad Code
D Patel, Code Dhule
S.S.V.P.S's B. S. Deore Polytechnic, 4

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 2
10/6/2023

EXAMPLE
Consider a following software architecture
 Software is divided into
Modules modules
 But …. Module is not an
isolated entity
 Module under consideration
might be –
 Calling other module
 Getting Input from called
module
 Being called by another
module
 giving feedback to calling
module
 Module is not independent
Sub Programs (Units) of
 Can not be tested in
“Sort Numbers” module
isolation
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 6

Unit

 Software is made up of different units


 Forming a hierarchical architecture
 Each unit –
 fulfills some specific requirement
 By implementing design
 Can be defined as –
 Unit is the smallest building block of software system
 Smallest building block of software which can be compiled
independently
 It is the first piece of software system that is validated
 A unit = smallest testable software component
 For example -
 Objects and methods
 Procedures / functions in programs
 Subroutines / subprograms
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 7

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 3
10/6/2023

Unit Testing

 Unit consists of process and data


 Unit testing involves testing of structural elements like –
 Units – which are made up of programs
 Programs – which are made up of set of statements
 Statements – includes expressions and variables
 Variables – are used to represent data stored at specific
memory location
 Expressions –
 can be a) simple or b) compound
 involves data types (for e.g. integer, real)
 Involves operators ( for e.g. arithmetic operators +, - )

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 8

Unit Testing

 Unit testing evaluates –


 Syntax, semantics Done using Static White
Box testing techniques
 Compliance with coding standards like – desk checking,
 Programming Style walkthrough, inspections
 Next, each program is executed to test logic and conditions
(hence dynamic white box)
 Developer performs some quick checks by
 Executing a code (hence dynamic)
 Giving an input
 And observing the output
 Focus is on data and process

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 9

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 4
10/6/2023

Unit Testing Remember


V Model ??
 Before performing Unit Testing,
 Test cases are already developed based on low level design and
coding phase
 Techniques like – code coverage analysis, Cyclomatic complexity are
used to design test cases
 These Test cases includes –
Recall …
 Various input data conditions
 How input data is selected ? Statement, Branch and
 Input data is selected in such a way that Condition Coverage
it will ensure complete code coverage
 Complexity of code is also measured Cyclomatic Complexity
to find independent logical paths
 It will reveal the functional defects
 Test cases related to memory leaks are also included.
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 10

Unit Testing
 The most „micro‟ scale of Testing
 Each unit –
 is tested in isolation / separately / independently
 Objective :
 To ensures that every unit is working according to the user
requirements (functional requirement)
 To ensure that software meets baseline level of functionality prior
to integration and system testing
 It is the first piece of system to be validated
 Unit Testing is performed by Programmer
 A tester can help.

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 11

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 5
10/6/2023

Unit Testing
 Requires detailed knowledge of
 Specification
 the internal program design and
 code
 Not to be confused with debugging.
 Also known as component, module, or program testing

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 12

Why to perform Unit testing

 Unit testing focuses on smaller building blocks of


software system (rather than test the complete system at
once)
 Unit testing helps in finding out the errors in particular
module.
 Thus we can easily debug the code and fix the defect quickly
 Multiple modules can be tested simultaneously
 It offers parallelism into program testing process

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 13

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 6
10/6/2023

Integration testing
 System is made up of multiple modules
 Comprise of – software and hardware
 Integration testing involves –
1. Integration of Units to make a module
2. Integration of Modules to make a system
3. Integration of System with environmental components like –
 hardware, other third party software, networking etc.
 Such components are – varying in nature
 Starts at module level –
 when two independently tested units are available
 Ends at System level –
 when all module interfaces have been tested
 Final round of integration –
 Involves all components integrated together to form a system
 Called as Final Integration Testing or System Integration 20
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule

Calling Module, Called Module


Calling
Module

Modules
Called by
Calling Main
Module Program

Called Calling
Modules
Module

Called
Modules

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 21

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 7
10/6/2023

Why to test interfaces ?

 Interaction among
modules is complicated.
 Data may be lost during
interaction.
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 22

Integration Testing
 It mainly focuses on –
 Input / output protocols
 Parameter passing between different units / modules or system
 Architecture, construction of software
 Integration – is defined as –
 Set of interactions among components
 Integration testing – can be defined as
 Testing the interaction between the modules and
 Testing the interaction with other system externally
 Main objective – to test the interfaces between
different modules / systems
 Thus integration testing is a testing of Interfaces
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 23

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 8
10/6/2023

Why to perform Integration Testing ?

 It exposes inconsistency between modules


 Inconsistency such as – improper call or improper return
sequence)
 Data can be lost across interfaces
 When modules are combined together, may not produce
desired results
 Data types and their valid ranges may mismatch between the
modules
 Thus, Integration testing –
 Finds out defects caused by interfacing between the module
 Simultaneously integrating the module

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 24

Types of Interfaces
 Internal Interfaces –
 Provides communication across two modules within a product
 Communication is Internal to the product
 External Interfaces –
 Communication with components that are outside of the product
 For e.g. Components / products developed by Third party vendors,
solution providers
 For Integration Testing –
 knowledge of design, architecture, and usage is required

Testing of Internal Interfaces Testing of External Interfaces


Requires complete understanding of – Requires understanding of –
1. Architecture 1. The purpose of the interfaces
2. High level design 2. Why they are used ?
3. Impact of architecture and design on 3. How they are used by solution
software functionality providers?
4. How they are used by developers ?
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 25

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 9
10/6/2023

Challenges in Integration Testing

 Interfaces are
 very generic in nature
 Not limited to a specific application or language
 Some of the interfaces are explicit
 Are documented (e.g. in SRS, HLD)
 Some of the interfaces are implicit
 Some may not be documented.
 But known to developers, testers (for e.g. JDBC)
 This results in increase of permutations and combinations
of scenarios of usage of interfaces
 Thus complexity of interface testing also increases
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 26

Integration Testing Method / Approach

 In most of the cases –


 Black Box testing methods are used
 But when architecture, design do not clearly explain all
interfaces then –
 Tester need to refer code
 Then develop test cases
 So it could be white box also
 This approach is called as – Grey Box
 Black box and white box approaches are used to design test
cases
 Test cases from each approach are mixed

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 27

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 10
10/6/2023

Integration Methodologies

 Methodologies –
 Decides the order for integration testing
 i.e. – in what order interfaces need to be – integrated and then
tested
 These are –
1. Top – Down Integration
2. Bottom – Up Integration
3. Bi – Directional Integration
4. System Integration

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 28

These methodologies can be categorised as -

Call Graph
Based

Integration Path based Depth First


Methods Non
Top Down
Incremental
Integration
Decomposition Integration
Breadth First
based
Incremental Bottom Up
Integration Integration

Bi Directional
Integration
(Sandwich)

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 29

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 11
10/6/2023

Decomposition Based Integration


 In this method –
 It is assumed that all the
modules are unit tested in
isolation
 Interfaces among separately
tested modules are
considered for integration
testing
 Design is decomposed into functional  Node A is Calling to modules B, C, D.
components or modules  Node A – Calling Module
 As shown in fig.,  Node B, C, D – Called Modules
 Nodes – represents modules  Node B is calling to modules E, F, G
 Edges – represents interfaces  Node B – Calling Module
 Nodes on the last level are leaf  Node E, F, G – Called Modules
nodes Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 30

Types of Decomposition Based Integration

 Depending how modules


are integrated, these are
classified as –
 Non-Incremental Integration
 Incremental Integration
 Incremental Integration is
further classified into
 Top-Down Integration
 Depth First
 Breadth First
 Bottom-Up Integration
 Bi-Directional Integration

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 31

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 12
10/6/2023

Non Incremental Integration


 In this type of Integration testing
 Either – all untested modules are combined together and then
tested
 Or – all modules are unit tested first, then combined together
 It is also known as – Big Bang Integration testing
 But this method can not be adopted practically because –
1 1. It requires more work
If , all unit tested modules are integrated,
2 3 Then, For unit testing of each module 4
drivers (to replace 1, 2, 3, 6) and 7 stubs
6 4 5 (to replace 2, 3, 4, 5, 6, 7, 8) are required.
This count of stubs and drivers increases as size of
7 8 system increases.
Thus causing more work.
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 32

2. Actual Modules are not interfaced directly until the end


of the software system
3. It is difficult to find out the exact location of errors

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 33

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 13
10/6/2023

Incremental Integration Testing


 In this type of integration testing -
 One module is selected and unit tested
 It is then integrated with another unit tested module
 Both modules, after integration, are tested again
 Incrementally, keep on adding modules and test the combinations (so
called as incremental integration testing)
 Thus an integrated and tested system is achieved at the end.
 Benefits of Incremental testing
1. It does not require many stubs and drivers
2. Interface errors are detected earlier
3. Easy to find out exact location of errors.
 Thus debugging becomes easy
4. It is more thorough testing
 As we keep on adding unit tested modules one by one, previously tested
modules are tested again and again
 This exposes more errors
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 34

Challenges with Incremental Testing

 All the modules may not be ready at the time of integration


 Can not be adopted in pure form
 It suffers from problem of serially combining the methods
according to design

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 35

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 14
10/6/2023

1. Top Down Integration


I
N
T Assume that –
E
G
Components are
R developed and made
A available in the order
T
I mentioned by
O component numbers
N

 Integration testing
 Starts from – topmost module
 Ends at – bottom most module
 Integration starts – with testing the interface between
component 1 and component 2
 To complete the testing, all interfaces, covering all arrows,
need to be tested together
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 36

Order in which
interfaces are tested

Sub Systems
(Indicated in Step
4, 6, 8)
Is a set of
components and
Step Interfaces Tested
their related
interfaces 1 1–2
Sub system – 2 1–3
delivers functionality 3 1–4 Sub System
without expecting 4 1–2–5
the presence of
5 1–3–6
other components
Sub system – can 6 1–3–6–(3–7)
work independently 7 1 – 2 – 5 – (( 1 – 3 – 6 ) – ( 1 – 3 – 7 ))
It makes integration 8 1–4–8
testing easier 9 1 – 2 – 5 – (( 1 – 3 – 6 ) – ( 1 – 3 – 7 )) – ( 1 – 4 – 8 )
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 37

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 15
10/6/2023

Different methods of traversing

 Breadth First
 Component order such as –
 1 -2 , 1 – 3, 1 – 4 will be tested first
 Then components 5, 6, 7, 8 are integrated with previously tested
components and tested
 Depth First
 Component order such as –
 1 – 2 – 5, 1 – 3 – 6, 1 – 3 – 7, 1 – 4 – 8 will be followed
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 38

Drawbacks of Top Down Integration testing

 In practice, modules are rarely made available in expected


sequence
 Modules which are available first are tested first
 Therefore
 For testing, Stubs must be prepared as required
 Stubs are often more complicated than they appear
 Representation of test cases in stubs can be different

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 39

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 16
10/6/2023

2. Bottom Up Integration
I
N
T
E
G
R
A
T
I
O
N

 Integration
 starts from bottom most module - „Component 1‟
 Progresses towards tops and covers all sub systems and
 Ends at top most module - „Component 8‟
 Assume that components are received for testing in the
order of their number
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 40

Order in which
interfaces are
tested

Step Interfaces Tested


1 1–5
2 2–6
3 3–6
4 2–6–(3–6)
5 4–7
6 1–5–8
7 2–6–(3–6)–8
8 4–7–8
9 1 – 5 – 8 – ( (2 – 6 – ( 3 – 6 ) – 8 ) – ( 4 – 7 – 8 ))
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 41

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 17
10/6/2023

 Bottom Up Integration can be performed at an early


stage of development process
 This strategy does not require the architectural design of
the system to be complete
 It may be used where –
 System reuses and modifies components from other systems
 It is useful for – Integrating
 Object – oriented Systems
 Real – time Systems
 Systems where strict performance is required
 Stubs are not required
 Drivers are required
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 42

Drawbacks

 The software as a whole system does not exist until the


last module is added
 It is not an optimal strategy as – most important
subsystem is tested at last

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 43

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 18
10/6/2023

3. Bi Directional Integration
(Sandwich Integration)

 It is a combination of top-down and bottom-up integration


 Assume that components are received in the order mentioned
by component numbers
 Assume that, components 6,7 and 8 are not yet available for
testing

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 44

 Individual components – 1, 2, 3, 4, 5 are tested in isolation


 Then Bi Directional Integration is performed
 To test interaction of 1 with 6,7,8 (Top Down Integration)
 Stubs are used to replace component 6, 7, 8
 To test interaction of 2 with 6, 3 with 7, 4 with 7 and 5 with 8
(Bottom Up Integration)
 Drivers are used to replace component 6, 7, 8
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 45

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 19
10/6/2023

 After functionality of these modules is tested, they are


integrated
 On integration, stubs and drivers are not required and
hence are discarded
 When components 6,7, and 8 are available, integration
focuses only on these components

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 46

Order of Integration

Step Interfaces Tested


1 2–6
2 3 – 7, 4 – 7
3 5–8
4 1 – 6, 1 – 7, 1 - 8
5 ( 1 – 6 – 2 ) – (( 1 – 7 – 3 – ( - 4 ) ) – ( 1 – 8 – 5 )

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 47

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 20
10/6/2023

Another possibility is …
Component 4

Component 1 Component 2 Component 3

Component 5 Component 6 Component 7 Component 8

Suppose, components 1, 2, 3 are received earlier than other


modules……
 Component 4 is replaced with driver and bottom up integration
of 1 – 4, 2 – 4, 3 – 4 is carried out
 Component 5, 6, 7, 8 are replaced with Stub and Top Down
integration of 1 – 5, 2 – 6, 2 -7, 3 – 8 is carried out
Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 48

4. System Integration

 All the components of the system are integrated and


tested as a single unit
 Testing is delayed till arrival of all components
 Only one round of integration testing is carried out
 It reduces testing efforts and duplication in testing
 Advantages
 It is suitable for systems where majority of components are
already available and stable
 It reduces testing efforts and duplication in testing

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 49

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 21
10/6/2023

 Drawbacks
 Difficult to exactly locate the problem
 Correcting the root cause of defect is difficult
 May have to make compromise on software quality as –
 Integration happens in the end SO it delay the release of the product
 If product is to be released on release date, then testing is
compromised and thereby quality
 Certain components may require excessive amount of time for
development
 Thus wasting time

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 50

Guidelines for
selecting integration methods
Sr. Suggested
Factors
No. Integration
1 Clear requirements and design Top Down
2 Dynamically changing requirements, Bottom Up
design, architecture
3 Changing architecture, Bi – Directional
stable design
4 Limited changes to existing Big Bang
architecture with less impact
5 Combination of above Select any one of
the above after
careful analysis

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 51

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 22
10/6/2023

Nishad D Patel, S.S.V.P.S's B. S. Deore Polytechnic, Dhule 52

Nishad D Patel, S.S.V.P.S's B. S. Deore


Polytechnic, Dhule 23

You might also like