Integration Testing

Integration Testing

We had discussed about Unit Testing in the last session, and We are going to discuss about Integration Testing in this session. But before we discuss about Integration, We must know about Levels of Testing, and We have already discussed about Levels of Testing in our previous session.

Just to give a Summary on Different Levels of Testing. There are 4 different Levels of Testing

Different Levels of Testing

  1. Unit Testing
  2. Integration Testing
  3. System Testing
  4. UAT (User Acceptance Testing)

Unit Testing has already been discussed in the previous session, So we will discuss about Integration Testing in this session.

What is Integration Testing

Integration Testing is the 2nd level of Testing in a Software Development Life Cycle (SDLC).

This is performed after Unit Testing is completed.

Integration Testing is a type of Testing where 2 or more then 2 Units or Components of a Software are integrated together and then tested.

Or We can say that Integration testing is a software testing technique that focuses on testing the interactions and integration between different components or modules of a system.

So, We Test the Compatibility of the 2 Components or Units of the Software with each other.

Integration Testing is also called, System Integration Testing.

Example of Integration Testing

Example 1

Let’s take an example of a Car. There will be a lot’s of components in the Car like Wheels, Engine, Steering, Speedometer, Tyre, Accelerator, Breaks, Clutch etc.

The First thing that has to be done, is Unit Testing on all these Components or Units and once the Unit Testing is done, then the Integration Testing should be done and see if it is passed.

In Integration Testing, We have to integrate 2 or more Units together and we have to Test them, So let’s say

Accelerator was working fine when Unit Testing was done and Wheels were working fine when Unit Testing was done, But let’s say We want to test that when we press Accelerator, then the Wheels are moving or not. So this type of testing is called Integration Testing, because we are doing this testing on 2 Units together.

Same way if we want to test the Accelerator and Speedometer together, then we should check that when we press Accelerator, then the speedometer should show the speed properly, So here also we are testing 2 Units together, So this is also called Integration Testing.

Now If we want to test the Accelerator, Wheels and Speedometer together, then we should check that when we press Accelerator, then the speedometer should show the speed properly and the Wheels should start moving. So, Here we are testing 3 Units together, So this is also called Integration Testing.

Example 2

Let’s take an example of an eCommerce Website, which has different Modules such as User Registration, Sign In, Product Browsing, Product Search, Product List Page, Product Details Page, Checkout Page, Payment Modules, Order Confirmation Page.

So, When the Unit Testing was done on these Modules and these were found passed, then the Integration Testing takes place.

So, Let’s say that User Registration Module was working fine when tested as a Single Unit and Sign In Module was also working fine when tested as a Single Unit, But when we want to do Integration Testing between the 2 Modules, then we should check that after User Registration, are we able to login using the User, We have just created. This is how, Integration Testing between User Registration Module and Sign In Module is done.

Now, Let’s see an another example, where Product Search Module, Product List Page, and Product Details Page were working fine when tested as a single unit, So when we want to do Integration testing between these 3 Modules, then we can do it this way. We can search for a Product, then the Product List Page should display with a number of Products, and when we click on any of the Product in the Product List Page, then the Product Details Page should display with Product Details. This is how, Integration Testing between Search Module, Product List Page, and Product Details Page Module is done.

Example 3

Let’s take one more example of Calculator App. There are few Modules in Calculator like Addition, Subtraction, Multiplication and Division. So Suppose When we did Unit Testing for each Module, it was passed for all, So Now Integration Testing will take place.

So, If Unit Testing for Addition of 2 Numbers like (2+3, 3+4) worked fine and same way it worked for other Modules as well. Then we should start doing Integration Testing like Addition and Subtraction together, Addition and Multiplication together and so on.

So, If we try to do this operation -> 3+4-2. So, Here we are trying to test Addition and Subtraction together which is an example of Integration Testing.

If we try to do this operation -> 3*4-2. So, Here we are trying to test Multiplication and Subtraction together which is again an example of Integration Testing.

Importance of Integration Testing

Here are some reasons why integration testing is important:

  1. Identifying defects early: Integration Testing is just the 2nd level of Testing, So if we catch any defect during this stage, then we can say, it’s not too late and we have caught a defect early.
  2. Cost Effective : Integration Testing helps in catching defects early, So It is very less expensive and time-consuming to fix. So It is very Cost Effective to do Integration testing
  3. Enhancing confidence in the system: Unit Testing is the first step and Integration Testing is the 2nd step of Testing, Same way Unit developement is the first step and Integration of Units is the 2nd step of developement, So If the Unit testing is done properly and found all the Units are working fine and Integration Testing is done properly and found that the Integration of the Units is also working fine, then we can say that we will get less number of defects in System testing or the defects that we will find during System Testing phase, will not be related to Unit or Integration testing, It will be a System testing defect only. So this way, we can say that we will get more confidence in our System.
  4. Facilitating teamwork and collaboration: When we do Integration Testing, We have to do follow up with a lot’s of teams. We have to test Integrtaion between 2 or more than 2 Units, So we need to follow up with each team who was a part of developing a particular unit or finalizing the requirements for that particular Unit, So this way Integration Testing Facilitates Team work and collaboration.
  5. Improving maintainability: Unit testing helps in improving Code maintainability, the same way Integration Testing also helps in maintaining the System Properly. Integration Testing confirms data flow between the 2 Units is happening properly, and System remains stable when the 2 Units are integrated together.
  6. Testing Coverage increases – Testing Coverage increases because we are not just testing 1 Unit but We are Testing the Integration of Units and the data flow between the Units.

Limitations of Integration Testing

Here are some limitations of integration:

  1. Integration defects not Software Defects – We test integration between 2 or more Units in Integration Testing, but not the entire System, So the defects that we find during Integration might not be same defect, which end user might face while using the Application, and that’s why System Testing and User Acceptance Testing is required.
  2. Time Consuming in defect fixing – We test integration between 2 or more Units in Integration Testing, So when we find a defect, We need to find that the issue is with which Unit. for Example if we click on a Product on a Product List Page and then the Product Details Page doesn’t launch, then we need to find out that the issue is with Product List Page or with Product Details Page, which means Product list Page is not sending the proper information or Product Details page is not able to receive proper information from Product List Page. So, it somewhat takes more time to fix the issue as compared to Unit Testing.
  3. Less Time – Integration Testing can only be done when the Unit Testing is passed for all the Units, So Testing Team will have less time to do Integration Testing as compared to Unit Testing.
  4. Limited Scope – As We test integration between 2 or more Units in Integration Testing, but not the entire System, So the Scope of the Testing is somewhat limited as compared to System Testing and User Acceptance Testing, and that’s why System Testing and User Acceptance Testing is required.

Summary

We have covered below topics in the this session.

  1. Levels of Testing
  2. What is Integration Testing
  3. Example of Integration Testing
  4. Importance of Integration Testing
  5. Limitations of Integration Testing

Question

Let’s say that there is a Car Company, and they have done testing for Air Bags Separately, but didn’t do testing when the Air Bags were Integrated with the Car, Do you think, the Company has performed Unit Testing and Integration Testing, and what is the risk associated with this process ?

Leave a Comment