You still don't know how to do performance testing? Here comes the detailed steps

Table of contents

Prerequisites for performance testing

Necessity, whether it is necessary to do performance testing (key item evaluation)

Measurability, quantifiable as a performance index value

Prerequisites for performance testing

independent network

independent environment

Performance test steps

Performance Test Preparation

Build a performance testing environment

Performance test script development

performance test execution

Performance test result analysis and tuning

Performance test reporting and results tracking

Summarize


Prerequisites for performance testing

Necessity, whether it is necessary to do performance testing (key item evaluation)

  • Competent department, regulatory department review
  • Involving life and property safety
  • large new system
  • core system
  • structural adjustment
  • Business surge
  • major bug fixes

Measurability, quantifiable as a performance index value

  • Generally, there are requirements documents. According to the requirements put forward by the boss or the product, we need to quantify the content of the requirements into performance index values . This is the expected result of our performance indicators.
  • If it cannot be quantified , we have no expected performance index value, and the performance index value measured in the performance test has no comparable value, so we do not know whether it meets the needs of the demand

                  

 

Prerequisites for performance testing

independent network

The internal network (zoom domain) and the external network are separated independently. Do not use the cross-intranet and external network

Why an independent network

  • During the performance test, a large number of requests will be sent to the server, there will be a large amount of network transmission , and network congestion may occur
  • If the network used by the functional tester is the same, it will result in longer request response time during functional testing

It is recommended to use a directly connected LAN

  • This does not mean opening up a new network line separately
  • Note: Do not connect the press machine and the server through wifi, vpn, bastion machine, or springboard machine. They are prone to network instability (such as packet loss) and may cause inaccurate performance index values.
  • Suggestion: while using LAN, wired network , the network connected to the press and the server is relatively stable, and network factors such as network delay can be ignored to affect the performance test results
  • Conclusion: If the network is not guaranteed, then the measured performance index value is not credible, because the performance results are likely to be affected by network factors, resulting in a great difference from the actual results

If using a public cloud server

There are internal and external networks, and the public network is generally used for testing, and the uplink will be relatively wide, so the network delay can be basically ignored

independent environment

Functional testing cannot share an environment with performance testing (testing environment)

  • When doing load testing , it will take up a lot of system resources in a short period of time. If there is a functional test in progress at this time, it may lead to unstable or abnormal functions.
  • When doing stress testing , system resources will be occupied for a long time, resulting in the inability to perform functional testing stably for a period of time

The test environment and production environment cannot be used

  • The production environment has various data of real users, and the amount of data must be very large [Huge user data]
  • The performance test simulates a large amount of data test, which may eventually generate a lot of data [generate data]
  • In this way, real user data + data generated by performance testing are mixed together, and the amount of data in the production environment doubles and increases, which will affect the response time of the server to real user requests [the volume of production data increases, which affects the response time of real users ]
  • The data generated by the performance test is dirty data and should not appear in the production environment, so the performance test cannot be performed in the production environment, but the hardware environment should be as consistent as possible [Dirty Data]

in conclusion

  • Therefore, performance testing requires a separate set of environments , and the hardware environment is best consistent with the production environment
  • In this way, the performance test will finally get the maximum load that the system can bear, which will be closer to the maximum load that the system can bear in the production environment.

Performance test steps

Performance Test Preparation

  • Demand analysis, familiar with the business: determine the points that need to be focused on, such as TPS, response time (determine the performance test index values ​​that need to be collected)
  • Clarify performance test objectives (expected performance index values) and test scope
  • Understand software functions and architecture
  • Develop test plans, test plans, and do a good job of workload assessment
  • Develop test models (edit test cases): such as load testing, how to design scenarios

Build a performance testing environment

  • Technical preparation: selection of performance testing tools; technical issues involved in the test plan; implementation of the test data collection plan; how to monitor system resources
  • Setting up the system environment under test (server, service version update, database data preparation)
  • Network Configuration
  • Create initial data, such as: test account (estimated concurrency)

Performance test script development

  • select protocol
  • production script
  • debug script
  • validation script

performance test execution

Really start performance testing the server

  • test run
  • scene execution
  • Collect and organize test data

                          

 

Performance test result analysis and tuning

  • Analysis Basis: Results Chart
  • Analysis ideas: server hardware bottleneck > network bottleneck > server os bottleneck (parameter configuration, database, web server) > application bottleneck (sql statement, database design, business logic, algorithm)
  • Tuning
  • Modify script or scene
  • Performance regression, compared with previous test data, whether there is optimization

server hardware bottleneck

If the performance test environment is far from the hardware of the production environment , then the hardware has caused the performance bottleneck to a large extent, and there is no need to analyze other reasons that may cause performance bottlenecks later

                     

Performance test reporting and results tracking

  • Performance test report: organize the test data before and after tuning
  • Performance testing issue tracking
  • Build a persistent performance monitoring platform to monitor system resources of online servers

Summarize

Thanks to everyone who read my article carefully! ! !

I personally sorted out some technical materials I have compiled in my software testing career in the past few years, including: e-books, resume modules, various job templates, interview books, self-study projects, etc. Welcome everyone to click on the business card below to get it for free, don't miss it.

 

 

Guess you like

Origin blog.csdn.net/MXB_1220/article/details/130393652