Why Should Integration Testing Excite You?

Why Should Integration Testing Excite You?

Integration testing assesses an app’s components on a broader level than unit testing. The main difference between integration testing and unit testing is that integration testing often includes application’s infrastructure components like database, file system, etc. When we work with unit tests, we mock these infrastructure components. These are then called fake or mock objects. But with integration testing, we want to ensure that the whole app is working as expected w  ith all these components combined together.

Integration tests ensure that an app’s components function correctly at a level that includes the app’s supporting infrastructure, such as the database, file system, network appliances and request-response pipelines.

Integration tests

  • Require more code and processing and therefore
  • Longer to run
  • Uses the actual components that the app uses in production

Integration tests should be limited in their usage to the most important use cases of infrastructure. If we could use either of the two types of tests for testing a behavior, we should go for the unit test for doing this.

As a rule, a normal project on software contains multiple modules which are integrated together to work as a single unit. Several of these modules are built by different programmers working in a team or even in different teams. Integration testing shows the team how well these disparate elements work together. After all, each unit may function perfectly on its own, but the pressing question is, “But can they be brought together and work smoothly?”

So, integration testing is the way we find out if the various parts of a software application can play well with others!

In discussions of integration tests, the tested project is frequently called the System Under Test, or “SUT” for short.

Why Perform Integration Testing?

Photo Courtesy: guru99.com

Apart from the fact that developers must test all software applications before deploying them to the production, there are some specific reasons for performing integration testing.

Integration testing is complex and requires some development and logical skill. That’s true! Then what is the purpose of integrating this testing into our testing strategy?

Here are some reasons:

  1. In the real world, when applications are developed, it is broken down into smaller modules and individual developers are assigned 1 module. The logic implemented by one developer is quite different than another developer, so it becomes important to check whether the logic implemented by a developer is as per the expectations and rendering the correct value in accordance with the prescribed standards.
  2. Many a time the face or the structure of data changes when it travels from one module to another. Some values are appended or removed, which causes issues in the later modules.
  3. Modules also interact with some third party tools or APIs which also need to be tested that the data accepted by that API / tool is correct and that the response generated is also as expected.
  4. A very common problem in testing – Frequent requirement change! 🙂 Many a time developer deploys the changes without unit testing it. Integration testing becomes important at that time.

Advantages of Integration Testing

  • Integration testing ensures that every integrated module functions correctly
  • Integration testing uncovers interface errors
  • Testers can initiate integration testing once a module is completed and doesn’t require waiting for another module to be done and ready for testing
  • Testers can detect bugs, defects, and security issues
  • Integration testing provides testers with a comprehensive analysis of the whole system, dramatically reducing the likelihood of severe connectivity issues
  • Integration testing can be started once the modules to be tested are available. It does not require the other module to be completed for testing to be done, as Stubs and Drivers can be used for the same.

Challenges of Integration Testing

Unfortunately, integration testing has some difficulties to overcome as well.

  • If testing involves dealing with two different systems created by two different vendors, there will be questions about how these components will affect and interact with each other
  • Integrating new and legacy systems demands many testing efforts and potential changes
  • Integration testing becomes complex due to the variety of components involved (e.g., platforms, environments, databases)
  • Integration testing requires testing not only the integration links but the environment itself, adding another layer of complexity to the process

Example of Integration Test Case

Integration Test Case differs from other test cases in the sense it focuses mainly on the interfaces & flow of data/information between the modules. Here priority is to be given for the integrating links rather than the unit functions which are already tested.

Sample Integration Test Cases for the following scenario: Application has 3 modules say ‘Login Page’, ‘Mailbox’ and ‘Delete emails’ and each of them is integrated logically.

Here do not concentrate much on the Login Page testing as it’s already been done in Unit Testing. But check how it’s linked to the Mail Box Page.

Similarly Mail Box: Check its integration to the Delete Mails Module.

Test Case IDTest Case ObjectiveTest Case DescriptionExpected Result
1Check the interface link between the Login and Mailbox moduleEnter login credentials and click on the Login buttonTo be directed to the Mail Box
2Check the interface link between the Mailbox and Delete Mails ModuleFrom Mailbox select the email and click a delete buttonSelected email should appear in the Deleted/Trash folder

 

Follow Me Here

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.