A test method for improving test efficiency of a distributed system
By abstracting the management, business operations, and fault operations of a distributed system into test classes and using pairwise composite testing methods for value estimation to generate an ordered set of test cases, the inefficiency of traditional testing methods in distributed systems is solved, achieving efficient test coverage and early defect discovery.
Patent Information
- Application Number
- CN202310252408.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-12
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-03-12
AI Technical Summary
Traditional testing methods cannot effectively cover multi-point failure scenarios in distributed systems, resulting in low testing efficiency and an inability to guarantee system availability and reliability.
The paired testing approach abstracts management, business, and fault operations into different test classes. It uses priority, time cost, and resource consumption to estimate the value of test cases, generates an ordered set of test cases, and generates test cases through paired combination.
It improves the efficiency and coverage of distributed system testing, enables early detection of serious defects, saves testing costs, and is applicable to a variety of testing scenarios.
Smart Images

Figure CN116225951B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of software engineering, and particularly relates to a test method for improving the test efficiency of a distributed system. BACKGROUND
[0002] With the continuous rise in the size of the Internet user base, the business volume has experienced explosive growth, and the traditional centralized architecture has encountered various bottlenecks. Distributed systems have been around for a long time, and with the explosive growth of mobile Internet in recent years and the booming development of industrial Internet, cloud computing and other technologies, in the face of big data processing, massive storage, edge computing and other cloud computing scenarios, distributed systems have fully demonstrated their advantages: high system processing capacity, distributed systems are usually composed of a cluster of multiple servers, and the parallel processing capacity and storage capacity of the cluster are certainly higher than that of a single server; high scalability, no longer limited by the processing capacity and storage capacity of a single server, it can be easily expanded, and according to the actual business development and demand, the distributed system can be expanded / reduced, and the resource utilization can be fully optimized; high system availability, there is usually no single point of failure in the distributed architecture, and the entire system will not be unavailable due to the failure of a single server, and the system has strong fault tolerance.
[0003] With the increase in business and the expansion of the system, the distributed system will bring greater engineering scale and complexity, and the coordination and management between services also face challenges. For software testing, it also faces great challenges. In the past, single-service testing could easily achieve full path coverage according to the traditional testing methodology. However, in a distributed system, considering the execution path of a single service as n steps, if there are m services simultaneously and in parallel, then in the case of multi-point failure, the fault operation parameter list includes at least two identical fault lists In order to achieve path full coverage, according to the above formula, if there are 3 parallel processing services, each service needs 4 steps of execution, and more than 30,000 test cases are needed to achieve full path coverage, and this number increases exponentially with the increase of the number of services and the complexity of each service. Obviously, the traditional path coverage method cannot be used to test the distributed system. Secondly, in the distributed system, since multiple services communicate through the network, the network has certain unreliability, and network delay, packet loss, communication failure and other situations may occur. In addition, when a single service is under high load, resource shortage or design defects, the service may fail or directly exit. When designing and implementing a distributed system, fault tolerance is often considered. Whether the network is unreliable, the service fails or exits, or a single point of failure, it should not affect the availability and reliability of the entire distributed system. This puts higher requirements on the testing of the distributed system. The correctness and availability of the service must be ensured during testing. The traditional testing method is no longer suitable for testing the distributed system. SUMMARY
[0004] The embodiment of the application aims to provide a test method for improving the test efficiency of a distributed system, which can solve the problem of the contradiction between the test efficiency and the test sufficiency of software testing.
[0005] In order to solve the above technical problems, the application is implemented as follows:
[0006] The embodiment of the application provides a test method for improving the test efficiency of a distributed system, which comprises the following steps:
[0007] S101: Obtain management operation parameters, business operation parameters and fault operation parameters;
[0008] S102: Combine the management operation parameters, the business operation parameters and the fault operation parameters to generate a test case set;
[0009] S103: Sort the data in the test case set according to a target formula, and generate an ordered test case set;
[0010] S104: Execute the ordered test case set to obtain a target result.
[0011] Optionally, the management operation is a management function of the distributed system, the management function comprises management operations on permissions, resources, services, monitoring and alarm items; the business operation is a business function of the distributed system, the business function comprises operations of uploading, downloading, updating and deleting objects; and the fault operation is a system fault of the distributed system, the system fault comprises power failure, restart, network disconnection, process crash, high load, high memory usage, network packet loss and high network delay.
[0012] Optionally, the management operation parameter is defined as an M parameter, the business operation parameter is defined as a B parameter, the fault operation parameter is defined as an F parameter, and any one of the parameters is defined as a test factor.
[0013] Optionally, the test factor has a priority parameter P, a time cost parameter T, and a resource consumption parameter R, and the values of the priority parameter P, the time cost parameter T, and the resource consumption parameter R are all [1, 5].
[0014] Optionally, the factors influencing the priority parameter P include at least one of the following: factors affecting resource or service operations in the management operation, business scenario factors in the business operation, and uncertainties or destructive factors affecting the system in the fault operation.
[0015] Optionally, the influencing factors of the time cost parameter T include: the time cost parameter for adding or deleting a virtual resource in the management operation is lower than the time cost parameter for adding or deleting a physical resource; the time cost parameter for the query operation is lower than the time cost parameter for the add or delete operation; the time cost parameter for causing network packet loss or high server load in the fault operation is low; and the time cost parameter for causing and recovering from process crashes or server power outages / restarts is high.
[0016] Optionally, the influencing factors of the resource consumption parameter R include: the resource consumption parameter is high for disk addition operations in the management operations, the resource consumption parameter is high for server addition operations, and the resource consumption parameter is high for simulated memory preemption operations in the fault operations.
[0017] Optionally, the test case set includes:
[0018] Management operation parameter list:
[0019] {(M1,P M1 ,T M1 ,R M1 ),(M2,P M2 ,T M2 R M2 ),…(M n ,P Mn ,T Mn R Mn )};
[0020] List of business operation parameters:
[0021] {(B1,P B1 ,T B1 ,R B1 ),(B2,P B2 ,T B2 ,RB2 ),…(B i ,P Bi ,T Bi ,R Bi )};
[0022] Fault operation parameter list:
[0023] {(F1,P F1 ,T F1 ,R F1 ),(F2,P F2 ,T F2 ,R F2 ),…(F j ,P Fj ,T Fj ,R Fj )}.
[0024] Optionally, the data in the test case set is sorted according to the target formula, and an ordered test case set is generated, specifically including:
[0025] The test case set is brought into the target formula, and the target formula is test value = priority parameter P / (time cost parameter T*resource consumption parameter R);
[0026] The test values of the data of each test case set are sorted, and an ordered test case set is generated.
[0027] Optionally, in the case of multiple point faults, the fault operation parameter list includes at least two same fault lists.
[0028] In the embodiment of the application, by the abstract mode of the distributed system test element, i.e., the mode of abstracting management, business and faults into different test classes, the mode of pairing combination test is adopted in the distributed system test process, and the value of the test case is estimated according to the priority, time cost and resource consumption. The scheme can solve the problem of the contradiction between the test efficiency and the test sufficiency of software test. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 is a flow diagram of a test method for improving the test efficiency of a distributed system provided by the embodiment of the application.
[0030] The implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0031] In order to make the objects, technical solutions and advantages of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0032] The terms "first", "second" and the like in the description and claims of the present application are used to distinguish similar objects, and are not used to describe a particular order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second" and the like are generally a class, and are not limited to the number of objects, for example, the first object can be one or more. It should be understood that in various embodiments of the present disclosure, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
[0033] It should be understood that in the present disclosure, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0034] It should be understood that in the present disclosure, "a plurality of" means two or more. "And / or" is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the front and rear associated objects are in an "or" relationship. "Including A, B and C", "including A, B, C" means that A, B and C are all included, "including A, B or C" means that one of A, B and C is included, and "including A, B and / or C" means that any one or any two or three of A, B and C is included.
[0035] It should be understood that in the present disclosure, "B corresponding to A", "B corresponding to A", "A corresponding to B" or "B corresponding to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, but also can be determined according to A and / or other information. The matching of A and B means that the similarity of A and B is greater than or equal to a preset threshold.
[0036] Depending on the context, "if" as used herein can be interpreted to mean "when" or "while" or "in response to determining" or "in response to detecting."
[0037] The embodiments of the present application will be described below in detail with reference to the accompanying drawings. Figure 1 The test method for improving the test efficiency of a distributed system provided by the embodiments of the present application is described in detail below by specific examples and application scenarios. The embodiments of the present application provide a test method for improving the test efficiency of a distributed system, comprising:
[0038] S101: Obtain management operation parameters, business operation parameters and fault operation parameters.
[0039] Specifically, the test elements of the distributed system are abstracted into three categories, namely management operation parameters, business operation parameters and fault operation parameters.
[0040] Optionally, the management operation is a management function of the distributed system, the management function includes management operations on permissions, resources, services, monitoring and alarm items; the business operation is a business function of the distributed system, the business function includes operations of uploading, downloading, updating and deleting objects; the fault operation is a system fault of the distributed system, the system fault includes power failure, restart, network disconnection, process crash, high load, high memory usage, network packet loss and high network delay.
[0041] Optionally, the management operation parameters are defined as M parameters, the business operation parameters are defined as B parameters, and the fault operation parameters are defined as F parameters. Any of the parameters is defined as a test factor. For example, in the management operation parameters, a simple operation of configuring an alarm item is taken as a test factor, and a simple operation of creating a certain resource is taken as a test factor. In the business operation parameters, one-time write operation or one-time read operation is taken as a test factor. Similarly, each fault operation in the fault operation parameters is also called a test factor.
[0042] S102: Combine the management operation parameters, the business operation parameters and the fault operation parameters to generate a test case set.
[0043] Optionally, the test factor has a priority parameter P, a time cost parameter T and a resource consumption parameter R, and the priority parameter P, the time cost parameter T and the resource consumption parameter R all have values in the range of [1, 5]. That is, for each test factor of each test category, a priority P, a time cost T and a resource consumption R are defined, wherein P, T and R are all defined as positive integers with values in the range of [1-5].
[0044] Optionally, the influencing factors of the priority parameter P include at least one of the influencing factors of the resource or service operation in the management operation, the business scenario factor in the business operation, and the uncertainty or destructiveness factor of the system in the fault operation. For example, the priority P of the management operation is set high because the operations on the resource and the operations on the service are generally considered to have greater influence. The priority P of the business operation is defined according to the specific business scenario. The priority P of the fault operation is set high because the process crash and the server sudden power-off are generally considered to have greater uncertainty or destructiveness to the system, and the priority of other faults is configured as appropriate.
[0045] Optionally, the influencing factors of the time cost parameter T include that the time cost parameter of adding or deleting a virtual resource in the management operation is lower than that of adding or deleting a physical resource, the time cost parameter of the query operation is lower than that of the add or delete operation, the time cost parameter of the fault operation of manufacturing network packet loss or high server load is low, and the time cost parameter of the fault of manufacturing and recovering process crash or server power-off or restart is high. The time cost T represents the minimum time cost of executing the test factor. For example, the time cost of adding or deleting a virtual resource in the management operation is generally lower than that of adding or deleting a physical resource, and the time cost of the query operation should be lower than that of the add or delete operation. For another example, the time cost of the fault operation of manufacturing network packet loss or high server load is low, and the time cost of the fault of manufacturing and recovering process crash or server power-off or restart is generally high.
[0046] Optionally, the influencing factors of the resource consumption parameter R include that the resource consumption parameter of the increase operation on the disk in the management operation is high, the resource consumption parameter of the increase operation on the server is high, and the resource consumption parameter of the operation of simulating the occupation of the memory in the fault operation is high. The resource consumption R represents the test resource consumed by the operation, such as the disk, the server, the memory, the network, and other physical resources. Generally, the test resource is limited, and if a certain test scenario occupies a large amount of resource, it will affect or limit the parallel test of other scenarios. For example, the increase operation on the disk in the management operation, the increase operation on the server, and the operation of simulating the occupation of the memory in the fault operation all consume test resources, and the resource consumption R of such test factors can be set high.
[0047] Optionally, the test classes of a distributed system are abstracted into three categories, each of which is composed of test factors with priority, time cost, and resource consumption values, to obtain the following three lists, and the test case set includes:
[0048] The management operation parameter list:
[0049] {(M1, P M1 , T M1 , R M1 ),(M2, P M2 , T M2, , R M2 ),…(M n , P Mn , T Mn, , R Mn )};
[0050] Business operation parameter list:
[0051] {(B1, P B1 , T B1 , R B1 ),(B2, P B2 , T B2 , R B2 ),…(B i , P Bi , T Bi , R Bi )};
[0052] Fault operation parameter list:
[0053] {(F1, P F1 , T F1 , R F1 ),(F2, P F2 , T F2 , R F2 ),…(F j , P Fj , T Fj , R Fj )}.
[0054] In real business scenarios, business operations are usually continuous and uninterrupted, and management operations occur at any time with user management needs, and the occurrence of faults is very uncertain. In order to approach the actual situation and do sufficient testing, the combination of various test factors of the three test classes should be considered. However, there is a certain contradiction between comprehensive coverage of all combinations and test efficiency, and this contradiction is particularly prominent in distributed systems. The present application uses precision test to exchange complex test, generates the most simplified test cases, and reasonably evaluates the test cases. Instead of consuming a large amount of resources, long time and disordered random testing of distributed systems through a large number of test cases.
[0055] In the embodiments of the present application, the test cases are generated by using the pair combination. The pair combination requires that all level combinations of any two test factors are covered at least once, and is a high efficient test case design method. The pair combination test technique is usually applied in the program method test with multiple input parameters to achieve the purpose of parameter coverage. The present application firstly applies it in the distributed system test, and regards the management operation, the business operation and the fault operation of the distributed system as three input types of the distributed system, which are not affected and irrelevant to each other, and generates the test cases by using the pair test principle. For example, the list in the fourth paragraph is defined as:
[0056] {(M1, P M1 , T M1 , R M1 ), (M2, P M2 , T M2 , R M2 ), (M3, P M3 , T M2 , R M3 )},
[0057] {(B1, P B1 , T B1 , R B1 ), (B2, P B2 , T B2 , R B2 ), (B3, P B3 , T B3 , R B3 )},
[0058] {(F1, P F1 , T F1 , R F1 ), (F2, P F2 , T F2 , R F2 ), (F3, P F3 , T F3 , R F3 ).
[0059] The test cases generated by the pair test algorithm can be:
[0060] Management operation (M) Business operation (B) Fault operation (F) [M2] [B3] F1 M3 <B1> F3 M1 [B2] F1 M3 [B3] F2 M1 <B1> F2 [M2] B2 F3 M3 <B1> F1 M1 [B3] F3 [M2] <B1> F2 M3 [B2] F2
[0061] Table 1
[0062] From the test case set, it can be seen that the number of test cases generated is 10 when the number of test factors of each test class is 3, and 27 test cases are needed if the pairing test principle is not used. When the number of test classes and the number of test factors in the test class increases, the advantage of using the pairing test is more obvious. Factors affecting test efficiency include the size of the test set, the execution time of the test, the resource occupation of the test, and the grading of the test. The application first effectively controls the test case set through the design of the pairing test, and then defines the time cost T, the priority P, and the resource consumption R for each test factor.
[0063] S103: Sort the data in the test case set according to the target formula, and generate an ordered test case set.
[0064] Optionally, the sorting of the data in the test case set according to the target formula and the generation of the ordered test case set specifically include:
[0065] The test case set is brought into the target formula, and the target formula is test value = priority parameter P / (time cost parameter T*resource consumption parameter R);
[0066] The test values of the data of each test case set are sorted, and an ordered test case set is generated.
[0067] In an embodiment of the application, the value of the test scene should be determined by the priority P / (time cost T*resource consumption R). The higher the priority and the smaller the time cost and resource consumption, the greater the test value of the test scene. For example, the test scene M2 B3 F1 selected by the pairing test in the above table has a test value = (P M2 / T M2 *R M2 )*(P B3 / T B3 *R B3 )*(P F1 / T F1 *R F1 ), and the test set obtained by the pairing test is sorted according to the test value. The test case with a greater value is tested more preferentially or more importantly.
[0068] Optionally, in the case of multiple point faults, the fault operation parameter list includes at least two identical fault lists.
[0069] Specifically, the application adopts two steps of pair test and test value estimation, which can obviously improve the test efficiency in the test of distributed system. Moreover, the method can be flexibly extended to support more test scenarios. Distributed system can generally tolerate single point failure in design, but in reality, the occurrence of failure is not only single point failure, but also the possibility of simultaneous occurrence of multiple point failure. Although multiple point failure does not guarantee system availability, multiple point failure test must also be an indispensable part of distributed software testing. At this time, the focus is on the results of the distributed system after being unavailable or collapsed and the self-healing of the system after failure recovery. If the use case design of multiple point failure adopts the traditional test method, the problems of disorder, confusion and a large number of repeated tests are more prominent. The above pair test method and value evaluation method can be used to make the test as simple and orderly as possible. For example, the scenario of two-point failure can be abstracted as the following four test factor list, and then pair calculation and value evaluation are carried out:
[0070] {(M1,P M1 ,T M1 ,R M1 ),(M2,P M2 ,T M2 ,R M2 ),…(M n ,P Mn ,T Mn ,R Mn )},
[0071] {(B1,P B1 ,T B1 ,R B1 ),(B2,P B2 ,T B2 ,R B2 ),…(B i ,P Bi ,T Bi ,R Bi )},
[0072] {(F1,P F1 ,T F1 ,R F1 ),(F2,P F2 ,T F2 ,R F2 ),…(F j ,P Fj ,T Fj ,R Fj )},
[0073] {(F1,P F1 ,T F1 ,R F1 ),(F2,P F2 ,T F2R F2 ),…(F j ,P Fj ,T Fj ,R Fj )}。
[0074] Wherein there are two unassociated but can be exactly the same fault list, two-point fault, after the pair combination, any two-point fault can be covered in the test. At this time the value estimation method is test value=P M2 / (T M2 *R M2 )*P B3 / (T B3 *R B3 )*P F1 / (T F1 *R F1 )*P F2 / (T F2 *R F2 ).
[0075] The application fully considers many factors affecting the test value, in the real test, the method can be flexibly applied according to the actual situation, and the unimportant factors can be ignored. For example, in a certain test, the resources are sufficient, and the resource influence R can be completely ignored in the test case design, and other methods remain unchanged. The test time is sufficient, and the time cost T can be completely ignored in the test case design, and other methods remain unchanged. For example, the test value after ignoring the resource influence is (P M2 / R M2 )*(P B3 / T B3 )*(P F1 / T F1 )
[0076] S104: execute the ordered test case set to obtain a target result.
[0077] In the embodiment of the application, by the abstract mode of the distributed system test element, that is, the management, business and fault are abstracted into different test classes, the pair combination test mode is adopted in the distributed system test process, and the test case is valued according to the priority, time cost and resource consumption.
[0078] The application has the following advantages:
[0079] 1. The application makes the complex distributed system test method, and for the first time, the test input of the distributed system is abstracted, the algorithm of the pair combination is used to greatly reduce the originally unordered and multiple test set, improve the test effectiveness, ensure the test coverage and save the test cost.
[0080] 2、The higher the value of the test case is, the higher the ranking is, the more attention is paid or the earlier the test case is executed, so that the serious defects of the system can be found as early as possible.
[0081] 3、The application is flexible and controllable, and is suitable for various scenes of distributed system testing, such as a multi-point fault scene.
[0082] Embodiment two
[0083] The embodiment of the application provides a storage system of a test method for improving the test efficiency of a distributed system, and a management tool of a distributed block storage system comprises the following command line functions: install (installation), target (Target management), lun (volume management), server (server management), monitor (monitoring), config (configuration), uninstall (uninstallation) and the like. According to the technical scheme of the application, the management functions are defined as: {(install, 5, 4, 5), (target, 4, 3, 2), (lun, 5, 3, 3), (server, 4, 5, 5), (monitor, 2, 5, 4), (config, 1, 1, 1), (uninstall, 3, 5, 5)}. The read-write-delete business functions are defined as {(write, 5, 5, 5), (read, 5, 5, 5), (delete, 3, 5, 5)}. The common fault operation processes procexit (process exit), poweroff (power off), ifdown (network disconnection), highload (high business load) and highmemutil (high memory utilization) are defined as {(procexit, 5, 2, 1), (poweroff, 5, 3, 3), (ifdown, 4, 3, 2), (highload, 3, 4, 4), (highmemutil, 4, 4, 4)}.
[0084] (highmemutil, 4, 4, 4)}.
[0085] The final result of the test value of each test case after sorting according to the test value of each test case in the test case set generated by the pair combination is as follows:
[0086]
[0087]
[0088] Table 2
[0089] If not using the present application to cover the test, 7*3*5=105 test cases are needed, which is high repetition and low efficiency. In the complex distributed system test process, using the present application, only 35 test cases are needed, and the test efficiency can be greatly improved according to the test value.
[0090] In the embodiment of the present application, the test elements of the distributed system are abstracted, that is, the management, business and fault are abstracted into different test classes, the pairing combination test is used in the distributed system test process, and the value estimation of the test cases is carried out according to the priority, time cost and resource consumption.
[0091] The advantages of the present application are:
[0092] 1. The present application makes the complex distributed system test method, and for the first time, the test input of the distributed system is abstracted, the pairing combination algorithm is used to greatly reduce the originally unordered and multiple test set, improve the test effectiveness, and save the test cost.
[0093] 2. The present application makes the test case with higher value rank in front, and is paid more attention to or is executed earlier, so as to discover the serious defects of the system as early as possible. Because the test period of the large distributed system caused by service concurrent execution and uncertain factors is long, sometimes multiple tests are needed, if the serious defects can be discovered as early as possible, the software development period and the iteration period of the product are beneficial, and the test efficiency is improved.
[0094] 3. The present application is flexible and controllable. It is suitable for various scenes of distributed system test, such as multiple fault scenes. The value evaluation factors can be selected according to actual conditions.
[0095] The flowcharts and block diagrams in the drawings show the possible implementation architecture, function and operation of the system, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of instructions, which contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the blocks can also occur in different order from that marked in the drawings. For example, two continuous blocks can actually be executed in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be realized by a special hardware-based system which executes the specified function or action, or can be realized by a combination of special hardware and computer instructions.
[0096] It is noted that all features disclosed in this specification, including any accompanying claims, abstract, and drawings, can be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Thus, unless expressly stated otherwise, each feature disclosed in this specification is one example only of a generic series of equivalent or similar features. Further, any part of the described embodiments can be further developed or modified without departing from the scope of the present disclosure. Any further developments or modifications, which are within the scope of the present disclosure, are to be considered as part of the present disclosure.
[0097] It is to be understood that the embodiments of the application described above and illustrated in the drawings are merely by way of example and are not limiting of the application. The objectives of the application have been fully achieved and any modifications or alterations to the embodiments of the application which are within the scope of the application are to be considered as part of the application. The principles and operation of the application have been explained above with reference to the accompanying drawings. While the application has been described in connection with what is presently considered to be the most practical and preferred embodiments, it is to be understood that the application is not to be limited to the disclosed embodiments, but on the contrary, is intended to cover various modifications and equivalent arrangements.
[0098] Finally, it should be noted that the above-described embodiments are merely intended for describing and illustrating, not limiting, the technical solutions of the present disclosure; even though the present disclosure has been described in detail with reference to the above-described embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the above-described embodiments, or make equivalent replacements to part or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A test method for improving test efficiency of a distributed system, characterized by, The method comprises the following steps: S101: obtaining management operation parameters, business operation parameters and fault operation parameters; S102: combining the management operation parameters, the business operation parameters and the fault operation parameters to generate a test case set; S103: sorting the data in the test case set according to a target formula and generating an ordered test case set; S104: executing the ordered test case set to obtain a target result; wherein the management operation is a management function of a distributed system, the management function includes management operations on permissions, resources, services, monitoring and alarm items; the business operation is a business function of the distributed system, the business function includes operations of uploading, downloading, updating and deleting objects; the fault operation is a system fault of the distributed system, the system fault includes power failure, restart, network disconnection, process crash, high load, high memory usage, network packet loss and high network delay; wherein the management operation parameters are defined as M parameters, the business operation parameters are defined as B parameters, and the fault operation parameters are defined as F parameters, and any of the parameters is defined as a test factor; wherein each of the test factor has a priority parameter P, a time cost parameter T and a resource consumption parameter R, and the priority parameter P, the time cost parameter T and the resource consumption parameter R all have values in the range of [1, 5]; wherein the sorting of the data in the test case set according to the target formula and the generation of the ordered test case set specifically include: bringing the test case set into the target formula, the target formula being test value = priority parameter P / (time cost parameter T*resource consumption parameter R); sorting the test values of the data of each test case set and generating an ordered test case set.
2. The test method for improving test efficiency of a distributed system according to claim 1, wherein, The priority parameter P is affected by at least one of the following factors: a resource or service operation influencing factor in the management operation, a business scenario factor in the business operation, and an uncertainty or destructive factor of the system in the fault operation.
3. The test method for improving test efficiency of a distributed system according to claim 1, wherein, The time cost parameter T is affected by the following factors: the time cost parameter of adding or deleting a virtual resource is lower than that of adding or deleting a physical resource in the management operation, the time cost parameter of a query operation is lower than that of an add or delete operation, and the time cost parameter of manufacturing network packet loss or high server load is low, and the time cost parameter of manufacturing and recovering process crash or server power failure and restart is high.
4. The test method for improving test efficiency of a distributed system according to claim 1, wherein, The resource consumption parameter R is affected by the following factors: the resource consumption parameter of an increase operation on a disk is high, the resource consumption parameter of an increase operation on a server is high, and the resource consumption parameter of an operation simulating the occupation of memory is high.
5. The test method for improving test efficiency of a distributed system according to claim 1, wherein, The test case set includes: a management operation parameter list; {(M1, P M1 ,T M1 ,R M1 ),(M2, P M2 ,T M2, R M2 ),…(M n ,P Mn ,T Mn, R Mn )}; a business operation parameter list; { (B1, P B1 , T B1 , R B1 ), (B2, P B2 , T B2 , R B2 ),... (B i , P Bi , T Bi , R Bi )} ; a fault operation parameter list; { (F1, P F1 , T F1 , R F1 ), (F2, P F2 , T F2 , R F2 ),... (F j , P Fj , T Fj , R Fj )}.
6. The test method for improving test efficiency of a distributed system according to claim 5, wherein, In the case of multiple point faults, the fault operation parameter list includes at least two identical fault operation parameter lists.