In this section, we will learn about performance testing, why we need it, types of performance testing, and the performance testing process.
Following are the topics, which we will understand in this section:
What is performance testing?
It is the most important part of non-functional testing.
Checking the behavior of an application by applying some load is known as performance testing.
Generally, this testing defines how quickly the server responds to the user's request.
While doing performance testing on the application, we will concentrate on the various factors like Response time, Load, and Stability of the application.
Response time: Response time is the time taken by the server to respond to the client's request.
Load: Here, Load means that when N-number of users using the application simultaneously or sending the request to the server at a time.
Stability: For the stability factor, we can say that, when N-number of users using the application simultaneously for a particular time.
When we use performance testing?
We will do performance testing once the software is stable and moved to the production, and it may be accessed by the multiple users concurrently, due to this reason, some performance issues may occur. To avoid these performance issues, the tester performs one round of performance testing.
Since it is non-functional testing which doesn't mean that we always use performance testing, we only go for performance testing when the application is functionally stable.
Note: Performance testing cannot be done manually since its costly and accurate result can't be maintained.
Types of Performance Testing
Following are the types of performance testing:
- Load testing
- Stress testing
- Scalability testing
- Stability testing
![Performance Testing](https://static.javatpoint.com/tutorial/software-testing/images/performance-testing.png)
Let us discuss one by one to give you a complete understanding of Load, Stress, Scalability, and Stability performance testing.
Load testing
The load testing is used to check the performance of an application by applying some load which is either less than or equal to the desired load is known as load testing.
For example: In the below image, 1000 users are the desired load, which is given by the customer, and 3/second is the goal which we want to achieve while performing a load testing.
![Performance Testing](https://static.javatpoint.com/tutorial/software-testing/images/performance-testing2.png)
Stress Testing
The stress testing is testing, which checks the behavior of an application by applying load greater than the desired load.
For example: If we took the above example and increased the desired load 1000 to 1100 users, and the goal is 4/second. While performing the stress testing in this scenario, it will pass because the load is greater (100 up) than the actual desired load.
![Performance Testing](https://static.javatpoint.com/tutorial/software-testing/images/performance-testing3.png)
Scalability Testing
Checking the performance of an application by increasing or decreasing the load in particular scales (no of a user) is known as scalability testing. Upward scalability and downward scalability testing are called scalability testing.
Scalability testing is divided into two parts which are as follows:
- Upward scalability testing
- Downward scalability testing
Upward scalability testing
It is testing where we increase the number of users on a particular scale until we get a crash point. We will use upward scalability testing to find the maximum capacity of an application.
Downward scalability testing
The downward scalability testing is used when the load testing is not passed, then start decreasing the no. of users in a particular interval until the goal is achieved. So that it is easy to identify the bottleneck (bug).
Stability Testing
Checking the performance of an application by applying the load for a particular duration of time is known as Stability Testing.
Performance testing example
Let us take one example where we will test the behavior of an application where the desired load is either less than 1000 or equal to 1000 users.
In the below image, we can see that the 100 up users are increased continuously to check the maximum load, which is also called upward scalability testing.
- Scenario1: When we have the 1000 users as desired load, and the 2.7/sec is goal time, these scenarios will pass while performing the load test because in load testing, we will concentrate on the no. of users, and as per the requirement it is equal to 1000 user.
- Scenario2: In the next scenario, we will increase the desired load by 100 users, and goal time will go up to 3.5\sec. This scenario will pass if we perform stress testing because here, the actual load is greater than (1100) the desired load (1000).
- Scenario3: In this, if we increase the desired load three times as
1200 → 3.5\sec: [it is not less than or equal to the desired load that's why it will Fail]
1300 → 4\sec: [it is not less than or equal to the desired load. i.e., Fail]
1400 → Crashed
![Performance Testing](https://static.javatpoint.com/tutorial/software-testing/images/performance-testing4.png)
Note1: Volume and soak testing is a type of testing but not performance testing.
Volume testing
Volume testing is testing, which helps us to check the behavior of an application by inserting a massive volume of the load in terms of data is known as volume testing, and here, we will concentrate on the number of data rates than the number of users.
Note2:
Volume is a capacity while Load is a quantity, i.e., load testing means no. of users, and volume testing means amount of data.
Soak testing
In this type of testing, we will check the behavior of an application on the environment, which is unsupportive for a long duration of time is known as soak testing.
Generally, soak testing is a negative type of testing since we already know that the server or environment is not supportive.
Performance testing process
The performance testing cannot be done manually since:
- We need a lot of resources, and it became a costlier approach.
- And the accuracy cannot maintain when we track response time manually.
The Performance testing process will be completed in the following steps:
- Identify performance scenarios
- Plan and design performance test script
- Configure the test environment & distribute the load
- Execute test scripts
- Result
- Analysis result
- Identify the Bottleneck
- Re-run test
![Performance Testing](https://static.javatpoint.com/tutorial/software-testing/images/performance-testing5.png)
If we perform a positive flow of the performance testing process, it could follow the below process:
Identify performance scenarios
Firstly, we will identify the performance scenarios based on these below factors:
Most commonly scenarios: It means that we can find the performance scenarios based on the scenarios, which commonly used like in the Gmail application; we will perform login, inbox, send items, and compose a mail and logout.
Most critical scenarios: Critical scenarios mean regularly used and important for the business-like in Gmail application login, compose, inbox, and logout.
Huge data transaction: If we have huge data means that n-number of the users using the application at the same time.
Once we identify the performance scenarios, we will move to the next step.
Plan and design performance test script
In this step, we will install the tools in the Test Engineer Machine and access the test server and then we write some script according to the test scenarios and run the tool.
Once we are done with writing the script, we will go to the next step.
Configure the test environment & distribute the load
After writing the test scripts, we will arrange the testing environment before the execution. And also, manage the tools, other resources and distribute the load according to the "Usage Pattern" or mention the duration and stability.
Execute test scripts
Once we are done with distributing the load, we will execute, validate, and monitor the test scripts.
Result
After executing the test scripts, we will get the test result. And check that the result meeting the goal in the given response time or not, and the response time could be maximum, average, and minimum.
If the response is not meeting the required time response, then we will go for the negative flow where will perform the below steps:
Analysis result
First, we will analyze the test result whether it meets with the response time or not.
Identify the Bottleneck
After that, we will identify the bottleneck (bug or performance issue). And the bottleneck could occur because of these aspects like the problem in code, hardware issue (hard disk, RAM Processor), network issues, and the software issue (operating system). And after finding the bottleneck, we will perform tuning (fix or adjustment) to resolve this bottleneck.
Re-run test
Once we fix the bottlenecks, re-run the test scripts and checks the result whether it meets the required goal or not.
The problem occurs in performance testing
While performing performance testing on the application, some problems may occur, and these problems are also called the performance issue.
The performance issues are as follows:
- Response time issue
- Scalability issue
- Bottleneck
- Speed issue
Response time issue
The response time means how quickly the server respond to the client's request. If the user's request does not complete in the given response time, it might have possible that the user may be lost his/her interest in the particular software or application. That's why the application or software should have a perfect response time for responding user's request quickly.
Scalability issue
The scalability issues occur when the application cannot take the n-numbers of users and expected user requests at the same time. That's why we will do upward scalability testing (check the maximum capacity of the application) and downward scalability testing (when expected time is not matched with the actual time).
Bottleneck
The Bottleneck is the informal name of bug, which occurs when the application is limited by a single component and creates a bad impact on the system performance.
The main causes of bottlenecking are software issues (issue related to the operating system), hardware issues (issues related to the hard disk, RAM and the processor), and coding issue, etc.
Following are the most common performance bottlenecks:
- Memory utilization
- Disk usage
- CPU utilization
- Operating System limitations
- Network utilization
Speed issues
When we perform performance testing on the application, the application should be faster in speed to get the user's interest and attention because if the application's speed is slow, it may lose the user interest in the application.
Performance test tools
We have various types of performance testing tools available in the market, where some are commercial tools and open-source tool.
Commercial tools: LoadRunner[HP], WebLOAD, NeoLoad
Open-source tool: JMeter
LoadRunner
It is one of the most powerful tools of performance testing, which is used to support the performance testing for the extensive range of protocols, number of technologies, and application environments.
It quickly identifies the most common causes of performance issues. And also accurately predict the application scalability and capacity.
JMeter
The Apache JMeter software is an open- source tool, which is an entirely a Java application designed to load the functional test behavior and measure the performance.
Generally, it was designed for testing the Web Applications but now expanded to other test functions also.
Apache JMeter is used to test performance for both static and dynamic resources and dynamic web applications.
It can be used to reproduce the heavy load on a server, network or object, group of servers to test its strength or to analyze overall performance under different load types.
WebLOAD
WebLOAD testing tool used to test the load testing, performance testing, and stress test web applications.
The WebLOAD tool combines performance, scalability, and integrity as a single process for the verification of web and mobile applications.
NeoLoad
Neotys develop a testing tool which is called NeoLoad. The NeoLoad is used to test the performance test scenarios. With the help of NeoLoad, we can find the bottleneck areas in the web and the mobile app development process.
The NeoLoad testing tool is faster as compared to traditional tools.
Apart from them, some other tools are Electric load, web stress tool, LoadUI Pro, StresStimulus, LoadView, LoadNinja, and RedLine13, which helps to test the performance of the software or an application.
0 Comments