Overall testing under the Web--performance testing and optimization ideas

Source: Internet
Author: User
Tags rounds

With the increasing popularity of the internet, there are more and more large-scale applications based on B/s structure, and how to test these applications becomes an increasingly urgent problem. There are many testers letter asked me b/s test how to do, because the work is more busy, the problem is also a piecemeal, there is no web testing process to do a general overview. Hopefully, this article will give you an idea of how large Web applications can be tested.

b/S function test is relatively simple, the key is how to do a good performance test. Most testers now think that just run some test tools to prove that my product can achieve performance is OK, in order to prove that the test is not any value, the key is to find product performance defects, positioning problems, solve problems, this is the test to do.

First of all, we analyze from two aspects of how to conduct web testing, from the technical implementation of the general B/s structure, whether it is. NET or Java EE, are multi-layered architecture, interface layer, business logic layer, data layer. From the testing process, the first is to find the problem, analyze the problem, locate the problem, and then by the developer to solve the problem. Then b/s structure of the test how to do?

How to find the problem is my first to introduce, before doing the Web test you need some information, such as product function specification, performance requirements specification, not necessarily perfect, but must have, clear test objectives, this is the basic common sense, but I often see is already started to test, But I do not know what the performance index of the system to achieve. Here I briefly describe the performance metrics of the test:

L General indicators (refers to Web application server, database server required test items):

* Processortime: Refers to the server CPU utilization rate, the average reaches 70% when the service is nearly saturated;

* Memory Available MByte: The number of available RAM, if the test found that memory changes should also be noted, if the memory leak is more serious;

* Physicsdisk Time: Physical Disk read and write times;

L Web Server metrics:

* AVG Rps: Average number of responses per second = Total Request time/seconds;

* Avg time to last byte per Terstion (mstes): The average number of iterations per second of the business corner, someone would confuse the two;

* Successful Rounds: a successful request;

* Failed Rounds: Failed request;

* Successful Hits: The number of successful clicks;

* Failed Hits: The number of failed clicks;

* Hits per Second: number of clicks per second;

* Successful Hits per Second: Number of successful clicks per second;

* Failed Hits per Second: Number of failed clicks per second;

* Attempted Connections: Number of attempts to link;

L Database Server metrics:

* User 0 Connections: The number of users connected, that is, the database connection;

* Number of Deadlocks: Database deadlock;

* Butter Cache Hit: Database Cache hits;

We first say performance optimization and exception handling, performance optimization has a principle, that is, the maximum time ratio of optimization, the effect is most obvious, such as a function of its execution time is 30 seconds, If you optimize 100 times times the execution time is 0.3 seconds, the increase of 29.7 seconds, and if its execution time is 0.3 seconds, optimized for 0.003 seconds, the actual increase of 0.297 seconds, the effect of ascension is not obvious, and the people who wrote the program know that the latter is more expensive performance optimization. In the performance optimization process, the general is the first database, after the program, because the database optimization does not need to modify the program, the risk of modification is very small. But how to determine the problem of the database, which requires skills, in the use of quantity, you go all the way down, most will eventually find that the database query function occupies a large time, such as what, Sqlcmd.executenoquery and so on database execution function, Then you need to analyze the database, hehe. The principle of database analysis is first index, after stored procedure, the final table structure view optimization, index optimization is the simplest and usually the most effective method, if reasonable use will bring unexpected effect. Here I would like to give you a brief introduction of my favorite, Sqlprofile,sql Query Analyzer, Precise,sqlprofile is a SQL statement tracker, you can track the application process using SQL statements and stored procedures, combined with Query Analyzer analysis of SQL, The index can be optimized to make a good judgment, but the index is not omnipotent, in addition and deletion of more tables, too many indexes will cause the performance of these operations decline, so the judgment still need some experience. While optimizing for the most frequently used SQL is also the most effective, I need precise, which can observe the execution of SQL statements over a longer period of time. The potential of database optimization after digging the light, if still not achieve the performance requirements or still have a problem, you want to optimize from the program, this is what the programmer does, the tester to do is to tell them, which function too much to cause performance degradation, such as too much, a loop too much, or too many DCOM calls, etc. But convincing programmers is not an easy task, you have to do a good job at this stage must have a few years of programming experience, and to let the programmer feel that your performance will improve, this is a very difficult thing oh.

Memory analysis, is generally a long-term analysis of the process, to do very hard, first of all to have long-term struggle preparation, and then the memory leak analysis is best placed in the unit test synchronous, rather than wait until the last to find the problem, of course, the problem has to face, Generally this kind of problem is in the server has been running for a long time to expose, once found the problem, you need to locate the problem, the principle of the analysis of the subsystem to operate independently of each other, to find the smallest problem of the system set, or the use of memory analysis tools to observe the memory objects, the initial positioning problems, and then use purify to run Generally, C + + memory problems are more, Java and. NET less, generally caused by the GC unreasonable. C + + memory errors are more, the main common is:

1, array Bounds read (ABR): Array out-of-bounds read

2, array Bounds write (ABW): Array out-of-bounds write

3. Beyond stack Read (BSR): Stack out-of-bounds read

4. Free memory Read (FMR): Idle

5. Invalid pointer Read (IPR): illegal pointer reading

6, NULL Pointer read (NPR): null pointer read

7. Uninitialized memory Read (UMR): Uninitialized Ram read/write

8. Memory Leak: Leak

Note: If you need more information, see the Help information for purify.

By the way, why should I say unit tests do this better, because unit testing is for a single function, when the combination of unit test case to do memory analysis will be faster to locate the problem, and due to the early detection of the problem, the later risk will be reduced, of course, if combined with the Code coverage tool Purecoverage To do is more perfect, hehe.

Completion of this article, is already the early morning, also is to answer the previous period of time proposed to carry out B/s structure test and the friend's request, here to everyone to express their apologies, because the work is busy, inevitably to everyone's letter has been overlooked, please forgive us. This article of the requirements of the reader, the test tools have some knowledge, hope to enter the deeper testing of colleagues, I hope that my article to bring you help, but also to express some of my friends and colleagues who have helped me.

Note: This article is only for the B/s application of the test process as a whole description, the use of a certain stage of the tool is only a general introduction, you can also use your more familiar tools to achieve the same goal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.