What is End-to-End Testing and How Does It Fit into a Comprehensive Testing Approach?

Where Does End-to-End Testing Fit into a Comprehensive Testing Approac

End-to-end (E2E) testing is an important part of the software development process, serving as a comprehensive way to verify that applications and systems work properly in real-life scenarios. It provides a level of assurance that your application will correctly exhibit behavior from start to finish.

End-to-end testing is also one piece of a larger puzzle when it comes to developing quality software; incorporating this type of test into a broader comprehensive approach can be incredibly valuable for organizations trying to ensure their products meet user expectations. In this post, we’ll explore what end-to-end testing is, how it fits into other popular QA techniques (such as unit and integration tests), and why organizations should consider leveraging it! Let’s get started.

In this post, we'll cover...

Our 14 day free trial gives you and your team full access. Create tests in minutes. No credit card required.

Understanding End-to-End Testing

Every type of automated testing has a maintenance tax. Everything from simple unit tests up through end-to-end tests that are performed on the GUI of your application. Of course this tax rate varies depending on the complexity of the test. For unit tests (which typically deal with a small, isolated piece of functionality), the tax is cheap. You’re dealing with an atomic unit of your application that isn’t likely to be affected by changes around it. Only changes that are made specifically to the code you’re testing will have an impact, therefore the required maintenance is minimal.

End-to-End Testing Example

End-to-end testing is on the opposite side of the spectrum. You’re interacting with, in most cases, every layer of your application:

  1. A button is clicked in your application’s GUI in a web browser
  2. That buttons triggers some JavaScript code
  3. That JavaScript code makes an API call to your backend
  4. Your backend server fields the request and runs some code of it’s own
  5. That backend code queries your database for some data
  6. The data is processed and sent back to the frontend of your application
  7. The application processes the data in JavaScript and updates your GUI

Phew! Look at all those layers of your application that are being touched (*). That’s why it’s called end-to-end testing. It’s also why it’s on the opposite end of the “maintenance tax” spectrum. Any change to any of those layers could have an impact on your test. It’s far more prone to breakage simply due to it’s exposure to each of those layers and thus the cost of upkeep is much higher.

However, touching each of those layers is exactly where the benefit of end-to-end testing comes from. You’re testing your application as a whole, across the board. You’re confirming that every aspect from UI to server to database is playing nice together. After all, that’s how your end users are going to experience your application. Let’s talk a bit more about these benefits. 

Benefits of End-to-End Testing

Benefits of end-to-end testing

1. Improves Application Quality

E2E testing is the most comprehensive form of testing that you can perform. It tests the application’s functionality from start to finish. E2E testing helps identify issues that may not be apparent in unit testing or integration testing. By performing this type of testing, you will be able to catch issues and defects before they affect users, improving the quality of your application and reducing downtime.

2. Reduces Costs

Testing an application from beginning to end may seem like a lengthy and wasted testing activity. In reality, it saves money and time that otherwise would have been spent on fixing bugs discovered by the end-users. Finding issues in E2E testing means fewer issues to encounter in the production stage, where it can cost more resources to resolve. End-to-End testing may seem costly, but in the long run, it will help reduce maintenance costs and improve user satisfaction by catching issues before they can cause problems.

3. Enables Early Detection and Debugging

E2E testing ensures that all the pieces of an application work together seamlessly. Since you are testing the application as a whole, this means you can detect and debug issues earlier in the development cycle. Early detection and debugging lead to faster resolution times and less disruption to your team’s workflow. This also helps build a product that is more stable and reliable.

4. Boosts Team Productivity

E2E testing automates the process of software testing to a great extent. This means that your team can test a massive amount of data, code, and interfaces quicker and more accurately. It also frees up your team’s time to focus on other critical tasks, such as adding features to the application or fixing issues that require manual attention. With automated E2E testing, your team can be more productive and achieve better quality products.

5. Enhances Customer Satisfaction

