Affordable and realistic load testing with WireMock Cloud

Ethan Jones
Head of Product
July 16, 2024

When people think about  load testing, and mock APIs - they often don’t see the point. I’m trying to stress my real systems, doesn’t using mock APIs defeat the purpose? But, we wouldn’t be a mock API company if we weren’t gonna say that’s not true!

Mock APIs enable load testing as a more consistent and more affordable practice by letting you isolate key dependencies and contexts. For instance, how can you load test a service that has a dependency on a 3rd party payment system without paying for a massive increase of calls to the vendor? And, even if you get a sandbox from the vendor, these sandboxes are usually limited by call rate and don’t allow load tests to run on their systems. Additionally, even separate from cost - all those 3rd party dependencies are known to be flakey in test environments and can ruin your load tests with random failures and timeouts. 

What you need is load testing you can do reliably and often, and stress exactly the scenarios you want to stress without dependency conflict. That’s what using WireMock Cloud, with it’s ultra realistic and easy to configure dynamic, stateful API mocking does. Without WireMock Cloud, teams either just load test less reliably and with worse results, or they spend a ton of time creating custom code to conditionally skip dependencies - which is bad, because you want at least the simulation of how the dependency performs.

Isn’t API mocking just fake data?

Oftentimes API mocking makes folks think of API mocks, they imagine pretty simplistic fake responses, probably just built into their code, that can be useful for basic tests but don’t really provide for the complex behaviour of real services.

That’s what WireMock Cloud exists for - using dynamic response, advanced body matching, stateful mocking, chaos and fault injection and more - to create mocks that truly represent real services at a fraction of the cost and none of the overhead. WireMock Cloud even lets you record your real APIs to guarantee accuracy and to keep mocks aligned with production changes.

How does API mocking help with load testing?

Load testing is crucial. We all know that. You want to make sure your app can handle the stress of real users doing real things. But managing the web of dependencies and more-or-less-critical services when planning your load tests is tough. This is where API mocking steps in, saving you a lot of hassle, cost and overhead and letting you load test more often with less risk. Here are just some of the reasons that load testing with API mocks should be a critical part of your team’s quality practice:

  1. Scalability And Cost: With API mocks, you can simulate a high volume of traffic without incurring production costs and without risking the stability of production services

  2. Flexibility: Customise responses and state to test specific scenarios at load without needing bespoke engineering work. For example, you can test a high volume of traffic against a specific service that simulates user account balance transactions and every permutation of how that interaction might work. That kind of specific load test can be tough to do in production.
  1. Speed: Since load testing with WireMock Cloud doesn’t involve production services and production costs, it is much faster to plan and execute a load test. This makes an expensive, high-coordination task into an easy task to execute over and over again.

  2. Isolation: API mocking makes it easy to stress test individual components without worrying about external dependencies messing things up.
  3. Reproducibility: Ensure your tests are consistent and reliable. No more flaky tests due to changing external factors.

What’s the ROI?

Using WireMock Cloud for load testing brings you significant ROI - both in terms of dollars and time. The most direct cost savings comes from reducing the need for expensive test environments and from not jacking up your production infrastructure bills, as WireMock Cloud allows for simulating high-load scenarios using a fraction of the infrastructure. This can be particularly advantageous for companies looking to optimise their testing budgets, which is basically everyone right now. 

Indirectly, using WireMock Cloud to enable more efficient load testing also leads to faster bug resolution and reduced downtime since catching issues early in the testing phase means spending less time fixing problems later on. This proactive approach not only enhances the efficiency of the development process but also minimises the potential for costly disruptions.,This is also true of improving your time-to-market for features, since fastertesting cycles means that updates can be pushed out more quickly and will have production issues less often. At the end of the day, this means happier users (and happier executives.)

/

Latest posts

Have More Questions?