How it works
input validationInput validationChecking that what the user typed is acceptable before the app uses it.Open in glossary → happens twice. Client-sideClient-side validationChecks that run in the app or browser before data is sent, to give the user quick feedback.Open in glossary → checks run in the app or browser and give quick feedback. Server-sideServer-side validationChecks the server runs on every request, no matter which app or tool sent it. The only validation you can trust.Open in glossary → checks run on the server and are the only ones you can trust, because anyone can skip the app and send data straight to the server’s APIAPIThe way different software parts talk to each other, like an app asking a server for data.Open in glossary → (the “door” the app itself uses to talk to the server). As a tester, check both: a rule that only exists in the app is a bug waiting to happen.
Some checks only the server can do at all, like “This email is already registered”.
Behind every Create account or Place order button, the same journey happens:
- The user fills in the form. Typing, picking from lists, pasting, or letting AutoFill do it. The app may check fields as they go (client-side validation).
- The user submits. The app checks everything once more. If something is wrong, it shows the errors and sends nothing.
- The app sends the data. The values travel to the server in one request, usually a
POST(the kind of request that hands data over), encrypted with HTTPSHTTPSThe secure version of HTTP; traffic between the browser or app and the server is encrypted.Open in glossary →. The submit button shows a loading stateLoading stateWhat the UI shows while it waits for data or an action to finish, such as a spinner or skeleton.Open in glossary → and can’t be used again until there’s an answer. - The server validates again. Same rules, plus checks only the server can do: is this email already registered? Is this postcode one we deliver to? Too many sign ups from this device?
- The server answers with a number, the HTTP status codeHTTP status codeA three-digit number in every server response: 200 means OK, 404 not found, 500 server error.Open in glossary →, plus details. Success (for example
201 Created), a validation error with details per field (often400or422), or a server error (500). You’ll see these numbers in bug reports and test cases all the time. - The app shows the result. A success screen or confirmation, or the errors next to the right fields, with everything the user typed still there.
Client-side vs server-side validation
In the app or browser
Client-side validation
- Instant feedback while the user fills in the form
- Required fields, formats, lengths, "passwords match"
- Saves a trip to the server for obvious mistakes
- Can be skipped, changed or simply missing
On the server
Server-side validation
- The same rules again, every time
- Things only the server knows: "email already registered", stock, prices, rate limits
- Rejects bad data with a clear error (often a 400 or 422)
- The only check you can trust
Ways to reach the server without the app's checks
- Calling the API directly with Postman or curl
- Editing the request in a proxy tool or DevTools
- An old app version with older (or no) rules
- A second client: website, iOS and Android each with their own checks
Client-side validation is a convenience for the user. Server-side validation is protection for the business. A developer can forget to add a rule to the app, the iOS and Android apps can have different rules, an old app version can have no rules at all, and anyone can send a request with a tool like Postman or change it on the way with a proxy toolProxy toolA program that sits between the app and the server so you can watch and change network traffic.Open in glossary →. Only the server sees every request.
| Rule | Client-side | Server-side |
|---|---|---|
| Required fields, formats, lengths | Yes, for quick feedback | Yes, always again |
| “This email is already registered” | No (only the server knows) | Yes |
| Price, discount, stock | Display only | Yes, the server decides |
| Too many attempts from one device | No | Yes (rate limitingRate limitingCapping how many requests a user or device can make in a period of time.Open in glossary →) |
Check this part
The app blocks names longer than 50 characters. Why should you still test a 300-character name?
Which check can only the server do?