The ultimate goal of testing is to ensure customer satisfaction. E2E testing helps providers or businesses provide a more comprehensive and consistent user experience to its customers. By detecting and preventing issues before they can cause a problem for the end-user, E2E testing helps ensure that your customers receive the best experience possible. This, in turn, leads to improved customer satisfaction and retention rates.

End-to-End Testing vs Integration Testing vs Unit Testing (The Test Pyramid)

I’ll give a sports analogy here. Pretend you’re a basketball player. A unit test might be dribbling the ball, or passing the ball, or taking a free throw. An end-to-end test would be dribbling down the court, passing the ball off, getting it back, faking out another player, then sinking a shot. Now, what should you be doing at practice? Well, primarily working on each of those isolated skills. But ultimately, playing basketball requires putting them all together, so you should be devoting at least some effort to that as well — even it’s a more complicated endeavor.

So, given that end-to-end tests have a higher maintenance tax, are they still worth it? Absolutely — but, like the analogy above, one must understand their place within the greater scope of application testing. Fortunately, the test pyramid does a good job of illustrating this:

Test Pyramid

As you can see, unit tests make up the foundation and largest portion of the test pyramid. As the complexity of the tests increase, so too does their maintenance cost, and so we scale down the volume of tests. In case you’re wondering, that “Integration Tests” layer in the middle is exactly what it sounds like. One notch up in complexity from unit tests where you’re testing multiple portions of code to ensure that they integrate together properly. However, they typically don’t touch the “full stack” like an end-to-end test.

Relative to the full testing picture, end-to-end tests should be more like “the sugar on top” than the foundation, though the actual volume can vary as your testing strategy scales. Perhaps you only have 5-10 end-to-end tests which run through the core features of your application via the GUI (like the on-boarding journey, the purchasing journey, and so on). Or, maybe that number scales up to 50 or 100 as your testing coverage grows and you develop a sound strategy for creating and maintaining your end-to-end tests along side of your application.

End-to-end tests bring a unique and valuable angle to your testing approach by touching many different layers and replicating real world scenarios. But, with that power comes complexity and a higher maintenance tax that must be factored in when leveraging them. In the end, it’s the decision of the testing team as a whole to decide when and where end-to-end tests make sense within your application testing strategy.


End-to-End Testing with Ghost Inspector

End to End testing with Ghost Inspector

There are several tools you can use to implement end-to-end testing. In this section, we’ll talk a bit about how Ghost Inspector can help you test even the most complex edge cases and hook into your continuous integration pipeline. 

In addition to codeless browser test automation, Ghost Inspector allows you to:

  • Execute your own JavaScript code in the context of the browser, just as you would in your browser’s development console.
  • Use smart logic and documentation for iframes, PDF rendering, file uploads, date pickers, credit card checkouts, 2FA logins, and more.
  • Modularize test steps for ease of reuse
  • Run tests across different environments and with different data sets
  • Test emails sent by your application
  • Store tests with code in version control
  • Utilize Continuous integration and notification services

Check out our documentation for more information on how to handle complex testing scenarios with Ghost Inspector.


Automate end-to-end testing with Ghost Inspector

Our 14 day free trial gives you and your team full access. Create tests in minutes. No credit card required.

Ghost Inspector Tutorial

If end-to-end testing with Ghost Inspector sounds like the right fit, check out a walkthrough of the rest of our app below. 

Acknowledgements & Related Links

  • (*) The number of layers that an end-to-end test touches can be minimized by “mocking” specific portions, like the database or API responses. However, from my experience, it’s more common that they’re run on a fully operational application (often in a staging environment).
  • The test pyramid is a concept developed by Mike Cohn, described in his book “Succeeding with Agile”.
  • Martin Fowler’s TestPyramid post covers this same topic. While he’s critical of recording tools in his post, which Ghost Inspector offers, we add robust functionality for editing and centralizing logic after the recording process to help mitigate the issue of “brittle” tests.