Performance Testing
What is Performance Testing?
Performance testing evaluates how an application behaves in terms of speed, responsiveness, and stability under a particular workload.
Types of Performance Testing
- Load Testing: Checking behaviour under expected, real-world loads.
- Stress Testing: Pushing the system beyond its limits to find the breaking point.
- Volume Testing: Checking behaviour with large volumes of data.
- Spike Testing: Checking behaviour under sudden, extreme increases in load.
- Endurance/Soak Testing: Checking behaviour over a prolonged period of sustained load.
Why It Matters
Performance testing ensures the application will remain fast and stable for real users, especially during peak usage periods.
The Performance Testing Process
Good performance tests are planned like experiments. Running a tool against a URL without a goal produces numbers nobody can act on.
- Set measurable goals. Agree with the business on targets such as "search responds within 2 seconds for 95% of requests at expected peak users".
- Model real user behaviour. Study analytics or logs to decide which journeys matter most and how often each happens.
- Prepare a realistic environment. Use production-like hardware, configuration and data volumes. Results from a tiny test database can be misleading.
- Script the scenarios with a tool such as JMeter, Gatling, k6 or Locust, including think time between steps and unique test data.
- Run a baseline with a small load, then increase it gradually.
- Monitor the servers during the run: CPU, memory, database queries, thread pools and error logs.
- Analyse, tune and retest. Fix one bottleneck at a time and compare against the baseline.
Metrics Worth Reporting
| Metric | What it tells you |
|---|---|
| Response time (average and percentiles) | How long users wait; the 90th or 95th percentile shows the slow experiences an average hides |
| Throughput | Requests or transactions completed per second |
| Error rate | Share of requests that failed or timed out |
| Concurrent users | How many virtual users were active at once |
| Resource utilisation | Which server component is running out of capacity |
A short example
Imagine an online exam portal. A load test with the expected number of students shows response times staying steady. A spike test that simulates everyone clicking "Start exam" at the same moment shows login requests slowing sharply and some failing. Monitoring reveals the database connection pool is exhausted. After the team increases the pool size and caches the exam instructions page, the spike test is repeated and the error rate drops. That loop of test, diagnose, fix, retest is the heart of performance work.
Where Performance Testing Fits
Functional tests ask "does it work?" Performance tests ask "does it keep working when many people use it at once?" Both are needed. Run small, automated performance checks in the CI pipeline for key APIs, and run larger load and soak tests before major releases or expected traffic events.
Mistakes to Avoid
- Testing against a shared environment while other teams are using it.
- Reusing one login for every virtual user, which hides caching and session issues.
- Reporting only averages.
- Overloading the load generator machine itself, so it becomes the bottleneck.
- Running load against production or third-party services without written permission.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.