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
Unit Testing has already been discussed in the previous session, So we will discuss about Integration Testing in this session.
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.
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.
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.
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.
Here are some reasons why integration testing is important:
Here are some limitations of integration:
We have covered below topics in the this session.
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 ?
Objects, Classes and Constructor in Javascript Classes and Objects A class in any programming language…
We will start from object oriented programming basics like What are different concepts in Object…
Why we can not over ride a Constructor This is a very important question, that,…
What is Arrow Function In the last session, We had discussed about Anonymous Function. Anonymous…
What is Anonymous Function Anonymous Function is a type of function which has no name…
What is Map, Reduce and Filter Map Filter and Reduce are higher order methods for…