DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Automating FastAPI Deployments With a GitHub Actions Pipeline
  • Fixing a Test Involves Much More Than Simply Making It Pass
  • A Beginner’s Guide to Playwright: End-to-End Testing Made Easy
  • Automating E2E Tests With MFA: Streamline Your Testing Workflow

Trending

  • Self-Hosted Inference Doesn’t Have to Be a Nightmare: How to Use GPUStack
  • Setting Up a Data Catalog With Azure Purview and Collibra: What Three Attempts Taught Me
  • Code Quality Had 5 Pillars. AI Broke 3 and Created 2 We Can’t Measure
  • The Serverless Illusion: When “Pay for What You Use” Becomes Expensive
  1. DZone
  2. Data Engineering
  3. Databases
  4. What Is End-to-End Testing?

What Is End-to-End Testing?

Learn end-to-end testing, including its definition, goals, stages, timing, and a practical example, to ensure complete software workflow validation.

By 
Faisal Khatri user avatar
Faisal Khatri
DZone Core CORE ·
Oct. 22, 25 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
2.9K Views

Join the DZone community and get the full member experience.

Join For Free

Being a part of the software team, you would have heard about end-to-end or E2E testing. The testing team ideally prefers to have a round of end-to-end testing to ensure the functional working of the application.

Every software application should undergo end-to-end testing to ensure it functions as specified. This testing approach builds confidence in the system and helps development teams determine whether the software is ready for production deployment.

In this tutorial, I will guide you through what end-to-end testing is, why it’s important, and how effectively you can implement it in your software project.

What Is End-to-End Testing?

End-to-end testing refers to testing the software from the end user’s perspective. It verifies that all software modules function correctly under real-world conditions.

The core purpose of end-to-end testing is to replicate the real-world user experience by testing the application’s workflow from beginning to end.

Let’s take an example of the Parabank demo banking application, where different modules like registration, login, accounts, transactions, payment, and reports modules were built in isolation.

Parabank – demo banking website for testing

Considering end-to-end testing, we should perform a comprehensive test of the end-user journey beginning from registration, then verifying the login functionality, the accounts module by creating a new bank account, performing transactions such as transferring money to different accounts, and checking the status report of the transaction.

These tests mimic real user interactions, allowing us to identify issues within the application as it is used from start to finish.

What Is the Goal of End-to-End Testing?

The primary goal of end-to-end testing is to ensure that all software modules function correctly in real-world scenarios. Another key objective is to identify and resolve hidden issues before the software is released to production.

For example, performing an end-to-end test of a loan application that allows users to manually fill in the details and check for the eligibility of loans. By performing end-to-end testing, we can ensure that the user will be able to complete the journey without any issues.

By performing end-to-end testing, we not only check for the functionalities and features, but it also allows us to get feedback on the overall user experience.

When to Perform End-to-End Testing?

End-to-end testing is usually conducted after completing the functional and system testing. It is better to perform it before major releases to confirm that the application works from the end user’s perspective without any errors. It may help us uncover hidden issues as we combine all the modules and test the overall application from beginning to end, just as an end user would.

It is recommended to integrate end-to-end tests into CI/CD pipelines to validate workflows and receive faster feedback on builds.

Test Strategy

Ideally, end-to-end testing should be performed at the end of the software development life cycle.

The majority of the tests should be shifted to unit tests following the integration and service-level tests. Finally, the end-to-end testing should be performed.

As per Google’s Testing blog, Google suggests a 70/20/10 split: that is, 70% unit tests, 20% integration tests, and 10% end-to-end tests. The specific combination may vary for each team, but it should generally maintain the shape of a pyramid.

Test strategy

In short, unit tests form the base, integration tests come next, and end-to-end testing sits at the top of this structure, forming the shape of the pyramid.

Different Stages of End-to-End Testing

The following are the three phases of performing end-to-end testing:

  1. Planning
  2. Testing
  3. Test closure

Let’s learn about these phases in detail, one by one.

Planning

In the planning phase, the following points should be considered:

  1. Understand the business and functional requirements
  2. Create a test plan based on the requirement analysis
  3. Create test cases for end-to-end testing scenarios

A tester should gain knowledge of the application and understand the different test journeys within it. These test journeys should be designed from the end user’s point of view, covering the entire process from beginning to end. All the happy paths should be noted down, and accordingly, test cases should be designed.

For example, from an e-commerce application point of view, a simple test journey would be as shown in the figure below:

End-to-end test journey

Similarly, other test journeys can also be prepared where the user adds the product to the cart and logs out of the application. Then, logs in again and continues from where he left off, and so on.

