Testing Method, Device, Computer Storage Medium and Computing Device for Cloud Control Rules
By automatically generating test data of cloud control rules and comparing expected values with actual values, automated testing of cloud control rules is realized, solving the problems of inefficient testing and relying on devices in the existing technology, and improving testing efficiency and coverage.
Patent Information
- Application Number
- CN201910238297.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-27
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2039-03-27
AI Technical Summary
The testing of cloud control rules in the prior art is inefficient, and it relies on manual configuration of multiple cloud control rules and multiple terminal devices, resulting in the inability to fully cover the test, inefficient and device-dependent problems.
By obtaining the rule model files and data protocols of the cloud control system, the test data of the cloud control rules is automatically generated, and the expected value of the test data issued by the server interface is generated by analyzing the data protocol. Then, the actual value of the test data sent by the server interface under the cloud control rule is obtained, the expected value and the actual value are compared, and the comparison results are output to judge the validity of the cloud control rule.
This method can save manpower and equipment required for testing, improve testing efficiency and coverage, and solve the problems of inefficient testing and equipment dependence in the prior art.
Smart Images

Figure CN111752769B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud control, and in particular to a method for testing cloud control rules, a device for testing cloud control rules, a computer storage medium, and a computing device. Background Art
[0002] Cloud control, also known as a cloud control system, means controlling product parameters in the cloud. Cloud control can obtain data from the cloud through the network when the program is running. When the product is running, a default value generally needs to be set for the product parameters at the client side. When there is a network, cloud control will be obtained to modify the product parameters to control the interaction with the user, such as the frequency of pop-up windows, whether a page is displayed, permission guidance, etc. In this way, targeted experience optimization can be achieved by configuring certain cloud control rules.
[0003] The implementation effect of cloud control rules depends on the algorithm of the cloud control platform. Once the algorithm is improper and the cloud control rules cannot be accurately executed, it will directly affect the effect of the optimization test and correct conclusions cannot be drawn. Therefore, it is necessary to test the cloud control rules to verify whether they are accurately executed. In the prior art, mainly relying on testers to set cloud control rules in the cloud control system, and then using terminal devices that meet different rule conditions to verify. This method requires testers to configure multiple cloud control rules and multiple terminal devices to verify the effectiveness of the rules, with low test efficiency, and it is not certain to obtain all terminal devices that meet the requirements for testing.
[0004] Therefore, there is an urgent need for an automatic test method that can solve the problems of low test efficiency and device dependence of cloud control rules. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a method for testing cloud control rules, a device for testing cloud control rules, a computer storage medium, and a computing device that can overcome or at least partially solve the above problems.
[0006] According to one aspect of the embodiments of the present invention, a method for testing cloud control rules is provided, including:
[0007] Obtaining a rule model file and a data protocol of a cloud control system;
[0008] Automatically generating test data for cloud control rules according to the rule model file;
[0009] Parsing the data protocol to generate an expected value for the test data sent by the server interface;
[0010] Obtaining an actual value of the test data sent by the server interface under the cloud control rules;
[0011] Comparing the expected value and the actual value;
[0012] Output the comparison result.
[0013] Optionally, obtain the rule model file and data protocol of the cloud control system, including:
[0014] Read the rule model file and data protocol from the database or configuration file of the cloud control system.
[0015] Optionally, before obtaining the rule model file and data protocol of the cloud control system, the method further includes:
[0016] Generate the rule model file in response to the parameter configuration of the user in the cloud control system.
[0017] Optionally, the rule model file contains parameters and corresponding parameter types;
[0018] Automatically generate test data for cloud control rules according to the rule model file, including:
[0019] Parse the rule model file to obtain the parameters and corresponding parameter types included in the rule model file;
[0020] Automatically generate multiple groups of test data composed of the parameters and multiple values of the parameters according to the parameters and corresponding parameter types.
[0021] Optionally, the parameter types include numerical types;
[0022] For numerical parameters, the generated test data covers the valid value boundaries, normal values, and / or abnormal values of the parameters.
[0023] Optionally, the data protocol includes the interaction protocol between the cloud control system and the server;
[0024] Before automatically generating test data for cloud control rules according to the rule model file, the method further includes:
[0025] Compile the cloud control rules into rules recognizable by the server according to the data protocol;
[0026] The actual value of the test data sent by the server interface is that the server requests the test data according to the compiled cloud control rules and sends the actual value of the test data through the server interface.
[0027] Optionally, compare the expected value and the actual value, including:
[0028] Compare whether the deviation between the actual value and the expected value is within a predetermined error range;
[0029] If so, it is determined that the comparison results are consistent;
[0030] If not, it is determined that the comparison results are inconsistent.
[0031] Optionally, output the comparison results, including:
[0032] If the comparison results are inconsistent, output the parameters of the cloud control rule associated with the test data and the corresponding parameter values.
[0033] Optionally, the cloud control rule is applicable to the A / B test of the product.
[0034] According to another aspect of the embodiments of the present invention, a test device for a cloud control rule is further provided, including:
[0035] A cloud control rule acquisition module, adapted to acquire a rule model file and a data protocol of a cloud control system;
[0036] A test data generation module, adapted to automatically generate test data for the cloud control rule according to the rule model file;
[0037] An expected value generation module, adapted to parse the data protocol and generate an expected value for the test data sent by the server interface;
[0038] An actual value acquisition module, adapted to acquire the actual value of the test data sent by the server interface under the cloud control rule;
[0039] A comparison module, adapted to compare the expected value and the actual value; and
[0040] A result output module, adapted to output the comparison results.
[0041] Optionally, the cloud control rule acquisition module is further adapted to:
[0042] Read the rule model file and the data protocol from the database or configuration file of the cloud control system.
[0043] Optionally, the device further includes:
[0044] A cloud control rule generation module, adapted to generate the rule model file in response to parameter configuration by the user in the cloud control system before the cloud control rule acquisition module acquires the rule model file and the data protocol of the cloud control system.
[0045] Optionally, the rule model file contains parameters and corresponding parameter types;
[0046] The test data generation module is further adapted to:
[0047] Parse the rule model file to obtain the parameters and corresponding parameter types included in the rule model file;
[0048] Automatically generate multiple sets of test data composed of the parameters and multiple values of the parameters according to the parameters and the corresponding parameter types.
[0049] Optionally, the parameter types include numerical types;
[0050] For parameters of numerical types, the generated test data covers the valid value boundaries, normal values, and / or abnormal values of the parameters.
[0051] Optionally, the data protocol includes the interaction protocol between the cloud control system and the server;
[0052] The device further includes:
[0053] A rule compilation module, adapted to compile the cloud control rules into rules recognizable by the server according to the data protocol before the test data generation module automatically generates test data for the cloud control rules according to the rule model file;
[0054] The actual value obtained by the actual value acquisition module for the test data sent by the server interface is the actual value of the test data sent by the server through the server interface after requesting the test data according to the compiled cloud control rules.
[0055] Optionally, the comparison module is further adapted to:
[0056] Compare whether the deviation between the actual value and the expected value is within a predetermined error range;
[0057] If so, determine that the comparison results are consistent;
[0058] If not, determine that the comparison results are inconsistent.
[0059] Optionally, the result output module is further adapted to:
[0060] If the comparison results are inconsistent, output the parameters of the cloud control rules associated with the test data and the corresponding parameter values.
[0061] Optionally, the cloud control rules are applicable to the AB test of the product.
[0062] According to another aspect of the embodiments of the present invention, there is also provided a computer storage medium storing computer program code, which causes the computing device to execute the test method of the cloud control rules according to any one of the above when the computer program code runs on the computing device.
[0063] According to yet another aspect of the embodiments of the present invention, there is also provided a computing device, including:
[0064] a processor; and
[0065] a memory storing computer program code;
[0066] When the computer program code is run by the processor, it causes the computing device to execute the test method of the cloud control rule according to any one of the above.
[0067] For the test method and device of the cloud control rule proposed in the embodiments of the present invention, first, the rule model file and data protocol of the cloud control system are obtained, then the test data of the cloud control rule is automatically generated according to the rule model file, and the expected value of the test data sent by the server interface is generated by parsing the data protocol; furthermore, the actual value of the test data sent by the server interface under this cloud control rule is obtained; finally, the actual value sent by the server interface is compared with the expected value, and the effectiveness of the tested cloud control rule is judged according to the comparison result. By automatically generating the test data of the cloud control rule according to the obtained rule model file of the cloud control system and performing the test of the cloud control rule through interface simulation, it is possible to save the manpower and equipment required for testing, improve the test efficiency and coverage rate, and solve the problems in the prior art that testers need to manually configure multiple cloud control rules and multiple terminal devices to verify the effectiveness of the rules, resulting in incomplete coverage, low efficiency and device dependence of the cloud control rule test. The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are hereinafter specifically described.
[0068] According to the following detailed description of the specific embodiments of the present invention in conjunction with the drawings, those skilled in the art will understand the above and other purposes, advantages and features of the present invention more clearly. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0070] Figure 1 shows a flowchart of a test method for a cloud control rule according to an embodiment of the present invention;
[0071] Figure 2 shows a schematic structural diagram of a cloud control system according to an embodiment of the present invention;
[0072] Figure 3 shows a schematic structural diagram of a test device for a cloud control rule according to an embodiment of the present invention; and
[0073] Figure 4 The structural schematic diagram of a test device for cloud control rules according to another embodiment of the present invention is shown. Detailed implementation manners
[0074] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0075] Cloud control (also known as cloud control system, abbreviated as cloud control) means controlling product parameters in the cloud. It can change the presentation form of the client at any time through the control on the server side without affecting the client code. That is to say, various changes to the front end can be achieved without upgrading the front-end version. Therefore, cloud control is widely used in the functional testing of the client, such as AB testing (abtest), etc.
[0076] AB testing is to create two (A / B) or more (A / B / n) versions for the Web or App interface or process. In the same time dimension, let visitor groups (i.e., target populations) with the same or similar compositions randomly access these versions, collect the user experience data and business data of each group, and finally analyze and evaluate the best version and officially adopt it. To explain with a simplified example, AB testing is to create two different implementation schemes a and b for the same function of the product. After configuring the rules, make a part of the clients present scheme a and another part of the clients present scheme b. Then, upload the result data corresponding to schemes a and b to the server side, and the product manager finally determines whether to adopt scheme a or scheme b according to the uploaded data.
[0077] When performing such functional tests, it is necessary to configure cloud control rules to control the data distribution, etc. The effectiveness of the cloud control rules directly affects the effect of the functional test. However, in the prior art, there are problems in the verification test of the effectiveness of cloud control rules, such as incomplete coverage of cloud control rule tests, low efficiency, and dependence on devices.
[0078] To solve the above technical problems, an embodiment of the present invention proposes a test method for cloud control rules. Figure 1 The flowchart of the test method for cloud control rules according to an embodiment of the present invention is shown. Refer to Figure 1 , this method may at least include the following steps S102 to step S112.
[0079] Step S102, obtain the rule model file and data protocol of the cloud control system.
[0080] Step S104, automatically generate test data for the cloud control rule according to the rule model file.
[0081] Step S106, parse the data protocol to generate the expected value of the test data sent by the server interface.
[0082] Step S108, obtain the actual value of the test data sent by the server interface under the cloud control rule.
[0083] Step S110, compare the expected value and the actual value of the test data sent by the server interface.
[0084] Step S112, output the comparison result.
[0085] In this embodiment, the cloud control rule to be tested can be applied to the A / B test of the product.
[0086] The test method and device for the cloud control rule proposed in the embodiment of the present invention can automatically generate test data for the cloud control rule according to the obtained rule model file of the cloud control system, and perform the test of the cloud control rule through interface simulation, which can save the manpower and equipment required for the test, improve the test efficiency and coverage rate, and solve the problems in the prior art that testers need to manually configure multiple cloud control rules and multiple terminal devices to verify the effectiveness of the rules, resulting in incomplete coverage, low efficiency and device dependence in the cloud control rule test.
[0087] In the above step S102, according to the different structures of the cloud control system, the rule model file and the data protocol can be read from the database or the configuration file of the cloud control system. The database mentioned here can be, for example, a rule library.
[0088] The rule model file and the data protocol mentioned above are described below through an example. For example, for the mobile phone security guard app, two schemes are designed for the function optimization test. Under scheme A, there are three menu buttons on the operation interface of the mobile phone security guard, and under scheme B, there are four menu buttons on the operation interface of the mobile phone security guard. It is expected that when the app runs, 40% of the user clients will show scheme A and 60% of the user clients will show scheme B. Then the rule model file of this cloud control rule is: 40% of the user clients are scheme A with three buttons, and 60% of the user clients are scheme B with four buttons. The data protocol can be understood as the rule for the interaction between the cloud control system and the server, which is preset by the cloud control system. For this example, the data protocol can specifically include the representation field of the button, the options and parameters of the interface, the percentage representation mechanism of the A / B scheme, etc. For example, the percentage can be represented by square brackets, such as [0-40], [40-60], or directly in the form of a ratio, such as 4:6.
[0089] Further, before reading the rule model file and data protocol from the database or configuration file of the cloud control system, it may further include the step of generating a rule model file in response to parameter configuration by the user in the cloud control system.
[0090] Specifically, the user can generate a rule model file of the cloud control rules corresponding to the application scenario by selecting and configuring parameters and parameter types in the cloud control system according to the application scenario.
[0091] The following Figure 2 illustrates the generation of the rule model file with reference to the structural schematic diagram of the cloud control system shown below, still taking the above example.
[0092] Refer to Figure 2 As shown, the cloud control system (which can also be understood as the background operating system) may include one or more control types (i.e., application scenarios). For example, in this example, control type 2 is the New Year's activity scenario of the mobile phone security guard, and control type 1 is another discount promotion scenario of the mobile phone security guard. Under each application scenario, there is one or more control items, and each control item may include one or more parameters, and these parameters may have their corresponding parameter types. In this example, for the New Year's activity scenario of the mobile phone security guard, it includes one control item, that is, the menu button, and the parameters of the menu button may include quantity, delivery percentage, size, color, etc. For each application scenario, the user generates a rule model file of the cloud control rules corresponding to the application scenario by selecting control items and configuring the parameters of the control items. In this example, the user can generate a rule model file of the cloud control rules by configuring the quantity of the menu button to 3 and 4, and configuring the delivery percentages of the 3-button plan and the 4-button plan to 40% and 60% respectively. When conducting tests, only the cloud control rules of one application scenario are tested each time. Figure 2 The black dot in front of control type 2 in Figure 2 indicates that the cloud control rules of the New Year's activity scenario of the mobile phone security guard are currently generated and tested. In addition, it should be noted that
[0093] In step S104 above, the obtained rule model file contains the parameters of the cloud control rules and the corresponding parameter types. Correspondingly, step S104 can also be specifically implemented as: First, parse the obtained rule model file to obtain the parameters and the corresponding parameter types contained in the rule model file; then, according to the obtained parameters and the corresponding parameter types, automatically generate multiple groups of test data (which can also be called test cases) composed of the parameters and multiple values of the parameters. The parameter types mentioned here may include, for example, numerical types, string types, etc.
[0094] Taking the above example again, for the Spring Festival activity scenario of the mobile phone security guard, among the test data automatically generated according to the obtained rule model file, one set of data is the test data for three menu buttons, and the other set of data is the test data for four menu buttons.
[0095] Furthermore, parameters of numerical types are generally used to control quantities, frequencies, etc., and usually have a valid value range. Therefore, for parameters of numerical types, the generated test data should cover the valid value boundaries, normal values, and / or abnormal values of the parameters, so as to make the test results more effective and accurate.
[0096] In step S106 above, according to the data protocol of the cloud control rule, an expected value sent by the server interface is generated for each set of test data.
[0097] Taking the above example again, for the test data of three menu buttons, an expected value of the distribution percentage of 40% is generated, and for the test data of four menu buttons, an expected value of the distribution percentage of 60% is generated.
[0098] In step S108 above, the actual value of the test data sent by the server interface can be obtained by sending a fetch request to the server interface. For the above example, that is, the actual percentages of the test data of three menu buttons and four menu buttons sent by the server interface.
[0099] To enable the server to correctly execute data distribution according to the cloud control rule, the server code needs to be able to recognize the cloud control rule. In an optional embodiment, the data protocol may further include an interaction protocol between the cloud control system and the server. Correspondingly, before automatically generating the test data of the cloud control rule in step S104, a step of compiling the tested cloud control rule into a rule recognizable by the server according to the data protocol may also be performed. Furthermore, after the server obtains the compiled cloud control rule, it requests test data according to the compiled cloud control rule and distributes the test data through the server interface. At this time, the actual value obtained in step S108 is the actual value of the server requesting test data according to the compiled cloud control rule and distributing the test data through the server interface.
[0100] In step S110 above, the actual value sent by the server interface is compared with the expected value. If the comparison result is consistent, it is considered that the tested cloud control rule is valid, or rather, the validity of the cloud control rule meets the requirements. Otherwise, it is considered that the cloud control rule is invalid and needs to be adjusted, such as adjusting the algorithm.
[0101] In an optional embodiment, it can be compared whether the deviation between the actual value and the expected value is within a predetermined error range. If so, it is determined that the comparison result is consistent; if not, it is determined that the comparison result is inconsistent.
[0102] Taking the above example, assume that the actual value of the distribution percentage of the test data for the three menu buttons obtained is 39%, and the actual value of the distribution percentage of the test data for the four menu buttons is 61%. The predetermined error range is ±1%. Then, the deviation (-1%) between the actual value (39%) and the expected value (40%) of the distribution percentage of the test data for the three menu buttons falls within the predetermined error range (±1%), and the deviation (1%) between the actual value (61%) and the expected value (60%) of the distribution percentage of the test data for the four menu buttons falls within the predetermined error range (±1%). It is determined that the comparison results are consistent.
[0103] Further, when the above comparison results are inconsistent, step S112 can be further implemented as:
[0104] Output the parameters of the cloud control rule associated with the test data and the corresponding parameter values. In this way, it is more convenient for testers to perform subsequent analysis and adjustment.
[0105] Optionally, if the above comparison results are consistent and it is determined that the cloud control rule is effective, subsequent functional optimization testing can also be performed based on the distributed test data. Specifically, for the above example, the scenarios of the three menu buttons and the four menu buttons distributed can be executed simultaneously for a specified time, the retention data of the two scenarios can be counted and uploaded to the server, and finally, the advantages and disadvantages of the two scenarios can be measured according to their retention data.
[0106] The above has introduced Figure 1 Multiple implementation methods of each link of the illustrated embodiment. It should be noted that in practical applications, all the above optional implementation methods can be combined arbitrarily in a combined manner to form optional embodiments of the present invention, which will not be elaborated here one by one.
[0107] Based on the same inventive concept, an embodiment of the present invention also provides a test device for a cloud control rule, which is used to support the test method of the cloud control rule provided by any one of the above embodiments or their combinations. Figure 3 The structural schematic diagram of a test device 300 for a cloud control rule according to an embodiment of the present invention is shown. Refer to Figure 3 . The device 300 can at least include: a cloud control rule acquisition module 310, a test data generation module 320, an expected value generation module 330, an actual value acquisition module 340, a comparison module 350, and a result output module 360.
[0108] Now, the functions of the components or devices of the test device 300 for the cloud control rule in the embodiment of the present invention and the connection relationships between the parts are introduced:
[0109] The cloud control rule acquisition module 310 is adapted to acquire the rule model file and data protocol of the cloud control system.
[0110] The test data generation module 320, connected to the cloud control rule acquisition module 310, is adapted to automatically generate test data for cloud control rules according to the rule model file.
[0111] The expected value generation module 330, connected to the cloud control rule acquisition module 310, is adapted to parse the data protocol and generate the expected values of the test data sent by the server-side interface.
[0112] The actual value acquisition module 340 is adapted to acquire the actual values of the test data sent by the server-side interface under the cloud control rules.
[0113] The comparison module 350 is respectively connected to the expected value generation module 330 and the actual value acquisition module 340, and is adapted to compare the expected values and the actual values of the test data sent by the server-side interface.
[0114] The result output module 360, connected to the comparison module 350, is adapted to output the comparison result.
[0115] In an alternative embodiment of the present invention, the cloud control rule acquisition module 310 is further adapted to:
[0116] Read the rule model file and the data protocol from the database or the configuration file of the cloud control system.
[0117] In an alternative embodiment of the present invention, as Figure 4 shown, the apparatus 300 may further include a cloud control rule generation module 370. The cloud control rule generation module 370 may be connected to the cloud control rule acquisition module 310 and is adapted to generate a rule model file in response to parameter configuration by the user in the cloud control system before the cloud control rule acquisition module 310 acquires the rule model file and the data protocol of the cloud control system.
[0118] In an alternative embodiment of the present invention, the rule model file contains parameters and corresponding parameter types. Correspondingly, the test data generation module 320 is further adapted to:
[0119] Parse the rule model file to obtain the parameters and the corresponding parameter types included in the rule model file;
[0120] According to the obtained parameters and the corresponding parameter types, automatically generate multiple sets of test data composed of the parameters and multiple values of the parameters.
[0121] Further, the parameter type includes a numerical type. At this time, for the parameters of the numerical type, the generated test data needs to cover the valid value boundaries, normal values, and / or abnormal values of the parameters.
[0122] In an alternative embodiment of the present invention, the data protocol includes the interaction protocol between the cloud control system and the server-side. Correspondingly, still referring toFigure 4 As shown in Figure 4 , the device 300 may further include a rule compilation module 380. The rule compilation module 380 may be respectively connected to the cloud control rule acquisition module 310 and the test data generation module 320, and is adapted to compile the cloud control rules into rules recognizable by the server according to the data protocol before the test data generation module 320 automatically generates the test data of the cloud control rules according to the rule model file. At this time, the actual value of the test data sent by the server interface obtained by the actual value acquisition module 340 is the actual value of the test data sent by the server through the server interface after requesting the test data according to the compiled cloud control rules.
[0123] In an alternative embodiment of the present invention, the comparison module 350 is further adapted to:
[0124] Compare whether the deviation between the actual value of the test data sent by the server interface and the expected value is within a predetermined error range;
[0125] If so, it is determined that the comparison results are consistent;
[0126] If not, it is determined that the comparison results are inconsistent.
[0127] In an alternative embodiment of the present invention, the result output module 360 is further adapted to:
[0128] If the comparison results are inconsistent, output the parameters of the cloud control rules associated with the test data and the corresponding parameter values.
[0129] In an alternative embodiment of the present invention, the tested cloud control rules may be applicable to the A / B test of the product.
[0130] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium. The computer storage medium stores computer program code, and when the computer program code runs on a computing device, it causes the computing device to execute the test method of the cloud control rules according to any one of the above embodiments or a combination thereof.
[0131] Based on the same inventive concept, an embodiment of the present invention further provides a computing device. The computing device may include:
[0132] A processor; and
[0133] A memory storing computer program code;
[0134] When the computer program code is run by the processor, it causes the computing device to execute the test method of the cloud control rules according to any one of the above embodiments or a combination thereof.
[0135] According to any one of the above alternative embodiments or a combination of multiple alternative embodiments, the embodiments of the present invention can achieve the following beneficial effects:
[0136] The test method and device for cloud control rules proposed in the embodiments of the present invention first obtain the rule model file and data protocol of the cloud control system, then automatically generate test data for the cloud control rules according to the rule model file, and generate the expected values of the test data sent by the server interface by parsing the data protocol; furthermore, obtain the actual values of the test data sent by the server interface under the cloud control rules; finally, compare the actual values sent by the server interface with the expected values, and judge the effectiveness of the tested cloud control rules according to the comparison results. By automatically generating test data for cloud control rules according to the obtained rule model file of the cloud control system and performing the test of cloud control rules through interface simulation, it is possible to save the manpower and equipment required for testing, improve the test efficiency and coverage rate, and solve the problems in the prior art that testers need to manually configure multiple cloud control rules and multiple terminal devices to verify the effectiveness of the rules, resulting in incomplete coverage, low efficiency and device dependence of cloud control rule testing.
[0137] Those skilled in the art can clearly understand that the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments. For the sake of brevity, they will not be described in detail herein.
[0138] In addition, in each embodiment of the present invention, the functional units can be physically independent of each other, or two or more functional units can be integrated together, or all functional units can be integrated in a processing unit. The above-mentioned integrated functional units can be implemented in the form of hardware, or in the form of software or firmware.
[0139] Those of ordinary skill in the art can understand that if the above-mentioned integrated functional units are implemented in the form of software and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes several instructions for causing a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
Claims
1. A method for testing cloud control rules, comprising: Obtaining a rule model file and a data protocol of a cloud control system; Automatically generating test data for cloud control rules according to the rule model file; Parsing the data protocol to generate an expected value for the server interface to send the test data; Obtaining an actual value of the server interface sending the test data under the cloud control rules; Comparing the expected value and the actual value; Outputting the comparison result; Before obtaining the rule model file and the data protocol of the cloud control system, it further includes: Responding to parameter configuration by a user in the cloud control system to generate the rule model file; The rule model file contains parameters and corresponding parameter types; The automatically generating test data for cloud control rules according to the rule model file includes: Automatically generating multiple groups of test data composed of the parameters and multiple values of the parameters according to the parameters and corresponding parameter types.
2. The method according to claim 1, wherein, Obtaining the rule model file and the data protocol of the cloud control system includes: Reading the rule model file and the data protocol from the database or configuration file of the cloud control system.
3. The method according to claim 1, wherein, Before automatically generating multiple groups of test data composed of the parameters and multiple values of the parameters according to the parameters and corresponding parameter types, it further includes: Parsing the rule model file to obtain the parameters and corresponding parameter types included in the rule model file.
4. The method according to claim 1, wherein The parameter types include numerical types; For parameters of numerical types, the generated test data covers the valid value boundaries, normal values, and / or abnormal values of the parameters.
5. The method according to claim 1, wherein, The data protocol contains the interaction protocol between the cloud control system and the server; Before automatically generating test data for cloud control rules according to the rule model file, it further includes: Compiling the cloud control rules into rules recognizable by the server according to the data protocol; The actual value of the server interface sending the test data is that the server requests the test data according to the compiled cloud control rules and sends the actual value of the test data through the server interface.
6. The method according to claim 1, wherein, Comparing the expected value and the actual value includes: Comparing whether the deviation between the actual value and the expected value is within a predetermined error range; If so, determining that the comparison result is consistent; If not, determining that the comparison result is inconsistent.
7. The method according to claim 6, wherein, Outputting the comparison result includes: If the comparison result is inconsistent, outputting the parameters of the cloud control rules associated with the test data and the corresponding parameter values.
8. The method according to any one of claims 1-7, wherein The cloud control rules are applicable to the AB test of products.
9. A testing device for cloud control rules, comprising: A cloud control rule acquisition module adapted to obtain a rule model file and a data protocol of a cloud control system; A test data generation module adapted to automatically generate test data for cloud control rules according to the rule model file; An expected value generation module adapted to parse the data protocol to generate an expected value for the server interface to send the test data; An actual value acquisition module adapted to obtain an actual value of the server interface sending the test data under the cloud control rules; A comparison module adapted to compare the expected value and the actual value; And A result output module adapted to output the comparison result; A cloud control rule generation module, adapted to generate the rule model file in response to parameter configuration by a user in the cloud control system; The rule model file contains parameters and corresponding parameter types; the test data generation module is further adapted to automatically generate multiple sets of test data composed of the parameters and multiple values of the parameters according to the parameters and corresponding parameter types.
10. The device according to claim 9, wherein, The cloud control rule acquisition module is further adapted to: Read the rule model file and data protocol from a database or configuration file of the cloud control system.
11. The apparatus according to claim 9, wherein, The test data generation module is further adapted to: Parse the rule model file to obtain the parameters and corresponding parameter types included in the rule model file.
12. The apparatus according to claim 9, wherein The parameter types include numerical types; For parameters of numerical types, the generated test data covers valid value boundaries, normal values, and / or abnormal values of the parameters.
13. The device according to claim 9, wherein The data protocol contains an interaction protocol between the cloud control system and the server; The device further includes: A rule compilation module, adapted to compile the cloud control rule into a rule recognizable by the server according to the data protocol before the test data generation module automatically generates test data of the cloud control rule according to the rule model file; The actual value obtained by the actual value acquisition module for the test data sent by the server interface is the actual value of the test data sent by the server through the server interface after requesting the test data according to the compiled cloud control rule.
14. The device according to claim 9, wherein, The comparison module is further adapted to: Compare whether the deviation between the actual value and the expected value is within a predetermined error range; If so, determine that the comparison result is consistent; If not, determine that the comparison result is inconsistent.
15. The apparatus according to claim 14, wherein, The result output module is further adapted to: If the comparison result is inconsistent, output the parameters and corresponding parameter values of the cloud control rule associated with the test data.
16. The device according to any one of claims 9-15, wherein The cloud control rule is applicable to the A / B test of a product.
17. A computer storage medium storing computer program code, which when run on a computing device causes the computing device to execute the test method of the cloud control rule according to any one of claims 1-8.
18. A computing device, including: A processor; And A memory storing computer program code; When the computer program code is run by the processor, it causes the computing device to execute the test method of the cloud control rule according to any one of claims 1-8.
Citation Information
Patent Citations
Working method for controlling a vehicle management and check test system on cloud
CN106330925A
Rule matching method, cloud server, and rule matching system
CN109033206A