Applications are becoming increasingly complex and with a reduced development cycle. This necessitates the adoption of new, agile development and testing methodologies. Application performance as a component of the overall user experience is now among the most important aspect of application quality.
Sequential projects with static qualification/implementation/test phases that postpone performance testing until the end of the project may face performance risks. By today’s application quality standards, this is no longer acceptable.
This article will give you practical advice on how to conduct efficient performance testing in this new and more demanding environment.
Stage 1- Software analysis and requirements preparation
Before beginning performance testing, it is critical to ensure that the software configuration has been properly adjusted. When the system is deployed, functional testing should be performed to ensure that the main functions used for performance checks work properly.
The examination of a system’s features, operation mode, and peculiarities are part of its analysis. To achieve the following goals, detailed analysis is required:
- Simulate the best user behavior patterns and load profiles
- Determine the amount of test data required
- Identify system bottlenecks
- Define the software monitoring methods
The primary focus should be on defining the success criteria for the tests that are usually included in the SLA (service-level agreement). The criteria that the system technically corresponds to are called the requirements. The requirements defined during the first stage will be compared to the received results to evaluate the behavior of the product and system units and determine the bottlenecks. There are so many crucial performance testing metrics that are used as success criteria.
System analysis encompasses all information about the software, testing objectives, planned test runs, test stand configuration, performance testing tools, user behavior scenarios, load profile, testing monitoring, load model, application requirements, and the method of delivering results.
Stage 2- Design Testing Strategy
The testing strategy is developed based on detailed system analysis as described above. Below are the steps to develop an ideal testing strategy:
2.1. Choosing optimal performance testing tool
These tools can be used to conduct performance testing:
|The test results are well-structured and stored in an MS SQL database.
There is no limit to the number of virtual users covered by the license.
|Declarative tests have limited functionality for scripts logic.
Declarative tests are the only type of testing available for SharePoint.
|Provides a distributed architecture (VuGen, Controller, Load Generator, Analysis).
There are tools available for working with various protocols.
Allows you to generate reports and create report templates.
It is possible to keep detailed action logs for each virtual user.
|The number of virtual users is limited.
The number of updates is relatively low.
|It is possible to run tests with complex logic and dynamic parameter correlation. Web application testing is possible (including API and web services, database connections).
Allows you to simulate the behavior of multiple users in multiple parallel threads while applying a heavy load to the web application.
|Encounters issues in the reproduction of AJAX traffic.
There’re limited reporting functions.
Requires many resources of RAM and CPU for test launching.
2.2. Design of a load profile and a load model
As part of the performance testing process, statistics on application usage are gathered. The data gathered is required for the creation of the load profile – a user behavior model.
Different load models can be used in the same test. For example, one new virtual user could be added every five minutes, or all users could be added all at once. The query rate, test duration,
and the number of users are the most important aspects of the load model.
2.3. Configuration of the test stands
The results of performance testing can be influenced by a variety of factors such as test stand configuration, network load, database content, and many others.
As a result, to obtain the most reliable results, performance testing should be carried out in a separate environment with features and configurations that are similar to the parameters of the real software.
|Test stand elements||Feature|
ArchitectureDatabase (structure, data)Software required for the system operation
Network mappingBandwidth performanceCommunication protocol
Operational system (version and service packs)Application server (version and patches)DBMS (version and type)
|Hardware||CPU (number of cores, type, clock speed)Random-access memory (space, type)Hard disk (type, speed)|
Stage 3- Load generator configuration and monitoring
Performance testing tools should be installed on a load generator to produce high-quality results. It is a virtual or physical machine that is near the application server(s).
If a heavy load is to be generated, one machine’s resources may be insufficient. Distributed performance testing is carried out in this case.
Software monitoring can be carried out with the assistance of tools for controlling system hardware resources consumption.
The following are the most popular hardware monitoring tools:
- New Relic: The performance tracking service offers analytics for every component of the environment. The tool is a powerful tool for viewing and analyzing massive amounts of data and obtaining information about real-time actions.
- Grafana: This monitoring data visualization tool can analyze data from Graphite, InfluxDB, and OpenTSDB time-series databases.
- Zabbix: The software employs a “server-agent” model. The server collects all of the data and allows you to view the monitoring history as well as set up metrics and rules.
- JProfiler combines CPU, memory, and thread profiling, making it simple to determine what should be optimized, eliminated, or modified. This tool can be used for both local and remote services.
- Xdebug is a powerful tool used to analyze PHP code and identify bottlenecks and slow elements.
- XHprof decomposes the application into function calls (methods) and generates resource consumption statistics for them. The metrics include the amount of allocated memory, the number of function calls, the execution time, and many others.
- PostgreSQL is an object-relational database management system that is free to use. The pgBadger profiler can be used to achieve performance testing objectives.
- MS SQL Server Profiler is a tool for tracking, reconstruction, and debugging of the MS SQL Server. It enables the creation and processing of queries.
Stage 4- Test Data Generation and Test Scripts Development
Let’s look at four different types of test data generation:
Scripts written in various programming languages (Java, Python) enable the creation of users, passwords, and other values required for proper data usage.
SQL queries can also be used to populate a database. This method is only available if the database is accessible from the server. The approach can be implemented as follows: first, a completed DB in MS Access with fields identical to the server-side database is created; second, a dump file containing requests to add information to the DB is created.
API requests can be used to populate the database with items for sale or user information. One or two phone calls will suffice.
For filling the database via the system interface, a script that mimics the steps of the user registration process can be developed. The script adds new users to the database. A snapshot of the file system can be created in order to use the newly created users for test execution.
Stage 5: Preliminary Launch and Test Execution
Preliminary tests aid in determining the best load model for the system. They also show how the application resources are used and whether the power of the load generator(s) is sufficient for running full-scale tests.
The tests should be run with various load models. As a result, the testing load is determined based on software monitoring and analysis. For test execution, there are many types of checks, like stress testing, lead testing, stability testing, volume testing, etc. Read more in detail.
Performance testing is an ongoing process.
Performance testing needs to be carried out on a regular basis. Hopefully, your website or application will continue to grow, necessitating changes to accommodate a larger user base.
Contact us to find out how performance testing experts can improve the quality of your solution.