Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Understanding Integration Testing with example

In this article we will discuss on integration testing. Stage two in testing after component testing. We start integration testing once the individual components are tested and it is the time to validate if they fit in with each other.

Best example to understand importance of integration testing is the jigsaw puzzle, and you will know the importance far better, if you put in lot of effort in solving the puzzle and due to few incorrect pieces, you failed to complete the picture.

The small pieces of jigsaw puzzle can be considered as the module or component. When all the pieces in the puzzles fit in together perfectly, it creates the image. In software terms, it can be considered as the software system. Integration of different modules is important to fit in the pieces together. Below diagram shows the flow in testing as discussed in above explanation.





So now we have the basic knowledge of Integration testing. Let us discuss on the different standard approach for the Integration testing. Below are the different approaches for integration testing and will try to explain the same in plain language.

  • Top down Approach – In this approach, the top modules is tested and integrated first. When we say the top modules are tested first. Two questions come in mind immediately.
    • How to test the top module when the individual modules that will be integrated to form the top module are not developed yet?

      • Answer to this, we use stubs for flow of data from top level to bottom level modules. Stubs acts as simulator to simulate behavior of lower level module which are not developed or integrated as yet. Expected Output from stub is the same as expected in case module would have been developed and integrated.

    • What is the purpose of integration testing using top down approach? 

      • Answer:  Using Top down approach allows high level logic and data flow to be tested early in the testing process. Testing the top module earlier helps to flow the logic from system to sub-module so that end result is in focus and information flow from top level to bottom.

 
  • Bottom up Approach –If we represent Bottom up and top down approach in a pictorial representation, Bottom up approach is just reverse of Top down approach. In this approach, we test the bottom modules first and move to the top modules. Till the time top modules are ready, we use driver to simulate the system flow.
  • Big Bang Approach – In this all the sub-modules are developed first and are integrated once all the module are developed instead of incremental approach as in above examples. Big Bang Approach can be used in case of smaller system. In Large system, the big bang approach probability of failing is very high.

We have discussed on what is integration testing, types of approaches in integration testing. Let us now summarize on integration testing.
  • What is integration testing –Testing Integrating and Interaction of different modules or Interfaces in the system.
  • Who Performs integration tests – Integration testing should be performed by developers before releasing the system to QA. Testers should also test the interaction between subsystems.
  • Bottom up and top down are example of incremental approach to integration testing.

Are there any references for further study? While studying for integration testing and advanced concept on same. I find following two articles interesting. Please read through for further details on the topic


Component Testing – First Testing in the Project

The first phase is testing the smallest testing unit developed in the Project. A unit can be defined as an isolated piece of code which can be tested independently.Let us take an example, suppose we have to develop an application for an e-commerce site with following requirement.

  • Login into System.
  • Home Page is displayed.
  • Selecting any product and adding to my cart.
  • Paying for the Product.

So In this example, we can divide the project development into following components or units.
  • Login Module.
  • Home Page Module.
  • Transaction Page.
  • View Cart Module.
  • Payment Module.

Before discussing on different testing type. Let us discuss how the development flow takes place. 
  • Development team will develop different modules or units of code.
  • The modules should be integrated successfully with rest of the modules
  • The System developed should be integrated with third party components or existing components.
  • The system should work as per requirement document.

As one of the principle of software testing, defects should be captured as early as possible in the software development life cycle. Since the first step in testing is testing the individual module developed. If the individual module has defect, fixing the same can be painful if captured in later stages of SDLC.Unit testing searches for defects in the testable unit or module as discussed. We need to focus on testing the functional features as well as non-functional characteristics.


Let us take the example of unit testing the login module. A login Page needs to be tested as shown below.

The functional test case for the unit will include:
  • Error Message on providing invalid username or Password.
  • Error Message for minimum and maximum allowed characters.
  • On providing successful username/Password, Home Page is displayed. 
  • Since Home Page is not yet created, we will use stubs and drivers to dummy for home Page.

The above are examples of functional test cases for components.
.

Component testing also includes non-functional characteristics including memory leaks, and structural testing for code coverage. Component testing is done mainly by Developers and is mostly white box testing specially for verification of non-functional validation. Defects are fixed as they are found as is mostly development defect uncovered during dev testing itself.


There are various tools and framework available for unit testing. Junit, testNG are example of framework available for unit testing. Another framework is Test Driven Framework, in which test scripts are prepared before coding. The tests are expected to fail before coding phase. Once Coding is done, all the unit tests are expected to pass. In case, test failing post development, code needs to be fixed until all the tests created for component passed.

Summarizing, all we discussed so far.


Component testing is testing the unit or component or module as an independent unit.
Component Testing is the first testing performed in the project.Component testing is performed mainly by developers.Component testing is more of white box testing on the code.Different Unit testing frameworks are available in the project.


Some Excellent reference article for detailed understanding of Component testing are as follows:


Functional and Non Functional Testing - Difference with Real life example

It is common in testing project to scope of testing in the project is to perform functional as well as non-functional testing in the project. It is important to understand the difference between the two to define strategies for each testing. Let me try to explain this with a simple example in daily life. Suppose I have to test the functional and non-functional requirement of a restaurant.
The functional requirement can be following

When a user enters the restaurant, he will be welcomed by the Staff.  User will place the order; Order will be delivered to User. Once user completes the dinner/lunch, he will pay either by cash or credit card. Staff will say goodbye to user once user exits from the restaurant.
The above is an example of functional requirement in real price, similar in software can be compared to an online e-commerce site.

The functional requirement will be broken down into functional test scenarios which can further be broken down into test cases ensuring all the requirement are covered using RTM (Requirement traceability matrix).

Now coming to the same example, Let us talk about the non-functional requirement in the same example.User will be very much influenced by time it takes from the time he places the order to time order reaches him. This is related to performance and efficiency aspect of requirement.

Similarly there can be security compromise, suppose I pay my bill by credit card and the staff instead of returning the bill with credit card to me, give it to some other customer, and the customer exits with my credit card and spends money from my card. This is an example of Security testing.

Let us take another example, suppose I ordered a dish which needs long cooking, Suppose the food is undercooked. Although I received what I ordered, the food is such that, if I eat it, It will take me one week to recover from its after effect. This is an example of usability testing.

As we see in the example, Non-Functional features (features that were not a part of functional requirement) are very important and needs to be properly tested to ensure the business success.
As in above example, If any one of the performance, security and usability of the restaurant does not meet the customer requirement, There is high probability, the customer will never visit the restaurant again, which will be a business loss to the restaurant.

The same example can be easily reciprocated in software projects. Therefore non-functional testing should be given proper priorities before releasing a project. How much to spend on non functional testing depends on which non-performance parameters are critical.

For e.g in a trading site, security testing should be preference, while in a search engine, e.g. google, the performance, load, stress testing are more important.


Some examples of Non functional includes:

  • Usability Testing
  • Security Testing
  • Performance testing
  • Load Testing
  • Stress testing
  • Scalability Testing
  • Data Integrity Testing
  • Interoperability Testing