API contracts
The worst app–API bugs pass every test on both sides: a renamed field, a fraction that became a percentage, an error with a new shape. Mobile makes it harder, because you cannot redeploy the client.
Design for the oldest installed version. Apps stay on phones for months. Add fields and endpoints freely, but treat a rename or removal as a migration: ship the new field beside the old one, move the app over, and remove the old one once old versions stop calling. A minimum supported version keeps that tail short.
Write the contract down first. Agree on it before either side writes code, and spell out what generators miss: percentages as 12.5, not 0.125; dates in ISO-8601 UTC; money as an exact decimal with its currency, like "239.00" and INR, never a float.
Make errors part of it. One error shape everywhere: a stable code the app can branch on, and a message written for the user. RFC 9457 standardises this. Status codes should mean something: 401 signs the user out, and 404 also covers ids the caller does not own, so ids cannot be probed. In Undobase, hitting a plan limit returns 402 with an upgrade link.
Expect the unknown. Ignore unknown fields, and give every enum a fallback. At Third Wave Coffee, a home-page section type the app does not recognise renders nothing, so the backend can add sections without breaking older versions.
Make writes safe to repeat. Mobile networks drop responses, so apps retry. An idempotency key makes a repeated “place order” the same order. See Safe retries.
Test both sides. Run the app’s parsers against real recorded responses, and make the backend’s build fail when it stops returning what the app reads. Consumer-driven contract tests (Pact) do this at team scale.
At work, I define API contracts with the backend team, so disagreements surface in a document, not in production.