Summary: This article proposes a lightweight. NETApplication Performance Testing Framework Design Scheme. This scheme further expands the existing results, and is more practical and scalable.
1Introduction
Text[1]Proposed. NETThe basic idea of the application "Performance Testing Framework" is to run the program blocks to be tested through multiple threads and pass them through delegation. The main logic of the program blocks run by each thread is the same, the difference is the execution condition (such as initial parameters and execution times ). In this way, the execution time of algorithms in different environments can be obtained, and the overall time consumption distribution can be obtained. It should be said that the idea of this method is clear and easy to use. Text[1]It also gives a detailed analysis of the reasons for entrusting and giving up "reflection" and "interface", mainly to obtain more accurate test results.
However, from the perspective of practical application, this test is not comprehensive enough. It only tests a certain core program or algorithm by writing a test program similar to the test script. If the Core algorithms and intermediate steps of an application are complex, writing the corresponding test program becomes cumbersome. For exampleB/SThere are a lot of interaction processes in the program. If you want to obtain the execution time of an important business operation, the implementation of the above test framework is troublesome, and even some cannot be implemented. In addition, we consider that[1]The proposed performance testing method should be called Lightweight performance testing, because the real performance testing includes many reference indicators, not just the execution time.
To address these problems[1]And provides a more reasonable lightweight. NETApplication Performance Testing Framework (Light-weight Performance Testing Framework of. NET application, AbbreviationLPTF) Design method.
2Concept and Structure Design
First, we introduce two concepts: "Forward test" and "reverse test.
Positive testing means to run an application or function module sequentially. By embedding a test point, the running time of each stage is obtained,CPUPerformance indicators such as utilization rate and memory usage. In reverse testing, a test program is written to perform an in-depth test on a function point or application logic, and a set of performance indicators are obtained. Here, the deep test is to specify different test conditions, such as the number of executions and initial parameters.
It is not hard to see that forward and reverse tests complement each other.[1]The testing framework in is what we call reverse testing here.
Let's take a look at the structure design: