May 16, 2023

Integration Testing (Test Level)

Great job on starting a new lesson! After reading this lesson, click Next 👉 button at bottom right to continue to the next lesson.

Integration testing is a test level in software testing where individual units or components of your software system are tested together as a group. It focuses on testing the control and data flow between individual units or components of the software. For example, testing if the methods in the User class and the Home class work together correctly. Integration testing is typically performed after unit testing and before system testing.

Integration testing examples

  • Testing the interface between a login module and a user profile module. For example, testing if the login module validates the user credentials and allows the validated user to perform edits in the user profile page.
  • Testing the data exchange between a front-end application and a back-end database. For example, testing a form to submit data that can then be queried in the database.
  • Testing the interaction between a payment gateway and a bank API. For example, testing a token payment sent from the payment gateway to the bank.
  • Testing the functionality of a web service that integrates multiple microservices.
  • Tips for integration testing

    • Use your test plan to review the scope, strategy, tools and schedule of integration testing.
    • Use test drivers to run the integration test.
    • Use mocking and stubbing to simulate the behavior of missing or incomplete components.
    • Use incremental testing approaches, such as top-down, bottom-up, or sandwich, to integrate and test components gradually.
    • Use tools and frameworks, such as JUnit, TestNG, or Selenium, to organize and run your integration tests.

    FAQ (interview questions and answers)

    1. What is the main difference between integration testing and system testing?
      Integration testing tests the interactions, such as interfaces, control flow, data flow and exception flow, and dependencies, between individual components or modules of your software, while system testing tests the functionality and performance of the entire software system as a single system.
    2. What are test drivers and test stubs?
      Test drivers are used to call and pass input data to the component under test, while test stubs are used to generate output data from the component under test. Test drivers and test stubs simulate the behavior of missing, incomplete or defective components during integration testing.
    3. Which one do you prefer out of incremental testing and big-bang testing?
      Incremental testing is an integration testing approach where components or modules are integrated and tested gradually, while big-bang testing is the testing approach where all components or modules are integrated and tested at once. Incremental testing has  advantages over big-bang testing, such as, it helps to find and fix defects earlier in the development process, it reduces the complexity of integration testing, it allows for parallel integration testing of some components and development of other components. The final preference should also consider project size, complexity, and development methodology.
    4. What are some challenges of integration testing?
      It requires coordination among different teams or developers. Setting up the integration test environment may be challenging. Integration may depend on the availability and quality of external components or services. Integration testing may involve complex scenarios and data flows, and it may require more effort than unit testing. Maintaining documentation (integration test cases, defect reports, etc.) may require additional effort.
    Remember to just comment if you have any doubts or queries.

    No comments:

    Post a Comment

    Note: Only a member of this blog may post a comment.