Topic: Unit Testing and Integration Testing

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Topic : Unit testing and integration testing.

1. Unit Testing:
 It is also called as component testing.
 Unit is a smallest part or module of the software application.
 It is executable code which gives some output.
 It is done to verify individual unit is working fine or not?
 To make sure unit is behave as per client requirement.
 This is done by developer.
 In this developer, test units not in details but using some condition and ensure unit is
performing properly.
 If defect is found,
I. It will be easy to fix the bug and required less time for fixing it.
II. Modification is also easy. (we need to modify only specific unit rather than whole system)

 Example: There is login page, home page, contact us page implemented in the application. Then
in unit testing only contact us page will be tested. To ensure its working as per functionality
before merge with other pages.

2. Integration testing:
 Units need to combine together for making entire application.
 In this, independent units which are tested in unit testing are integrated together to check the
behavior and functionality of module after integration
 The main objective of this testing is to identify defect between data flow of integrated units.
 Unit/ component integration testing :
 In this testing, we check data flow and interface between different units/ components of the
same application.
Example: After entering valid credential on login page. It navigates to home page and check
whether the profile is shown on dashboard.
 System integration testing:
 In this testing, we check data flow and interface between two different systems which are
depends on each other.
Example: While ordering any product on online shopping website, If there any offer for paytm
payment. Then after click on paytm option. It will navigate to paytm application page which
show the specific offer details rather showing the home page of the paytm application.

Approaches of Integration testing:


1. Incremental approach:
a. Top down incremental integration testing:
Module
Top module
A

Bottom Module Module Stub


module
B C Dummy module

Top down incremental integration testing

 Testing takes place from top to bottom. Integrating bottom level modules to the top
level modules to ensure the data flow between the modules is working properly.

 Stubs are used as a dummy module if a bottom level module is not ready for integration
testing.
 Ex:
Assume there is login, home page. Login page call the home page after login. Login page
is ready but the home page is not ready yet. To do the top down incremental integration
testing the developer writes dummy code (stub) which acts as home page. To check the
interface between login and home page is working properly.

a. Bottom up incremental integration testing:

Bottom up incremental integration testing

 This is reversal testing of top down incremental integration testing.

 Testing takes place from bottom to up. Integrating top level modules to the bottom level
modules to ensure the data flow between the modules is working properly.

 Drivers are used as a dummy module if a top level module is not ready for integration
testing.
 Ex:
Assume there is login, home page. Home page is ready but the login page is not ready
yet. To do the bottom up incremental integration testing the developer writes dummy
code (driver) which acts as login page. To check the interface between login and home
page is working properly.

2. Big Bang approach:


 In this approach, the team needs to wait until completion of all the modules. After
completion of all modules the integration testing is performed on them.
 If we get any defect then finding exact location of defect is difficult. Complexity is
high. Therefore this approach is not used in industry.
Big Bang approach

You might also like