We should also consider the following points in the planning phase to get an upper hand on the testing:

  1. Set up a production-like environment to simulate the real-world scenario
  2. Setting up the test data, test strategy, and test cases for testing real-world scenarios
  3. Define entry and exit criteria to have a clear objective for end-to-end testing
  4. Get the test cases, test data, entry, and exit criteria reviewed by the business analyst or product owner

Testing

The testing phase can be divided into two stages, namely, the prerequisites and test execution.

Prerequisite

In this stage, it should be ensured that:

  1. All the feature development should be complete
  2. All the submodules and components of the application should be integrated and working fine as a system
  3. System testing should be complete for all the related sub-systems in the application
  4. The staging environment, designed to replicate the production setup, should be fully operational. This environment enables us to simulate real-world scenarios and effectively reproduce production-like conditions. It will allow seamless testing of the end-to-end scenarios.

After completing the prerequisites, we can proceed to the test execution stage.

Test Execution

In this stage, the testing team should:

  1. Executes the test cases
  2. Report bugs in case of test failure
  3. Retest the bugs once it is fixed
  4. Rerun all the end-to-end tests to ensure all tests are working as expected

The end-to-end tests can be executed manually or using automation in the CI/CD pipelines. Executing end-to-end tests through an automated pipeline is the recommended approach, as it saves time and effort for the testing team while ensuring high-quality results in the shortest possible time.

Test Closure

In this stage, the following actions should be performed:

  1. Analysis of the test results
  2. Test report preparation
  3. Evaluate the exit criteria
  4. Perform test closure

The test closure stage in end-to-end testing involves finalizing test activities and documenting results. It ensures that all the test deliverables are complete. It also includes assessing test coverage and documenting key takeaways, for example, noting down known issues.

Finally, a test closure report is prepared for the stakeholders. This report could prove to be of great help in Go/No-Go meetings.

End-to-End API Testing Example

Let’s take an example of the RESTful e-commerce APIs; there are a total of six main APIs in the RESTful e-commerce application as follows:

  1. Create Token (POST /auth)
  2. Add Order (POST /addOrder)
  3. Get Order (GET /getOrder)
  4. Update Order (PUT /updateOrder)
  5. Partial Update Order (PATCH /partialUpdateOrder)
  6. Delete Order (DELETE /deleteOrder)
End-to-end API testing example


Before performing end-to-end testing on these APIs, we should first analyze their requirements, usage patterns, and technical specifications. These details will be useful in writing the end-to-end test cases as well as designing the automation test strategy.

As per Swagger, the following functional points related to the APIs can be noted:

  1. The POST Add Order API is used to create new orders in the system, while the GET Order API retrieves an order using the provided order ID.
  2. The Create Token API generates a token that will be used in the Update and Delete APIs as a security aspect, so only registered users can update or delete their orders.
  3. The update and partial update APIs will be used for updating the orders.
  4. The delete API will be used for deleting the order.

Considering these details, the following testing strategy can be used for end-to-end testing:

  1. Generate a new token by hitting the POST /auth API and saving it for further use.
  2. Create new orders using the POST /addOrder API.
  3. Retrieve the newly created order by passing the Order ID in the GET /getOrder API.
  4. Using the earlier generated token, update an existing order using the PUT /updateOrder API.
  5. Verify the partial update order functionality by updating an existing order using the PATCH /partialUpdateOrder API.
  6. Delete the existing order by using the DELETE /deleteOrder API.
  7. To verify that the order has been successfully deleted, hit the GET /getOrder API. Here, the status code 404 should be retrieved in the response, considering that the order has been deleted from the system.

It can be seen that we used all the major APIs to perform end-to-end testing as a real-world scenario.

Similarly, end-to-end testing can be carried out for a web or mobile application. It’s important to evaluate the application from an end user’s perspective, create relevant test scenarios, and have them reviewed by the team’s business analyst or product owner.

Summary

End-to-end testing is a comprehensive testing approach that validates the entire workflow of an application, from start to finish, to ensure all integrated components function as expected.

It simulates a real-world scenario to identify the issues across different modules within the system and their dependencies. It simulates real user scenarios to identify issues across systems and dependencies. This helps ensure the application provides a smooth and reliable user experience and uncovers the issues early before the end users face them.

Happy testing!

API End user Testing

Published at DZone with permission of Faisal Khatri. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Automating FastAPI Deployments With a GitHub Actions Pipeline
  • Fixing a Test Involves Much More Than Simply Making It Pass
  • A Beginner’s Guide to Playwright: End-to-End Testing Made Easy
  • Automating E2E Tests With MFA: Streamline Your Testing Workflow

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook