What is performance testing? Is it like Zhu Bajie carrying his wife on his back?

Publisher:陈熙琼Latest update time:2016-10-04 Source: ednchina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Performance testing can be described using the capitalist model. Capitalists naturally want workers to work more and get paid less. Similarly, performance testing also requires the system to work more and lose less. You want the horse to run faster but eat less grass.

Many predecessors have summarized that performance testing is to find the best combination of time and space. The horse runs fast in time, and does not eat grass in space. Performance testing is to find a balance between time and space.

The above is the simplest and most general performance test

.

There are several points to focus on in performance testing:

User's point of view: The user's point of view is simple, the system is fast and stable! So if the performance test is conducted from the user's point of view, the final effect of the performance test is to improve the user experience. Most portal performance tests are written from the user's point of view to write test cases and scripts.

System perspective: The system perspective is not difficult. Under the existing performance hardware and software conditions, system testing is performed to obtain the system's shortcomings, which may be hardware bottlenecks or software defects. The final test effect of the system perspective is to optimize the system's hardware and software and eliminate the system's explicit bottlenecks.

Development perspective: The development perspective is similar to the system perspective, but the development perspective pays more attention to the software. When performance testing is performed from a development perspective, the performance test will be involved earlier than the above two perspectives. For example, after the system database design is completed, performance testing can be used immediately to test the bottlenecks in the database design, unlike the above two test perspectives, which must be performed after the system function test is stable.

In summary, performance testing from the user's perspective is the best way to meet user needs; while performance testing from the system's perspective can determine the system's performance indicators. Performance testing from the development perspective is very helpful to the development process and will also reduce the risk of subsequent performance bottlenecks.

Several common methods of performance testing

Load testing: Load testing is a test behavior from the user's point of view. Simply put, load testing is to let the system work normally under a certain load pressure to observe whether the system's performance can meet the user's needs.

Where do user needs come from? Demand analysis - specifically, demand analysis for performance testing. From this point of view, demand analysis is very important.

Load testing is to observe the performance of a software system under certain conditions from the user's perspective.

The expected result of load testing is that the user's performance requirements are met. This indicator is generally reflected in response time, transaction capacity, concurrent capacity, resource utilization, etc.

Load testing is also the most commonly used performance testing method, so many people confuse load testing with performance testing.

Stress testing: The key word of stress testing is "extreme". By applying extreme pressure to the system, the performance problems of the system can be observed. Then the performance problems are analyzed to achieve the purpose of system optimization. Therefore, stress testing must make the system have problems. If the system does not have problems, then there must be problems with the means and methods of stress testing.

Concurrency testing: Verify the concurrency capability of the system. Observe the behavior characteristics of the system under a certain concurrency amount to determine whether the system meets the concurrency requirements of the design. Concurrency testing is a test behavior from a system perspective.

Benchmark test: As the name implies, benchmark test needs a benchmark point, that is, a base point for comparison. When a new module is added to the software system, a benchmark test is required to determine the performance impact of the new module on the entire software system. According to the benchmark test method, the new module needs to be turned on/off for at least one test. The performance indicators of the system before the module is turned off are marked as the benchmark, and then compared with the system performance indicators when the module is turned on to determine the impact of the module on the system performance.

Stability test: It is very simple, perform load test for a long time to observe the stability of the system.

Recoverability test: Test whether the system can quickly recover from an error state to a normal state. For example, in a system equipped with a load balancer, if the main machine is under pressure and cannot work normally, can the backup machine quickly take over the load? Recoverability testing is usually done in conjunction with stress testing.

Well, if the above concepts are still too "magical" and make people feel confused, just like Manwen's birthday, I will use an analogy to help you better understand the above content.

There is a scene in Journey to the West called "Pigsy Carrying His Wife on His Back". Let's use this as an analogy to describe the similarities and differences of several performance testing methods.

We take Comrade Zhu Bajie as the test subject for performance testing.

Load test: Miss Gao carried by Comrade Zhu can be regarded as the load added to the "Zhu Bajie Human-Pig Hybrid System". Of course, Zhu Bajie is strong and healthy, so it should not be a problem for him to carry Miss Gao. The load test is to let Zhu Bajie walk with Miss Gao on his back (here walking is a system behavior, usually simulated by scripts). We observe whether Zhu Bajie's physiological and psychological indicators are abnormal to determine the bottleneck of the "Zhu Bajie Human-Pig Hybrid System". If Zhu Bajie has back pain and leg cramps while carrying Miss Gao, then Comrade Zhu Wuneng may be calcium deficient and needs calcium supplements; if he feels dizzy and numb in his limbs while carrying Miss Gao, then Comrade Zhu should be an outstanding representative of patients with fatty liver and alcoholic liver, which proves that Zhu Bajie needs to lose weight. If Zhu Bajie is as light as a swallow and walks fast with his young wife on his back, then we can judge that Comrade Zhu Bajie is a good comrade and the "Zhu Bajie Human-Pig Hybrid System" is a good system. Of course, this is just a conclusion based on the measurement without test standards. In order to further test the "Zhu Bajie Human-Pig Hybrid System", we need to give this system some indicators. An example of this indicator is as follows: Carrying Miss Gao, who weighs 45 kg, on a mountain road with a total length of 10 kilometers, the average speed of Comrade Zhu Bajie cannot be less than 8km/h, and his heart rate cannot be faster than 60 times/second. Well, let's do another test. We found that during the test, Comrade Zhu Bajie was still as fast as a swallow, but his heart rate was higher than 60 times/second. So at the moment when Comrade Zhu Bajie's heart rate was higher than 60 times/second, we can stop the test and help Comrade Zhu Bajie find the bottleneck. After this bottleneck problem is solved, we will test it again. Of course, if Zhu Bajie seems to be extremely strenuous and difficult to walk as soon as he carries Miss Gao on his back, then we can think that Miss Gao should lose weight (too much load), and we should let Miss Gao diet for a period of time and test it after her weight reaches the normal standard. The above is a common example of load testing.

Stress test: Comrade Zhu Bajie is still carrying his wife. We found that it was very easy for him to carry one wife at a time, so we had to increase the load and let Zhu Bajie carry his wife under extreme conditions. We can let Comrade Zhu Bajie carry 10 wives at a time, but of course this does not conform to monogamy, so we chose to let Comrade Zhu Bajie carry Sun Wukong. Sun Wukong came out of a stone, so he has a high density and mass, which meets the standards of extreme load.
The test began, and Comrade Zhu immediately sweated profusely and cried for his parents when he carried Sun Wukong on his back. Okay, the conditions for extreme load are met. We can observe Zhu Bajie's performance to determine the weakest part of Comrade Zhu Bajie's body. If we find that Comrade Zhu Bajie's abdominal strength is insufficient and it is extremely difficult to carry Sun Wukong, then we can let Zhu Bajie train his abdominal muscles to enhance his abdominal strength. In this way, we have also found the bottleneck of the system and optimized the system.

If Zhu Bajie is still relaxed and calm while carrying Sun Wukong on his back, then we can guess that the Sun classmate Zhu Bajie is carrying is not Sun Wukong but Sun Shangxiang. So we can choose a larger load for testing.

The stress test must detect the problem, otherwise we have reason to believe that the pressure load is too small and does not meet the test requirements.

Concurrent testing: mainly tests how many wives Zhu Bajie can carry on his back at one time. If the design goal of the "Zhu Bajie human-pig hybrid system" is to "carry at least three to four Miss Gao at a time", we have a scale to measure whether Zhu Bajie's performance meets the standard.

Benchmark test: If Zhu Bajie did not take any prohibited drugs when he was carried by Miss Gao, then we can use the test results as a base point, and then let Zhu Bajie drink some Red Bull or let the Manchu students take some drugs, and then conduct the same load test to see whether the **** or drinking Red Bull has any effect on Zhu Bajie's behavior of carrying Miss Gao. The **** here can mean that the software has replaced a new algorithm, or it can be understood that the system has replaced a new middleware. Of course, we can also not let Zhu Bajie carry Miss Gao, but let Sun Wukong carry Miss Gao instead, observe the test results of these two tests, and determine which system is more competent for the important task of "carrying Miss Gao".

Stability test: Let Zhu Bajie carry Miss Gao on his back for 49 days and observe the performance of the pig. If the design requirement of the "Zhu Bajie Human-Pig Hybrid System" is to carry Miss Gao for at least 49 consecutive days, but Zhu Bajie only walks for 36 days, we can think that the "Zhu Bajie Human-Pig Hybrid System" does not meet the standard and needs to be optimized.

Recoverability test: First let Zhu Bajie carry Comrade Sun Wukong on his back for half a day. At this time, Zhu Bajie is so tired that he is close to collapse. Then let Zhu Bajie carry Miss Gao on his back to see if Zhu Bajie can recover from fatigue and take on the responsibility of carrying Miss Gao.

Reference address:What is performance testing? Is it like Zhu Bajie carrying his wife on his back?

Previous article:Disassembly test of car charger and vehicle DC power supply (1)
Next article:Operational Amplifier Testing Basics

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号