The exact procedure to do a performance test varies between projects and organizations. It depends what parameters are most important to the business or application under test. However, the general goals largely fall under the same broad category. Below are the steps which are followed to conduct a performance test-
1. Identify Test Environment
First step before conducting a performance test (or any test) is to identify the environment. Performance test requires an environment which is scaled to match production to get a good assessment of performance issues which might occur. We should document the architecture and understand the underlying infrastructure. It helps to create our test suite.
Please note that sometimes, we may have to do a performance test in a production environment, but this activity should be done ensuring that proper checks are in place and real customers are not disrupted.
2. Define the transactions to performance test
Think about the transactions that are widely used by customers. For example- Ordering in an ecommerce website. There are plenty of use cases possible in each application under test. However, not all of them result in a load to servers that can cause performance issues. Hence, as a performance tester, you need to analyze the transactions that generate a good amount of load on servers. We can use data analytics tools to get the specifications to design our tests. Based on data available, we need to design our scripts which can mimic the user actions and generate the required load.
3. Define the acceptance criteria
Next step is to determine the goals, constraints and thresholds that determine if a transaction is a pass or not. These come from project specifications in terms of non-functional requirements. An example of acceptance criteria is as below
Transaction # |
Transaction Description |
SLA Target [Sec] |
1 |
Search_SLA |
5 |
4. Prepare the test data
When we know the transactions, which can result in load, next step is to create the data to simulate such kind of load in a non-production environment which has been scaled to match production (in terms of infrastructure). For example, preparing data for search, preparing data for ordering etc. If the application has different kind of user privileges, we need to create different kind of users with different access and generate load proportionate to user base in production. If we are performance testing a migration project, we can create a mix of users which have been migrated and which are still non-migrated.
5. Execute and Monitor the test
Next step is to execute the performance test using the appropriate tool. Common performance testing tools can help mock user transactions to generate the load on a given environment. Also, as a performance tester, you should monitor the test. In a well-designed performance test, the load is generated gradually before the number of virtual users reach a steady state. Once the test is in steady state, it means that application is being tested for “Peak load”, expectation is that all transactions should work as they did without the full load.
Another thing to keep in mind while monitoring the performance test is the health of underlying infrastructure. For example, if one of the JVMs is not in a healthy state, there is no point to continue the test till the end. It is better to terminate and restart the test.
Also, it is also advisable to avoid any kind of batch transactions to be run during a Peak load test since it will hamper debugging/isolating of any real performance issues.
6. Resolve the issues and Retest
Once we identify a performance issue, it can be tracked as a bug. However, one thing to note there is that PT defects should not be treated with same defect resolution SLAs as functional defects. Resolving a performance defect may take involvement of number of teams- developers, DBAs, platform architects etc. Once the issue is resolved, we should run at least 2 performance tests to see if the transaction under test is meeting the SLAs consistently to consider the bug as fixed.
Another thing to keep in mind while doing a performance test is to mimic the SOPs (Standard Operating Procedures) from production. For example, if your production application stack gets restarted once a week, same should be followed with your performance test environment. This will simulate exact scenarios as occurring in production.
7. Reporting
Performance Test Report comprises of:
There are few points which should be taken care for reporting.
Start the analysis with some basic metrics like,
Analyze the graphs:
Performance Testing “Day in a life” Scenarios
Day in a life scenario means that we are simulating the kind of transactions which a normal customer on production will do, how will those be processed end-to-end while interacting with various backend systems (example, fulfillment systems like SAP). These scenarios become crucial when multiple front-end systems like Website, App connect to one back-end system and performance of back-end system derives the output on frontend. In such scenarios, using correct workload which is a mix of multiple frontend systems is very crucial and making tests more realistic.
Conclusion: Performing a performance test with a definite strategy is a game changer. It sets-up a smooth and channelized process to achieve the performance testing goal. Performance Testing Life Cycle helps the application development companies to develop a performance- tuned application, improvise the performance of the application and meet the customer’s expectations.