Testing The Untestable

A long time problem for automated end-to-end testing has been testing production systems that have no test system available for testing.

A classic example is payment systems and other financial endpoints. Other examples I have worked with include college admission systems, insurance company APIs, loan system endpoints and many local and federal government services that cannot afford or are unable to provide test systems you can use.

Traditionally end-to-end testing with Selenium did not provide simple ways to overcome this problem. This in turn, frequently leads to automation that is very limited in scope and/or require clunky manual intervention and/or manual testing. These challenges only grow when we try to run our test suites in CI systems which require full automation.

Modern approaches have now given us tools and knowledge on how to address this. A couple of solutions are shown below

  1. Create a local server that serves the same responses that the actual API will provide and then configure test runs to start and use this server. This typically means getting a sample response from the real API and then building test responses using this. One item that frequently needs to be addressed is using some form of unique ID generator to provide unique ID's that real responses would provide.
  2. Use a framework such as Cypress or Playwright that provide you with the easy ability to mock out responses from a real server. These tools provide many of the pieces that you would end up building yourself if you went with the first option of a test server.

An important part of a good solution will be to test at multiple levels. Given the above solutions involve mocking out live responses you should consider integration tests (if possible) to verify that production endpoints are still valid and of course a base of high coverage unit tests for actual functionality. You might also consider a few happy path smoke tests for production with sad cases covered in test systems. Production monitoring of live endpoints rather than going through brower UIs is another option to consider.

To view or add a comment, sign in

More articles by Michael Durrant

  • Worker Productivity Soars!

    Worker productivity is soaring to massive heights. This is a trend that has accelerated rapidly over the past 10 years…

  • Practices of a feather stick together

    Organizations wishing to improve their software development processes will often identify specific aspects that they…

  • High quality software serves the business well

    From a business perspective, organizations generally want similar benefits from their software solutions, namely - Low…

  • More work means faster?

    Faster development by doing..

  • Technical Debt can melt away

    We've had a tough winter here in the northeast of the United States. The winter has been consistently colder than usual…

  • Finally Fix your Technical Debt!

    Every company I have worked in, regardless of industry or company size has the same software problem - technical debt…

  • The four states of code

    1. Inconsistent low quality 2.

  • Quality First for solving the Technical Debt Problem

    Many companies that I have worked in face the technical debt conundrum, namely: How do you address technical debt and…

  • The true cost of low quality automation code

    Code is both an asset and a liability to the companies that use it. For a few decades I've been learning how to avoid…

  • This is AI...

    The recruiter uses AI for the job "Playwright engineer". Playwright is a framework for programmers writing browser…

    1 Comment

Others also viewed

Explore content categories