Staging is a terrible place to test failure. It only ever produces the happy path, so the code that handles timeouts, 500s and retries is the least-executed code in most apps, right up until production executes it for you.
This post is a practical way to fix that without changing the backend or the app: make the failures happen at the proxy, between the two.
Three kinds of failure worth testing
Slow. The request succeeds, eventually. What does the UI show at 200 ms, at 3 seconds, at 30? Is there a spinner, a timeout, a way out? Does the user tap the button twice?
Broken. 500, 502, 503, a dropped connection. Does the app retry, and how often? Does it honour Retry-After? On a checkout, does a retry charge the card twice?
Wrong. The one people skip. An HTTP 200 with bad data inside: a price that arrives as "49.00" instead of 49.00, a field that is suddenly null, an empty list on a screen that always had one item. These break more UIs than 5xx errors do, and no backend will produce them on demand.
Why the proxy is the right place
You could fake these in the app (a mock HTTP client, test fixtures) or in the backend (a broken build on staging). The proxy layer beats both for this job:
- It needs no code change on either side, so you are testing the build you will ship.
- It works for manual, exploratory testing on a real phone, where there is no test harness at all.
- The same setup applies to the app, the automation suite and CI.
- You can target one host and one path, and leave everything else alone.
The trade-off is the usual proxy setup: the device or runner sends its traffic through the proxy, and trusts the proxy's CA so HTTPS can be decrypted. That is the same for every tool in this post, and it is the part worth doing once, carefully.
What to look for when it fails
A checklist that has found real bugs for me:
- Does a slow request ever give the user a way out, or is it a spinner forever?
- After a 503, does Retry respect
Retry-After, or hammer the server? - On payment or order endpoints, can a retry create a duplicate?
- Does the error message make sense to a user, or does it print
payment_unavailable? - When a number arrives as a string, does the screen crash, show
NaN, or quietly do maths on text? - After the failure clears, does the app recover without a restart?
When the proxy has to be shared
Everything above runs on one laptop, which is fine until the failure you care about happens on a device in the lab, on a teammate's phone, or in a CI run. Then the proxy has to be somewhere everything can reach.
(15-second animated explainer, not a screen recording.)
Disclosure: that is the problem I build Proxycept for. It is a hosted debugging proxy: phones, emulators, teammates and CI runners point at one authenticated endpoint, and captures land in one shared web console. In it you can hold a request and change its response before releasing it, set delays and error rates per profile or per route, and add response rewrite rules that change one field of a real response (keeping its JSON type, or deliberately changing it) while the backend still answers for real.
What it does not do: it does not get past certificate pinning, it does not remove the CA step on each device (on Android that step is manual, like with any proxy), and it is for testing your own apps. If you work alone on one machine, a desktop proxy like Charles, Proxyman or mitmproxy is all you need.
If the shared version sounds useful, there is a free plan, and you can sign in with Google, GitHub or email: proxycept.com. If you are comparing it with Charles, this page covers when each one fits.
Have a failure case I missed, or a bug story like these? I'd like to hear it in the comments.
Top comments (1)
The 'wrong' category is the one I'd underline — a 200 with a price as a string instead of a number has broken more of our partner flows than any 5xx ever has. We test our EDI and webhook endpoints the same way, forcing the failure at the boundary instead of trusting staging to produce it, and the Retry-After point is the one teams skip most: a retry that ignores it is just a polite retry storm. This checklist reads like our own post-incident list, and the 'recover without a restart' item is the test most people forget to write.