Performance testing is a crucial aspect of software testing that focuses on evaluating the speed, responsiveness, and stability of a software application under various conditions. The primary goal is to ensure that the application meets performance expectations, performs well under normal and peak loads, and remains stable over time.
Performance testing involves simulating real-world scenarios to assess the system's behavior and measure key performance metrics such as response time, throughput, and resource utilization. This testing process helps identify bottlenecks, uncover performance issues, and optimize the application for optimal user experience.
-
User Experience: Performance testing ensures that users experience fast response times and smooth interactions with the application, contributing to a positive user experience.
-
Reliability: By uncovering and addressing performance bottlenecks, performance testing enhances the reliability of the application, reducing the likelihood of crashes or downtime.
-
Scalability: Performance testing helps determine the scalability of the application, ensuring it can handle increased loads as user numbers grow without compromising performance.
-
Cost Savings: Identifying and addressing performance issues early in the development lifecycle can lead to cost savings by preventing the need for extensive rework and post-release fixes.
-
Requirement Analysis: Understand the performance requirements and objectives, including expected response times, concurrent user loads, and other relevant metrics.
-
Test Planning: Develop a comprehensive performance test plan outlining the testing strategy, test scenarios, test data, and performance metrics to be measured.
-
Test Design: Create performance test scenarios based on user workflows, defining the virtual user behavior, and selecting appropriate performance testing types.
-
Test Execution: Execute performance tests using selected tools, simulating real-world conditions to measure and analyze system performance.
-
Monitoring and Analysis: Monitor key performance metrics during test execution, analyze results, and identify performance bottlenecks or areas for improvement.
-
Reporting: Generate detailed performance test reports, including findings, recommendations, and performance metrics, for stakeholders and development teams.
Performance load testing involves evaluating a system's ability to handle a specific expected load or concurrent user activity within normal operational parameters. It helps identify the maximum capacity of a system, ensuring that it can handle the expected number of users, transactions, or data volumes without degrading performance.
Performance stress testing is conducted to assess how well a system can handle extreme conditions or stress levels beyond its normal capacity. The goal is to identify the breaking point of a system, uncover bottlenecks, and understand how it behaves under extreme load to prevent performance failures under unexpected situations.
Performance soak testing involves running a system under a sustained load for an extended period to assess its stability and performance over time. It helps identify memory leaks, resource utilization issues, and other gradual performance degradations that may occur over an extended period, simulating real-world usage scenarios.
Performance spike testing evaluates a system's ability to handle sudden and sharp increases in load or traffic. It assesses how well a system can scale up to accommodate unexpected spikes in user activity, such as during promotional events, product launches, or sudden increases in website traffic.
A simple controlled scenario is defined to run the different types of performance tests.
The system allows users to log in using JWT for authentication. Upon successful login, the system issues a JWT token that must be included in subsequent requests to access protected resources.
Test scenario
- Simulate concurrent user login attempts.
- Each login attempt includes a valid username and password.
- Upon successful login, the system issues a JWT token.
- The token must be included in subsequent requests for accessing protected resources.
System parameters
- Normal design capacity: 2000 concurrent users.
- Maximum design capacity: 3000 concurrent users.
Scenario thresholds
- HTTP errors: HTTP errors should be less than 1%.
- Response time: 95% of requests should be below 500ms.
Scenario parameters
- Maximum number of users: 2400 concurrent users, 20% more than the normal design capacity.
- Test duration: 5 minutes.
Steps
- Ramp-up period: increase the number of users from 0 to 2400 in 1.5 minutes.
- Constant period: keep the number of users constant at 2400 for 2 minutes.
- Ramp-down period: decrease the number of users from 2400 to 0 in 1.5 minutes.
Scenario parameters
- Maximum number of users: 3600 concurrent users, 20% more than the maximum designed capacity.
- Test duration: 5 minutes.
Steps
- Ramp-up period: increase the number of users from 0 to 3600 in 5 minutes.
Scenario parameters
- Number of users: 2200 concurrent users, 10% more than the normal design capacity.
- Test duration: 10 minutes.
Steps
- Constant period: keep the number of users constant at 2200 for 10 minutes.
Scenario parameters
- Test duration: 5 minutes.
- Number of spikes: 2 spikes of 3600 concurrent users, 20% more than the maximum designed capacity.
Steps
- Constant period: keep the number of users constant at 2000 for 1.5 minutes.
- first spike: increase the number of users from 2000 to 3600 for 3 seconds.
- Constant period: keep the number of users constant at 2000 for 2 minutes.
- second spike: increase the number of users from 2000 to 3600 for 3 seconds.
- Constant period: keep the number of users constant at 2000 for 1.5 minutes.
- Performance testing using k6 + Elasticsearch + Kibana + Docker compose
- Performance testing using Gatling with Java and Scala
- Performance testing using Locust
This project has resources that are generated programmatically using jupyter notebook, to edit them this tool is required.
pip install -r requirements.txt
jupyter lab --notebook-dir docs/images/jupyter/