Load Testing
// Definition
Verifying system behaviour under expected production load. Confirms the application meets performance targets at typical concurrent-user counts before release.
// Why it matters
Load testing checks behaviour at expected peak traffic — does the system hold its latency and error budget when 1,000 users arrive at once? QA's value is realistic modelling: right concurrency, right think-time, right data variety. A load test on cached identical requests proves nothing.
// How to test
Load testing is a k6/JMeter/Gatling job, not a Cypress one — Cypress is functional, single-browser. The QA design work: • model concurrency to expected peak (e.g. 1,000 VUs, 5-min ramp) • vary inputs so you exercise cache misses, not one hot row • assert on p95 latency AND error rate < budget, not just "it didn't crash" • baseline first, then compare every run against it
// Code Example
import http from 'k6/http';
import { check } from 'k6';
export const options = {
scenarios: {
api: {
executor: 'constant-arrival-rate',
rate: 50, timeUnit: '1s', duration: '1m',
preAllocatedVUs: 50, maxVUs: 100,
},
},
};
export default function () {
const r = http.get('https://example.com/api/health');
check(r, { 'status is 200': (res) => res.status === 200 });
}// Common mistakes
- Hammering one identical request (all cache hits — unrealistically fast)
- No ramp-up, so you measure a thundering herd instead of steady peak
- Passing on "no errors" while p95 quietly tripled
// Related terms
Stress Testing
Pushing the system beyond its limits to find the breaking point and observe failure modes. Asks: where does this fall over, and how does it recover?
Soak Testing
Running the system at expected load for a prolonged period (hours to days) to surface memory leaks, connection exhaustion, and slow degradation that short tests miss.
Concurrent Users
The number of users actively interacting with the system at the same moment. A primary input to load and stress test design.
Apache JMeter
An open-source Java-based performance testing tool for measuring the behaviour of systems under load. Supports HTTP, JDBC, FTP, JMS, and other protocols. Widely used in enterprise and regulated industries (banking, insurance, government) due to its maturity, GUI-based test authoring, and rich plugin ecosystem. Test plans are stored as .jmx XML files and can be run headlessly from the command line for CI/CD integration.
Learn more · Performance Testing with K6
Chapter 4 · Lesson 1: Load Testing — Realistic User Workloads