Performance Testing

Performance Testing: What It Measures and What It Cannot

0 Comments

Performance testing answers one question: will this system still behave when the number of people using it goes up? Everything else – the tools, the scripts, the dashboards – exists to answer it honestly.

In this article

  • What performance testing actually measures
  • The five test types, and when each is the right one
  • Think time, pacing and why your numbers are wrong without them
  • Correlation and parameterisation
  • Reading a result without fooling yourself
  • A short checklist before you call it done

What performance testing actually measures

A functional test asks whether the application does the right thing. A performance test asks whether it still does the right thing at a given load, and what it costs in time and resources to do it. Those are different questions, and a suite that passes the first tells you nothing about the second.

Three numbers carry most of the meaning:

  • Response time – how long one request takes. Report percentiles, not an average: p95 and p99 tell you what your slowest users experience, and the average hides them.
  • Throughput – requests completed per second. A system can look fast and still be unable to clear the queue.
  • Error rate – the proportion of requests that failed. A fast system returning 500s is not a fast system.

If you report one number, report p95 response time at a stated load. An average with no load attached to it means nothing.

The five test types, and when each is the right one

Type What it answers
Load Does it hold up at the load we expect on a normal day?
Stress Where does it break, and how does it behave while breaking?
Spike What happens when load jumps in seconds – a sale, a results day?
Soak Does it still work after eight hours? This is where memory leaks show.
Volume What happens when the database has two years of data rather than two days?

Most teams run load tests and stop. Soak tests find the defects that reach production, because a leak that costs 20 MB an hour is invisible in a ten-minute run.

Think time, pacing and why your numbers are wrong without them

A script with no think time is not fifty users – it is fifty machines hammering the server with no pause. It produces a number, and the number is not about your users.

Think time is the pause a real person takes reading a page. Pacing is the gap between one full journey and the next. Put both in, and the load you generate resembles the load you are trying to simulate.

Correlation and parameterisation

Two things break a recorded script the moment you replay it:

  • Dynamic values the server issues – a session token, a CSRF field, an order id. The script has to read them out of the response and feed them into the next request. That is correlation.
  • Hard-coded test data – the same username fifty times. Drive it from a CSV so each virtual user is a different person. That is parameterisation.

A script that skips correlation usually still 'passes': the server returns an error page quickly, so the numbers look excellent. Always assert on the response body, not only on the status code.

Reading a result without fooling yourself

  • Check the error rate first. If it is not near zero, the response times are meaningless.
  • Look at p95 and p99, then at the maximum. A tidy average with an ugly p99 is a real problem for a real group of users.
  • Plot response time against throughput. The point where response time climbs while throughput flattens is the saturation point – that is the answer to 'how many users'.
  • Confirm the load generator was not the bottleneck. A machine at 100% CPU limits the test, not the system.

A short checklist before you call it done

  • The environment is stated, with its size relative to production.
  • The workload model is written down: journeys, mix, think time, pacing, ramp-up.
  • Data is realistic in volume, not just in shape.
  • Monitoring was on during the run – CPU, memory, GC, database, not only the client side.
  • The report names the bottleneck and the next action, not just the numbers.

Key points

  • Report p95 at a stated load; an average with no load means nothing.
  • Error rate first – fast failures look like fast responses.
  • No think time and no pacing means you measured something that is not your users.
  • Soak tests find what load tests miss.

Practise this on the free applications at jstestingacademy.co.in/qa-apps – no account needed.