Professional Documents
Culture Documents
Topic: Unit Testing and Integration Testing
Topic: Unit Testing and Integration Testing
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.
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.
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.