educative.io

Integration testing VS E2E

Hi, I have a question regarding this assertion.

Usually, integration tests involve running a browser and automatically performing actions in it. For example:

  1. Open the app
  2. Fill in credentials
  3. Press the LOGIN button
  4. Check that the profile page opens.

From my point of view this example doesn’t show the idea of Integration Testing. It is more likely E2E test but not the Integration test.
Integration Testing involves testing several different components and has more sophisticated logic than just logging into the system as you showed. So can we deep dive into this topic and discuss what the difference between E2E and Integration test?
For example, is this example of the Integration test or just e2e?
login to the system → add product to the basket → edit personal info → create order


Course: https://www.educative.io/collection/6681755141537792/5450848082591744
Lesson: https://www.educative.io/collection/page/6681755141537792/5450848082591744/5495307851792384

Hi @Anna_Velychko !!
Your observation is correct, and it’s important to understand the distinction between integration testing and end-to-end (E2E) testing.

Integration Testing:

  • Integration testing focuses on testing the interactions and interfaces between different components or modules of a system.
  • It verifies that the integrated components work together as expected and communicate correctly.
  • Integration tests typically involve testing multiple components together but in isolation from the rest of the system.
  • The purpose is to ensure that the integrated parts of the system function correctly when combined.

End-to-End (E2E) Testing:

  • End-to-end testing involves testing the entire application from start to finish, simulating real user scenarios.
  • It tests the application’s workflow across multiple components, including the user interface, backend services, and external dependencies.
  • E2E tests typically mimic real user interactions and workflows, such as logging in, navigating through pages, interacting with forms, etc.
  • The purpose is to ensure that the application behaves correctly from the user’s perspective, capturing how different components interact to fulfill user requirements.

Now, let’s analyze the example you provided:

  • Login to the system
  • Add product to the basket
  • Edit personal info
  • Create order

This example involves testing the entire workflow of a user interacting with the system, covering multiple components and user interactions. Therefore, it aligns more closely with end-to-end testing rather than integration testing.

Integration testing, on the other hand, would focus on testing individual components in conjunction with each other to verify their interactions and interfaces. For example, testing how the login component interacts with the user authentication service, or how the product catalog interacts with the shopping cart service.

In summary, the provided example of testing the entire user workflow, including logging in, adding products to the basket, editing personal info, and creating an order, would typically be categorized as end-to-end testing (E2E) rather than integration testing. Integration testing would involve testing the interactions between specific components or modules in the system, typically in isolation from the rest of the system.
I hope it helps. Happy Learning :blush:

1 Like

Good explanation, thank you!
In addition to the discussion above, I want to clarify one quick question. Do I understand correctly that we do integration testing as a QA specialist only with code on dev side? I mean do we use code from the dev’s framework to perform integration testing?
For E2E testing we create separate TAF (test automation framework) and write test code for testing user interaction. So, what approach is used for integration testing?

1 Like

@Anna_Velychko Yes, you’re correct in your understanding.

Integration testing often involves collaborating closely with developers, as it focuses on testing the interactions between different components or modules of the system. Here’s how integration testing typically works:

  1. Using Developer’s Code: Integration testing often utilizes code from the developer’s framework. QA specialists work with developers to access the necessary components/modules and test their interactions. This may involve setting up test environments where the integrated components can be tested together.

  2. Collaboration with Developers: QA specialists may collaborate closely with developers to understand the codebase, identify integration points, and develop test cases that verify the interactions between components.

  3. Testing in Isolation or Stubs: Integration testing can involve testing components/modules in isolation or with the help of stubs/mock objects to simulate the behavior of dependent components that are not yet developed or available.

  4. Automated Testing: Like end-to-end testing, integration testing can also involve automation. Automated integration tests can be written using frameworks like JUnit, NUnit, or others, depending on the technology stack being used.

  5. Continuous Integration/Continuous Deployment (CI/CD): Integration tests are often integrated into the CI/CD pipeline to ensure that changes made by developers do not break the interactions between components.

So, while end-to-end testing focuses on testing the entire application workflow from a user’s perspective, integration testing delves deeper into the interactions between various components of the system. It often involves a collaborative effort between QA specialists and developers, utilizing code from the developer’s framework and sometimes automated testing tools/frameworks.

1 Like