Performance Testing 101 - Introduction

Performance testing is an important aspect of software development and is used to ensure that a product or system works as expected and meets the performance requirements of its users.

Posted by PeCoBe on 2023-01-21 ·

Performance Testing 101 - Introduction

Performance Matters

Performance testing is an important aspect of software development and is used to ensure that a product or system works as expected and meets the performance requirements of its users.

We can define it as the process of measuring the speed, scalability, and stability of an application or system under normal and extreme conditions.

Performance testing is essential for any software system or product since it can help identify and address any performance issues before the product is released. In addition, performance testing can help identify potential bottlenecks in the system or architecture and can provide valuable insights into the overall design of the system. It typically involves measuring the response time of the system, the throughput of the system, the scalability of the system, and the reliability of the system.

We need to first understand the difference between Performance and Load testing.

Performance: Speed of an action or set of actions on a single client or server instance. Example: How long it takes for a user to see the first image?

Load: Number of requests a service can handle in a given period of time. Example: How the systems responds to 1,000 users trying to login?

We can test the performance from both the client side, as well as the server side:

Client performance:

  • Network Conditions.
  • Resources Needed to load/run app. Size
  • Script Execution. More scripts, bugs in scripts.
  • Image Rendering: Browser/mobile.
  • Server Performance. API call takes lot of time.

Server Performance:

  • Host Configuration. CPU/Boxes/Memory/Cloud or Onsite.
  • Data Access: Access DB or Cache?
  • Third Party Services or microservices.
  • Compute Requirements. Complex algorithm or data management.
  • Client Load: How many clients are attached to it.

But we can't forget that Performance and Load testing go together.

  • Well performing client can reduce overall load on a service.
  • The better a service performs, the more load it will be able to handle.
  • Should be started as early in the release cycle as possible.

Testing web Clients

Basic Tools:

  • Chrome Developer Tools
  • PageSpeed Insights
  • WebPageTest

What to look for?

  • When is the page visible?
  • When can the page be usable?
  • How are resources handled?
  • How much scripting is there?
  • Is network usage optimized? CDN

Mobile Testing

Important considerations for Mobile Performance

  • Less reliable network conditions
  • Wide variety of devices with varying CPUs and memory
  • More data is potentially a higher cost to your customers
  • Battery life

Tools

  • Android Studio Profiler
  • Xcode Instruments
  • Device Statistics

Load Testing Strategy

Understand the system

  • Monolithic
  • Microservices
  • Third party dependencies
  • Databases

Figuring out what to test

  • What APIs are used the most
  • What APIs are the “heaviest”
  • What APIs are most critical

What to look for

  • Slow APIs(>250ms)
  • Duplicate calls
  • Call frequency
  • Calls in correct order

Calculating load: How much is enough. In a normal distribution curve, your peak hour will have roughly 20% of total daily traffic. Use the average session length to calculate the number of concurrent sessions. Use the number of requests in a session to calculate the total number of requests per session.