What is client-server architecture?
The client shows the interface and builds requests, while the server stores data, applies the rules and responds. They talk over a protocol, most often HTTP, where every request carries everything it needs (token or cookie, parameters, body) because HTTP keeps no state between requests. Rules (format, permissions, limits) must live on the server, since a client can be bypassed and client-side validation only saves the user time.
QA Fundamentals · Web and client-server
The "Save" button does nothing. Is the bug in the browser, on the server or in between?
A user clicks "Save profile" and nothing happens. A ticket titled "Button does not work" goes to the front end. A day later it comes back: the request went out and the server answered with an error. The ticket moves to the back end, which shows that the request has a field with a different name. Two days are lost because nobody looked at the conversation between the client and the server. This lesson is about who is responsible for what in such a pair and how to find out in a few minutes on whose side the bug is.
How it works and why. The client (a browser, a mobile app) shows the interface and builds requests. The server stores data, applies rules and answers. Between them sits a protocol, most often HTTP: the client sends a request (method, URL, headers, body) and the server returns a response (status, headers, body). HTTP does not remember earlier requests, so every request carries all it needs: a session token or cookie, parameters, a body.
| Client | Server |
|---|---|
| Shows the interface, holds temporary state (a form, a tab, a filter) | Stores the data and is the source of truth |
| Checks input for convenience so a hint appears at once | Checks the same again, because the client cannot be trusted |
| Builds the request, parses the response, shows errors | Checks authentication and permissions, applies business rules |
The double check is not pedantry but a consequence of the design. The client runs on the user's device, and the user can bypass any interface: send a request through curl or Postman, or change the page code. So the rules (format, permissions, limits) must live on the server, and client validation only saves a person's time. Two conclusions for QA follow: check the API separately from the UI, and do not treat "the form does not let me type it" as proof that the server will refuse it too.
Where things happen
Example: from "the button does not work" to a localised bug. The ticket "The Save button does not work" does not say whose problem it is. We open DevTools, the Network tab, click the button and read the conversation:
PUT /api/profile HTTP/1.1
Content-Type: application/json
{"phoneNumber": "+380501234567"}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{"error": "validation_failed", "field": "phone",
"message": "required"}
The request went out (so the button "works"), the response came (the server is alive and says clearly what is wrong), and the field in the request is named differently from the contract. This is a client defect. The second defect is on the client too: the error is not shown. A report that can be handed to the right person at once:
Title: [Profile] "Save" returns 400: the client sends phoneNumber, the contract requires phone
Actual: PUT /api/profile → 400, field=phone; nothing changes on the screen
Expected: the field phone (API contract, the Profile section)
Localisation: the request is wrong, the server response is correct (client)
Separate bug: on a 400 the UI stays silent, but it must show the error
A simple table helps with quick localisation:
| What you see | Whose side |
|---|---|
| No request in Network, a red error in Console | Client |
| A request exists, but the fields, format or headers do not match the contract | Client |
| The request is right, the response is 5xx or the data is wrong | Server or a service behind it |
| The response is right, but the screen shows something else | Client |
| 502 or 504 from a gateway: the application behind it gave an invalid response (502) or none in time (504) | Infrastructure or a slow server |
Limits and alternatives. Two sides are usually not enough. CDNs, load balancers and gateways stand on the path and can return their own error or a stale copy from a cache. Behind the application server there is often a chain of microservices, so a 500 from "the back end" can be born in a neighbouring service: then the request ID and the time are useful in a report. There is also server-side rendering, where the server builds the HTML: a "visual" bug may then live on the server. A mobile app adds its own complexity: old app versions talk to a new server, and compatibility must be checked. In some protocols the server pushes messages over a connection the client opened (WebSocket, server-sent events): "request and response" come apart there, but the idea of the seam stays. Finally, if the contract is ambiguous, an argument about "whose fault" points to a requirements defect rather than a code defect, and it is settled together with developers and the analyst.
Common mistakes.
- Pinning a bug on the front end at once because it is "visible on the screen": a symptom in the browser does not mean the cause is there.
- Checking only through the UI: validation, permissions and limits that the client "does not let you break" may be accepted by the server, and the bug stays unnoticed.
- Writing "does not work" without the request and the response: the developer has to walk the path QA already walked.
- Treating every 4xx as a server defect: a client error often means the client sent something incorrect and the server answered correctly.
- Forgetting that the response may come from a cache: you see an old copy and look for a bug that is already gone.
Check yourself
The server returns 200 and correct JSON with a list of three orders, but the screen is empty. Whose side is it, and what do you check next?
Answer
The client's: the response is right but something else is shown. Next I look at Console for errors, check how the client reads the response (for example, it expects an array in items but data came), the state of the filters and whether a repeated request overwrites the list.
The browser form does not allow fewer than five characters in a field. Why is that not enough to consider the field tested?
Answer
Because the check is on the client and can be bypassed: a request can be sent directly through Postman or curl. I need to send a short string to the API separately and make sure the server answers 400 or 422 and does not accept it.
A request returned 504 Gateway Timeout. Why is it not necessarily a front-end bug, and what do you add to the report?
Answer
504 says a gateway or proxy did not get an answer from the server behind it: the problem is a slow application or a service further down the chain. I add the URL, the method, the request time and the request ID (if it is in the headers) to find the entry in the logs.