Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

eccanto/base-performance-testing-documentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Performance testing

Performance testing types

Table of contents

Performance testing

What is Performance Testing?

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.

Importance of Performance Testing

  • 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.

Detection bugs cost

Performance Testing Process

  1. Requirement Analysis: Understand the performance requirements and objectives, including expected response times, concurrent user loads, and other relevant metrics.

  2. Test Planning: Develop a comprehensive performance test plan outlining the testing strategy, test scenarios, test data, and performance metrics to be measured.

  3. Test Design: Create performance test scenarios based on user workflows, defining the virtual user behavior, and selecting appropriate performance testing types.

  4. Test Execution: Execute performance tests using selected tools, simulating real-world conditions to measure and analyze system performance.

  5. Monitoring and Analysis: Monitor key performance metrics during test execution, analyze results, and identify performance bottlenecks or areas for improvement.

  6. Reporting: Generate detailed performance test reports, including findings, recommendations, and performance metrics, for stakeholders and development teams.

Performance Testing Types

Load Testing

Load testing

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.

Stress Testing

Stress testing

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.

Soak Testing (Endurance Testing)

Soak testing

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.

Spike Testing

Spike testing

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.

Example

A simple controlled scenario is defined to run the different types of performance tests.

Scenario: User login with JWT authentication

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.

Case 1: Load testing

Scenario parameters

  • Maximum number of users: 2400 concurrent users, 20% more than the normal design capacity.
  • Test duration: 5 minutes.

Steps

  1. Ramp-up period: increase the number of users from 0 to 2400 in 1.5 minutes.
  2. Constant period: keep the number of users constant at 2400 for 2 minutes.
  3. Ramp-down period: decrease the number of users from 2400 to 0 in 1.5 minutes.

Load testing example

Case 2: Stress testing

Scenario parameters

  • Maximum number of users: 3600 concurrent users, 20% more than the maximum designed capacity.
  • Test duration: 5 minutes.

Steps

  1. Ramp-up period: increase the number of users from 0 to 3600 in 5 minutes.

Stress testing example

Case 3: Soak testing

Scenario parameters

  • Number of users: 2200 concurrent users, 10% more than the normal design capacity.
  • Test duration: 10 minutes.

Steps

  1. Constant period: keep the number of users constant at 2200 for 10 minutes.

Soak testing example

Case 4: Spike testing

Scenario parameters

  • Test duration: 5 minutes.
  • Number of spikes: 2 spikes of 3600 concurrent users, 20% more than the maximum designed capacity.

Steps

  1. Constant period: keep the number of users constant at 2000 for 1.5 minutes.
  2. first spike: increase the number of users from 2000 to 3600 for 3 seconds.
  3. Constant period: keep the number of users constant at 2000 for 2 minutes.
  4. second spike: increase the number of users from 2000 to 3600 for 3 seconds.
  5. Constant period: keep the number of users constant at 2000 for 1.5 minutes.

Spike testing example

Implementations

Developers

This project has resources that are generated programmatically using jupyter notebook, to edit them this tool is required.

Requirements

pip install -r requirements.txt

Edit resources

jupyter lab --notebook-dir docs/images/jupyter/

About

Performance testing summary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published