Categories

Netsparker Web Application Security Scanner

What is difference between Unit Testing and Integration Testing?

In Software Development Life Cycle, normally software application does not developed by a single developer. The software application is divided into different modules and modules are allocated to different development teams. When a module is developed by developer and it is tested for functionality then it is known as Unit testing. Once all modules are developed and integrated with other modules then Integration testing is to be carried out to discover the issues arise when different modules are interacting with each other to build overall system.

Q. What is difference between Unit Testing and Integration Testing?

Unit Testing vs Integration Testing

Unit Testing Integration Testing
Unit testing is a type of testing to check if the small piece of code is doing what it is suppose to do. Integration testing is a type of testing to check if different pieces of the modules are working together.
Unit testing checks a single component of an application. The behavior of integration modules is considered in the Integration testing.
The scope of Unit testing is narrow, it covers the Unit or small piece of code under test. Therefore while writing a unit test shorter codes are used that target just a single class. The scope of Integration testing is wide, it covers the whole application under test and it requires much more effort to put together.
Unit tests should have no dependencies on code outside the unit tested. Integration testing is dependent on other outside systems like databases, hardware allocated for them etc.
This is first type of testing is to be carried out in Software testing life cycle and generally executed by developer. This type of testing is carried out after Unit testing and before System testing and executed by the testing team.
Unit testing is not further sub divided into different types. Integration testing is further divided into different types as follows:
Top-down Integration, Bottom-Up Integration and so on.
Unit testing is starts with the module specification. Integration testing is starts with the interface specification.
The detailed visibility of the code is comes under Unit testing. The visibility of the integration structure is comes under Integration testing.
Unit testing mainly focus on the testing the functionality of individual units only and does not uncover the issues arises when different modules are interacting with each other. Integration testing is to be carried out to discover the the issues arise when different modules are interacting with each other to build overall system.
The goal of Unit testing is to test the each unit separately and ensure that each unit is working as expected. The goal of Integration testing is to test the combined modules together and ensure that every combined modules are working as expected.
Unit testing comes under White box testing type. Integration testing is comes under both Black box and White box type of testing.

Conclusion:

Integration testing will help to verify the overall system after developing the different modules. When issues observed in the integration test, the unit testing results for specific functionality will help to fix the issue. As a result both Unit testing and Integration testing is equally important. In this we have seen the basic “What is difference between unit testing and integration testing?” I think I have addressed all major differences in this article.

To get software testing articles in your inbox click here to Subscribe with your email address or add you email address below. If you like the article please do share the article with your colleagues or share you experience in the comment below.

 

 

9 comments to What is difference between Unit Testing and Integration Testing?

  • Manju

    Thanks for sharing good info.

  • Shradhha

    Nice information, can you please send me the Difference between SRS, BRS, FRS

    Thanks in advance.
    Mandar

  • shammi

    Nice article, appreciated your work.

  • Yunchi

    Nice one. Thanks for the information.

  • Preeti Oza

    Article is very helpful. Before writing this article I was bit confused about terms, however now I am clear about the terms Unit Testing and Integration Testing.

    Thanks a lot,
    Preeti Oza

  • Keerthi

    Super Article. Appreciate your work. Very easy to undersatnd.Thanks a lot.

  • Jon

    very nice article.

  • Nilesh

    Such a good information cover in one page…

  • Prabu

    What are the differences among below? Kindly explain with an example.

    1. Unit Testing
    2. Functional Unit Testing
    3. Component Testing

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>