With the rapid development of the software industry, the modern software system more and more complex, more and more functions, testers in addition to the need to ensure the basic functional testing quality, performance has been more and more people's attention. But when it comes to performance testing, many people think of LoadRunner directly. It is wrong to think that LR is equivalent to a performance test. LR is just a tool for performance testing, but performance testing is not just LR. This article will introduce the basic performance test theory from the following aspects, follow-up will also continue to update the relevant articles, as far as possible theory combined with practice, so that performance test learning is not the tool of learning.
Directory:
First, What is software performance
Second, performance in the eyes of different groups
Iii. Types of performance tests
Four, Performance Test application Scenarios
Five, Basic concepts of performance testing
Six, barber shop model and Subway pit stop model
Seven, do a good job knowledge to be mastered in performance testing
Body:
First, What is software performance
definition : Software performance is a non-functional feature of the software, it is not concerned about whether the software can complete a specific function, but in the completion of the function of the timeliness of display.
By definition, the performance focus is on the non-functional nature of the software, so the timing of performance testing is generally followed by the completion of functional testing. In addition, the timeliness of the definition of performance is also an indicator, can be measured by time or other indicators, usually we use some tools or means to detect whether certain indicators of the software meet the requirements, this is the performance test.
performance Test definition : a variety of normal, peak, and abnormal load conditions are simulated by means of automated test tools to test the system's performance indicators.
Second, performance in the eyes of different groups
Different people may think differently about the same thing or problem because of the difference of outlook on life, world outlook, values and educational background, knowledge system and life experience. The same is true for software performance, where different people may have different points of interest due to different perspectives. Here's a look at how performance differs in the eyes of different people.
- Performance in the eyes of the user
- Performance in the development eye
- Performance in the eyes of system administrators
- What is the performance in the test eye?
Testers are usually a role in software quality control, not only to find bugs, to be responsible for the quality of the entire software, performance is also part of the quality, so the test personnel in the eyes of the performance should be comprehensive, consider the things need to be comprehensive:
1, testers need to consider the overall performance, including users, development, administrators and other perspectives of the performance.
2, testing personnel in the performance test, in order to pay attention to surface phenomena such as response time, but also need to pay attention to the essence, such as the user can not see the server data utilization, the structure is reasonable design? The code is reasonable and so on all aspects.
Iii. Types of performance tests
- Benchmark: View the health of the system and record the relevant number as a base reference when applying low pressure to the system
- Load test: Refers to the system to continuously increase the pressure or increase the duration of a certain pressure, until one or more of the system's performance indicators to achieve a safety threshold, such as a resource has reached saturation and so on.
- Stress testing: The stress test is the system's operation when the system is in or exceeds the expected load, and the focus is on the system's ability to handle peak loads or exceeding the maximum load.
- Stability test: In the case of loading a certain business pressure to the system, the system will run for a period of time to detect the stability of the system.
- Concurrency testing: Testing for deadlocks or other performance issues when multiple users access the same application, the same module, or data records at the same time
Four, Performance test scenario (domain)
1. Performance test application scenario (domain) mainly include: ability verification, planning ability, performance tuning, defect discovery, performance benchmark comparison, the following table briefly introduces and compares the respective uses and characteristics of these scenes:
|
Main purpose |
Typical scenario |
Characteristics |
Common performance Test method |
Competency Verification |
Focus on the ability of the system to perform as expected under given hardware and software conditions |
How can I tell if the system is capable of supporting 500,000 users/days of traffic on the premise that the average response time is less than 2 seconds? |
A) required to operate in a defined environment b) The need to design test scenarios and use cases based on typical scenarios, including operational sequences and concurrent user volumes, requires clear performance objectives. |
A) Load test b) pressure test c) Stability Performance testing |
Planning capabilities |
Focus on how the system has the performance capabilities we require
|
A system plan in one year to get the guest in the amount of XXX million, the system will be able to support so many user volume? What if you don't need to adjust the configuration of the system? |
A) It's an exploratory test. b) methods commonly used to understand system performance and gain extended performance |
A) Load test b) pressure test c) configuration test |
Performance tuning |
Mainly used for the tuning of system performance |
What should be done when the response speed of a system is getting slower after a certain time? |
Change only one configuration at a time to avoid endless tuning |
A) Concurrency test b) pressure test c) configuration test |
Defect Discovery |
Identify defects or problems reproduce, positioning means |
Some defects can be exposed only under high loads, such as thread locks, resource contention, or memory leaks. |
As a complement to system testing, to identify concurrency problems, or to reproduce and locate problems that have arisen in the system |
A) Concurrency test b) pressure test
|
Performance Benchmark Comparison |
Often used in the agile development process, the agile development process is characterized by small steps, quick trial and error, short iteration cycles and frequent changes in demand. It is difficult to define well-defined performance test objectives, and there is no time to conduct detailed performance tests on each iteration, and to determine whether the iteration has achieved the goal by comparing performance changes in each iteration by establishing a performance baseline. |
2, usually in a performance scenario (domain) need to jointly use a variety of performance test methods for performance testing, the following table for the performance test application area and test Method Association:
|
Competency Verification |
Planning capabilities |
Performance tuning |
Defect Discovery |
Performance Benchmark Comparison |
Benchmark Test |
√ |
|
√ |
|
|
Load test |
√ |
√ |
√ |
|
|
Pressure test |
√ |
√ |
√ |
√ |
√ |
Concurrency test |
|
|
|
√ |
√ |
Stability Testing |
√ |
|
|
|
|
Five, Basic concepts of performance testing
1. Response Time
A) Definition: Send a request from the user to the user receives the response data returned by the server this time is the response time
b) Critical path: The path to an HTTP request, the request will be sent over the network to the Web server for processing, if you need to operate DB, and then forwarded to the database for processing, and then return the value to the Web server, the Web server finally return the resulting data to the client network.
c) Calculation method: Response time = (N1+N2+N3+N4) + (A1+A2+A3), i.e.: (Network times + application processing time)
D) Response time-load correspondence relationship:
The inflection point in the figure shows:
1. Sudden increase in response time
2, means the system of one or more resources to achieve the limits of the use of
3, usually can use the inflection point to carry on the performance test analysis and the localization
2. Throughput
a) Definition: The number of client requests processed by the system within a unit of time
b) Unit of calculation: general use The number of requests/sec is the unit of throughput, which can be expressed using the number of pages/stopwatch.
also, from a business perspective, you can use the number of visitors/days or page views/days as units.
c) Calculation method: Throughput = (number of requests)/(total time).
D) throughput-load correspondence relationship:
The inflection point in the figure shows:
1, the throughput gradually reached saturation
2, means the system of one or more resources to achieve the limits of the use of
3, usually can use the inflection point to carry on the performance test analysis and the localization
3, concurrent number:
Concurrent Users : The number of users who submitted requests to the system at a physical moment, which could be the same scene or feature, or a different scene or feature.
number of users online: the number of users accessing the system during a certain period of time, and these users do not necessarily submit requests to the system
number of system users : Total user data registered by the system
relationship between the three: number of system users >= number of online users >= concurrent users
4. Resource utilization
a) Definition: refers to the extent to which different system resources are used, usually measured as a percentage of the maximum value
b) The following server resources are typically required:
1, CPU: Like the human brain, mainly responsible for the judgment of related matters and the mechanism of actual processing
2, Memory: Memory in the brain area, the eyes, skin and other collected information to record the place for the CPU to judge, but is temporary, access speed, if the shutdown or power loss here the data will disappear.
3. Disk IO: Memory chunks in the brain that save important data (permanent, shutdown, or power outages are not lost and slow) for future use of the data.
4. Network:
C) Resource utilization-load correspondence relationship:
The inflection point in the figure shows:
1, the server of a recommended resource use gradually reached saturation
2, usually can use the inflection point to carry on the performance test analysis and the localization
5. Other Common concepts:
A) tps:transactions per Second, number of transactions per second
b) think time: the time that the user pauses after each operation, or the interval between actions, which is not stressful for the server during this time
c) number of hits : The number of HTTP requests that the user submits to the Web server per second. This indicator is a unique indicator of Web application: The Web application is a "request-response" mode, the user makes one request and the server is processed once, so click is the smallest unit of the transaction that the Web app can handle. If you define each click as a trade, CTR and TPS are a concept. It is easy to see that the greater the CTR, the greater the pressure on the server. CTR is just a performance reference, and it's important to analyze the impact of clicks. Note that the Click here does not refer to a single click of the mouse, because in a single click, the client may make multiple HTTP requests to the server.
d) PV: Access to a URL, resulting in a PV (page View, pages access), the daily Total PV volume per site is an important indicator of the size of a website.
UV: As a standalone user, all pages that visit the site count as a single UV (Unique Visitor, user access)
Six, barber shop model and curve inflection point model
There are a number of basic concepts in performance testing, which are more abstract and can be used to help us better understand these concepts through performance testing of barber models or subway pit stop models . This is not a detailed introduction, you need to view the original text directly.
Seven, do a good job What you need to know about performance testing:
- Mastering a programming language
- master computer principles and operating system knowledge
- A Good Network Foundation
- Mastering Database Knowledge
- Middleware (APACHE,TOMCAT)
- Commonly used grab Bag tool
- Performance testing Tools
Performance Test Summary (i)---basic theory