Automated testing method and device

By obtaining and using test parameters to automatically determine the target test object of the test object set for testing, the problems of test parameter lag and low manual selection efficiency in the existing technology are solved, and real-time maintenance of test data and efficient automated testing are realized.

CN113760708BActive Publication Date: 2024-10-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011028887.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-25
Publication Date
2024-10-18
Estimated Expiration
2040-09-25

AI Technical Summary

Technical Problem

When business types and content are constantly updated, it is difficult for existing technology to update test parameters in real time, resulting in inaccurate test results, and manual selection of objects to be tested is inefficient, making test data maintenance difficult and inefficient.

Method used

By obtaining the test parameters for the object under test, and automatically determining the target object under test in the object under test set for testing, using the test parameters to generate data calling instructions, sending them to the target object under test, and comparing its response data with the standard response data. Determine test results and implement automated testing.

Benefits of technology

It effectively reduces the difficulty of test data maintenance, improves test efficiency, ensures the timeliness and accuracy of test parameters, automatically determines the test results of the test object set, and improves the efficiency of automated testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760708B_ABST
    Figure CN113760708B_ABST
Patent Text Reader

Abstract

The present disclosure provides an automated testing method, which is applied to a testing platform. The method includes: obtaining test parameters for testing an object to be tested; determining N target objects to be tested among M objects to be tested in a set of objects to be tested, wherein M and N are positive integers and N<M; using the test parameters, testing the N target objects to be tested to obtain test results for each of the target objects to be tested; and determining the test results of the set of objects to be tested based on the test results for each of the target objects to be tested. The present disclosure also provides an automated testing device, an electronic device, and a computer-readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and more specifically, to an automated testing method, an automated testing device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of Internet technology, various types of business are increasing, and the frequency of business content updates is also accelerating. Testing the computer hardware and software applications in the business operation system is a key factor in ensuring the safe and stable operation of the business.

[0003] In the process of implementing the disclosed concept of the present invention, the inventors found that when testing the object to be tested, since the business types and business contents are constantly updated, the test parameters used for testing need to be continuously updated to avoid the problem of inaccurate test results caused by the lag of test parameters, and when a large number of objects to be tested need to be tested, some of the objects to be tested need to be manually selected for testing. The above results in the problems of difficulty in maintaining test data and low testing efficiency. Summary of the invention

[0004] In view of this, the present disclosure provides an automated testing method and device with low test data maintenance difficulty and high test efficiency.

[0005] One aspect of the present disclosure provides an automated testing method, which is applied to a testing platform, and includes: obtaining test parameters for testing an object to be tested; determining N target objects to be tested among M objects to be tested in a set of objects to be tested, wherein M and N are positive integers and N<M; using the above test parameters, testing the N target objects to be tested to obtain test results for each of the above target objects to be tested; and determining the test results of the above set of objects to be tested based on the test results for each of the above target objects to be tested.

[0006] Optionally, the above-mentioned acquisition of test parameters for testing the object to be tested includes sending a parameter acquisition request to the business operation system; receiving the test parameters returned by the above-mentioned business operation system based on the above-mentioned parameter acquisition request, wherein the above-mentioned test parameters include at least one of business configuration parameters, interface parameters and test methods.

[0007] Optionally, N target objects to be tested are determined from the M objects to be tested in the object set, including: sending an election trigger instruction to each of the M objects to be tested, so that at least some of the M objects to be tested carry out election for the main object to be tested; when the number of objects to be tested participating in the election reaches N, the N objects to be tested participating in the election are used as the target objects to be tested, wherein N>M / 2.

[0008] Optionally, the above-mentioned test parameters are used to test the N above-mentioned target objects to obtain test results for each of the above-mentioned target objects to be tested, including generating a data call instruction according to the above-mentioned test parameters; sending the above-mentioned data call instruction to the N above-mentioned target objects to be tested to obtain response data returned by each of the above-mentioned target objects to be tested; and comparing the response data returned by each of the above-mentioned target objects to be tested with the standard response data to obtain test results for each of the above-mentioned target objects to be tested.

[0009] Optionally, the method for obtaining the above-mentioned standard response data includes sending the above-mentioned data call instruction to a preset reference object to be tested; and receiving the above-mentioned standard response data returned by the above-mentioned reference object to be tested.

[0010] Optionally, the above-mentioned receiving the test parameters returned by the above-mentioned business operation system based on the above-mentioned parameter acquisition request includes receiving the above-mentioned test parameters returned by the above-mentioned business operation system through a message queue; the above-mentioned determining N target objects to be tested among the M objects to be tested in the set of objects to be tested, including using the above-mentioned message queue to set m disabled objects to be tested, wherein the above-mentioned m disabled objects to be tested cannot obtain the data call instructions generated based on the above-mentioned test parameters, m=MN; and taking the N objects to be tested except the above-mentioned m disabled objects to be tested as the N above-mentioned target objects to be tested.

[0011] Optionally, determining the test result of the set of objects to be tested based on the test result for each of the target objects to be tested includes determining that the test result of the set of objects to be tested is passed when the test result for each of the target objects to be tested indicates a pass.

[0012] Another aspect of the present disclosure provides an automated testing device, including an acquisition module for acquiring test parameters for testing an object to be tested; a first processing module for determining N target objects to be tested among M objects to be tested in a set of objects to be tested, wherein M and N are positive integers and N<M; a testing module for testing the N target objects to be tested using the above-mentioned test parameters to obtain test results for each of the above-mentioned target objects to be tested; and a second processing module for determining the test results of the above-mentioned set of objects to be tested based on the test results for each of the above-mentioned target objects to be tested.

[0013] Optionally, the acquisition module includes an acquisition request sending submodule, which is used to send a parameter acquisition request to the business operation system; and a test parameter receiving submodule, which is used to receive test parameters returned by the business operation system based on the parameter acquisition request, wherein the test parameters include at least one of business configuration parameters, interface parameters and test methods.

[0014] Optionally, the above-mentioned first processing module includes an election trigger instruction sending submodule, which is used to send an election trigger instruction to each of the above-mentioned M objects to be tested, so that at least some of the above-mentioned M objects to be tested will elect a main object to be tested; and a target object to be tested determination submodule, which is used to take the N objects to be tested participating in the election as the above-mentioned target objects to be tested when the number of objects to be tested participating in the election reaches N, wherein N>M / 2.

[0015] Optionally, the above-mentioned test module includes a data call instruction generation submodule, which is used to generate a data call instruction based on the above-mentioned test parameters; a data call instruction sending submodule, which is used to send the above-mentioned data call instruction to the N above-mentioned target objects to be tested to obtain response data returned by each of the above-mentioned target objects to be tested; and a first test result determination submodule, which is used to compare the response data returned by each of the above-mentioned target objects to be tested with the standard response data to obtain the test results for each of the above-mentioned target objects to be tested.

[0016] Optionally, the data call instruction sending submodule is further used to send the data call instruction to a preset reference object to be tested; the test module also includes a standard response data receiving submodule, which is used to receive the standard response data returned by the reference object to be tested.

[0017] Optionally, the test parameter receiving submodule is used to receive the test parameters returned by the business operation system through the message queue; the first processing module includes a disabled object to be tested setting submodule, which is used to use the message queue to set m disabled objects to be tested, wherein the m disabled objects to be tested cannot obtain the data call instructions generated based on the test parameters, m=MN; the target object to be tested determination submodule is also used to use the N objects to be tested other than the m disabled objects to be tested as the target objects to be tested.

[0018] Optionally, the second processing module includes a second test result determination submodule, configured to determine that the test result of the set of objects to be tested is passed when the test result for each of the target objects to be tested indicates a pass.

[0019] Another aspect of the present disclosure provides an electronic device. The electronic device includes at least one processor and a memory connected to the at least one processor. The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the method of the embodiment of the present disclosure.

[0020] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method of the embodiment of the present disclosure when executed.

[0021] Another aspect of the present disclosure provides a computer program, which includes computer executable instructions. When the instructions are executed, they are used to implement the method of the embodiment of the present disclosure.

[0022] Through the embodiments disclosed herein, because the test parameters for testing the object to be tested are obtained; among the M objects to be tested in the object set, N target objects to be tested are determined, wherein M and N are positive integers and N<M; the N target objects to be tested are tested using the test parameters to obtain test results for each target object to be tested; and according to the test results for each target object to be tested, the test results of the object set to be tested are determined. Therefore, the technical problems of difficult test data maintenance and low test efficiency existing in the related art are at least partially overcome, thereby achieving the technical effect of effectively reducing the difficulty of test data maintenance and effectively improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:

[0024] Figure 1 The automated testing system architecture according to an embodiment of the present disclosure is schematically shown;

[0025] Figure 2 A flowchart of an automated testing method according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 3 A flowchart of an automated testing method according to another embodiment of the present disclosure is schematically shown;

[0027] Figure 4 The overall process diagram of the automated testing method according to the embodiment of the present disclosure is schematically shown;

[0028] Figure 5 The schematic diagram schematically shows the principle of the election of the object to be tested according to the embodiment of the present disclosure;

[0029] Figure 6 A block diagram of an automated testing device according to an embodiment of the present disclosure is schematically shown;

[0030] Figure 7 A block diagram of an electronic device suitable for implementing an automated testing method and apparatus according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0031] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0032] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0033] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0034] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0035] Various embodiments of the present disclosure provide an automated testing method and a testing device capable of applying the method. The method may include obtaining test parameters for testing an object to be tested, and determining N target objects to be tested among M objects to be tested in a set of objects to be tested, wherein M and N are positive integers, and N<M, and then using the test parameters to test the N target objects to be tested, obtaining test results for each target object to be tested, and finally determining the test results of the set of objects to be tested based on the test results for each target object to be tested.

[0036] like Figure 1As shown, the system architecture 100 includes at least one object to be tested (a plurality of objects to be tested are shown in the figure, such as objects to be tested 101, 102, 103, which may be a set of objects to be tested, which is not shown in the figure) and a test platform 104. In the system architecture 100, the test platform 104 obtains test parameters for testing the object to be tested (such as objects to be tested 101, 102, 103), and determines N target objects to be tested among the M objects to be tested in the set of objects to be tested, wherein M and N are positive integers, and N<M, and then uses the test parameters to test the N target objects to be tested, obtains the test results for each target object to be tested, and finally determines the test results for the set of objects to be tested according to the test results for each target object to be tested.

[0037] In the process of realizing the concept of the disclosed invention, the inventors found that in the related art, test cases for testing the object to be tested are formed according to pre-saved test parameters. However, due to the continuous update of business types and business content, the pre-saved test parameters may be outdated. When using the test cases formed based on the test parameters to perform automated testing on the object to be tested, the test results may be inaccurate or even require manual intervention to judge the test results, which not only affects the test effect of automated testing, but also affects the test efficiency of automated testing.

[0038] For example, the sales period of product A in Beijing has been adjusted from 2020.5.1-2020.8.1 to 2020.5.1-2020.7.1. When the period of 2020.7.15-2020.8.1 is used as the test parameter to test the object under test in the business system, the object under test cannot return the product data of product A. At this time, if the object under test is judged to be abnormal, the test result may be inaccurate.

[0039] The present disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] Figure 2 A flowchart of an automated testing method according to an embodiment of the present disclosure is schematically shown, and the method applies a testing platform.

[0041] like Figure 2 As shown, the method may include, for example, operations S210 to S240.

[0042] In operation S210, a test parameter for testing an object to be tested is acquired.

[0043] In the embodiments of the present disclosure, specifically, the test parameters may include, for example, business configuration parameters, interface parameters, and test methods. Business configuration parameters describe the configuration information of business objects. Business configuration parameters may include, for example, product name, sales region, sales time period, flash sale price, activity time, discount information, purchase limit quantity, and other information. For example, business configuration parameters describe the sales time period of product A in different regions, or describe the promotional price of product A in different regions. Interface parameters describe the parameter information of the interface that the object to be tested needs to call, such as describing the parameter information of the flash sale price acquisition interface.

[0044] The object to be tested may be an instance in the product operation system, and the instance may be a service container with a software application installed, such as a computer with a software application installed. Testing the object to be tested includes testing the computer hardware and software applications in the business operation system. When the test result for the object to be tested indicates an abnormality, it may be a computer hardware abnormality, such as a computer CPU abnormality, or a software application abnormality, such as the version of the software installation package is not the latest version, etc.

[0045] A method for obtaining test parameters for testing an object to be tested may, for example, include: sending a parameter acquisition request to a business operation system; receiving test parameters returned by the business operation system based on the parameter acquisition request, wherein the test parameters include at least one of business configuration parameters, interface parameters and test methods.

[0046] The test platform sends a parameter acquisition request to the business operation system. After receiving the parameter acquisition request, the business operation system obtains business configuration parameters, interface parameters, test methods and other parameters as test parameters. The business operation system asynchronously saves the test parameters and returns the test parameters to the test platform. By obtaining the test parameters from the business operation system, it is helpful to ensure the real-time and effectiveness of the test parameters, and can effectively avoid the problem of inaccurate test results caused by the lag of test parameters. At the same time, it is also helpful to improve the test efficiency of automated testing.

[0047] Optionally, the method may further include parsing the business parameters returned by the business operation system to process the business parameters into parameter contents in a preset format required by the detection platform, and then using the parsed business parameters to perform subsequent test tasks.

[0048] Next, in operation S220, N target objects to be tested are determined from the M objects to be tested in the object set, where M and N are positive integers and N<M.

[0049] In the embodiments of the present disclosure, specifically, the set of objects to be tested may include a large number of objects to be tested. In order to improve the test efficiency and reduce the test cost, some of the objects to be tested in the set of objects to be tested may be tested. In the related art, some of the objects to be tested are manually selected for testing, which is not conducive to improving the test efficiency of automated testing. The method uses a test platform to determine N target objects to be tested among the M objects to be tested in the set of objects to be tested, where M and N are positive integers and N<M, thereby realizing the use of the test platform to automatically determine some of the objects to be tested for testing.

[0050] Optionally, the value of N can be a positive integer less than M but greater than M / 2, that is, more than half of the objects to be tested in the set of objects to be tested are tested, and the test results of the set of objects to be tested are determined based on the test results of more than half of the objects to be tested. This is conducive to improving the test efficiency of automated testing, and is better suitable for automated testing of computer clusters containing a large number of objects to be tested. Of course, the value of N can be determined based on the test effect and test requirements, and the embodiment of the present disclosure does not limit the number of selected partial objects to be tested.

[0051] Next, in operation S230, the N target objects to be tested are tested using the test parameters to obtain a test result for each target object to be tested.

[0052] In the disclosed embodiment, specifically, a data call instruction is generated according to the test parameters; the data call instruction is sent to a preset reference object to be tested and N target objects to be tested, so as to obtain standard response data returned by the reference object to be tested and response data returned by each target object to be tested. The response data returned by each target object to be tested is compared with the standard response data to obtain the test result for each target object to be tested. Specifically, when the response data returned by the target object to be tested is consistent with the standard response data, the test result for the target object to be tested is determined to be passed.

[0053] For example, the test parameters describe that product A is sold in Beijing, Chengdu, and Shanghai. A data call instruction is generated based on the test parameters to request the price data of product A in Beijing. The data call instruction is input into the benchmark test object and N target test objects to obtain the price data of product A in Beijing returned by the benchmark test object and the N target test objects. The price data returned by each target test object is compared with the price data returned by the benchmark test object to obtain the test results for each target test object.

[0054] Before sending the data call instruction to the benchmark object to be tested, it is necessary to determine whether the benchmark object to be tested is normal. Specifically, a test data call request can be generated based on the preset test parameters with normal timeliness, and the test data call request can be input into the benchmark object to be tested to obtain the test response data returned by the benchmark object to be tested, and the test response data is compared with the test standard response data. When the two are consistent, it is determined that the benchmark object to be tested is normal. Optionally, it is also possible to manually perform detection on the benchmark object to be tested, for example, manually determine whether the computer hardware of the benchmark object to be tested is normal, and determine whether the software application installed in the benchmark object to be tested is normal. When it is detected that the benchmark object to be tested is abnormal, it is necessary to perform abnormal correction processing on the benchmark object to be tested.

[0055] Next, in operation S240, the test result of the set of objects to be tested is determined according to the test result for each target object to be tested.

[0056] In the disclosed embodiment, specifically, when the test result for each target object to be tested indicates a pass, the test result of the object set to be tested is determined to be a pass. Some objects to be tested are selected from the object set to be tested as target objects to be tested, and when the test results of all target objects to be tested indicate a pass, that is, when the test results of some of the objects to be tested that are being tested all indicate a pass, it is determined that the object set to be tested is normal, at which time a cluster normal email is sent, and the automated test ends.

[0057] When the test results of individual target objects fail, it is determined that the computer hardware or software applications in the target objects are abnormal, and an abnormality notification email is sent for the target objects. When the test results of all target objects fail, it is determined that the test results of the set of objects fail, and a cluster abnormality email is sent, and the automated test ends.

[0058] When testing N target objects to be tested, the test task is decomposed into N+1 test subtasks according to the IP addresses of the N target objects to be tested, and the decomposed N+1 test subtasks can be processed in parallel in the test platform. For example, the N+1 test subtasks can be executed in parallel in a multi-threaded manner without interfering with each other. Specifically, the N test subtasks for the N target objects to be tested and 1 test subtask for the reference object to be tested can be executed in parallel in a multi-threaded manner.

[0059] When performing automated testing on an object to be tested, a scheduled task can be created, the test task for the object to be tested can be saved in the scheduled task, and the automated test task can be executed when the preset time threshold of the scheduled task is reached. Specifically, when the preset time threshold of the scheduled task is reached, multiple test subtasks can be executed in parallel in a multi-threaded manner.

[0060] In the disclosed embodiment, by obtaining test parameters for testing the object to be tested; among the M objects to be tested in the object set, N target objects to be tested are determined, wherein M and N are positive integers and N<M; using the test parameters, the N target objects to be tested are tested to obtain test results for each target object to be tested; and according to the test results for each target object to be tested, the test results of the object set to be tested are determined. When using the test platform for automated testing, the test parameters for testing the object to be tested are obtained through the test platform, which is conducive to ensuring the timeliness and accuracy of the test parameters, and can effectively avoid the problems of inaccurate test results and low test efficiency caused by the lag of the test parameters, and is also conducive to reducing the difficulty of maintaining the test data; using the test platform to determine some of the objects to be tested in the object set to be tested is conducive to improving the test efficiency of automated testing compared to manually determining some of the objects to be tested.

[0061] Figure 3 The flowchart of an automated testing method according to another embodiment of the present disclosure is schematically shown.

[0062] like Figure 3 As shown, operation S220 may include operations S310 to S320, for example.

[0063] In operation S310, an election trigger instruction is sent to each of the M objects to be tested, so that at least part of the M objects to be tested elect a master object to be tested.

[0064] In the disclosed embodiment, specifically, when some of the objects to be tested are selected for testing in the object set by the test platform, the test platform sends an election trigger instruction to the M objects to be tested in the object set to trigger at least some of the objects to be tested in the M objects to be tested to perform an election, and the election process can be implemented using the Zookeeper election algorithm. The process of the object to be tested performing an election may include, for example, according to the object number of at least one object to be tested participating in the election, the object to be tested with the largest object number of at least one object to be tested voting is the main object to be tested (i.e., leader), and when the number of votes for a certain object to be tested elected as leader exceeds half of the number of objects to be tested participating in the election, the object to be tested is determined to be the leader. After the leader in the object to be tested is elected, the other objects to be tested serve as the subordinate objects to be tested (i.e., followers) of the leader, wherein the other objects to be tested include the objects to be tested that participate in the election subsequently, and the object numbers of the objects to be tested that participate in the election subsequently may be larger than the object number of the leader, but because the leader has been successfully elected at this time, the objects to be tested with larger object numbers that participate in the election subsequently will also be used as followers.

[0065] Next, in operation S320, when the number of the test objects participating in the election reaches N, the N test objects participating in the election are used as target test objects, where N>M / 2.

[0066] In the disclosed embodiment, specifically, when the number of test objects participating in the election exceeds half of the total number of test objects in the test object set, the test object set is characterized as a healthy cluster, and the N test objects participating in the election are used as target test objects for testing. In this way, some test objects in the test object set for testing are automatically determined, which is conducive to effectively improving the efficiency of automated testing.

[0067] There is a communication connection between the M objects to be tested in the set of objects to be tested. When the communication connection between a certain object to be tested and other objects to be tested is disconnected, it will not be able to participate in the voting. Specifically, during the voting process, different objects to be tested will exchange voting results. When other objects to be tested cannot obtain the voting results of a certain object to be tested, it can be determined that the communication connection between the object to be tested and other objects to be tested is disconnected, and the object to be tested has failed to vote. The failure of the object to be tested to vote may be due to abnormal reasons such as communication failure of the object to be tested, or hardware failure of the object to be tested. At this time, an email notification is sent to the abnormal object to be tested.

[0068] When more than half of the objects in the set of objects to be tested are abnormal, the set of objects to be tested may be at high risk and may not be able to provide external services normally. Therefore, when more than half of the objects in the set of objects to be tested fail to vote, an email notification of the abnormality of the set of objects to be tested is sent, and the automated detection ends.

[0069] In addition to the method for determining N target objects to be tested described in operations S310 to S320, N target objects to be tested can also be determined by the following operations. When the test platform obtains the test parameters, what is obtained is the test parameters returned by the business operation system through the message queue. Since the disabled objects for the messages transmitted by it can be set through the message queue, the disabled objects to be tested for the test parameters can be set through the message queue, and the disabled objects to be tested cannot obtain the parameters to be tested transmitted by the message queue, and thus cannot obtain the data call instructions generated based on the parameters to be tested. Therefore, after receiving the test parameters returned by the business operation system through the message queue, m disabled objects to be tested are set using the message queue, wherein the m disabled objects to be tested cannot obtain the data call instructions generated based on the test parameters, m=MN, and then the N objects to be tested except the m disabled objects to be tested are used as N target objects to be tested. This design method can also realize the automatic determination of the target objects to be tested that need to be tested, which is conducive to effectively improving the efficiency of automated testing.

[0070] Figure 4The overall process diagram of the automated testing method according to the embodiment of the present disclosure is schematically shown. Figure 4 As shown, the overall process of the testing method may include operations S401 to S412.

[0071] In operation S401, a test parameter is obtained.

[0072] Specifically, test parameters are obtained from the business operation system, and the test parameters are used to test the object to be tested.

[0073] In operation S402, a data call instruction is generated.

[0074] Specifically, a data calling instruction is generated according to the acquired test parameters.

[0075] In operation S403, N target objects to be tested are determined in the set of objects to be tested.

[0076] In operation S404 , it is determined that the reference object to be tested is normal.

[0077] Specifically, if it is determined that the reference object to be tested is abnormal, it is necessary to perform manual intervention processing on the abnormal reference object to be tested until it is determined that the reference object to be tested is normal.

[0078] After operation S401 is performed, operation S402 is performed. While operations S401 and S402 are performed, operation S403 is performed synchronously, and operation S404 is performed synchronously. After operations S402, S403, and S404 are performed, operation S405 is performed.

[0079] In operation S405 , N+1 test subtasks are generated.

[0080] After operation S405 is performed, operation S406 and operation S408 are performed, after operation S406 is performed, operation S407 is performed, and after operation S408 is performed, operation S409 is performed.

[0081] In operation S406, inputting data call instructions to N target objects to be tested;

[0082] In operation S407, the response data returned by each target object to be tested is obtained;

[0083] In operation S408, a data call instruction is input to the reference object to be tested;

[0084] In operation S409, standard response data returned by the reference object to be tested is obtained;

[0085] After operations S407 and S409 are performed, operation S410 is performed.

[0086] In operation S410, the response data returned by each target object to be tested is compared with the standard response data;

[0087] In operation S411, the test results of each target object to be tested are obtained;

[0088] Specifically, the test result for the target object to be tested is determined according to whether the response data returned by the target object to be tested is consistent with the standard response data.

[0089] In operation S412, the test result of the set of objects to be tested is obtained.

[0090] Specifically, the test results of the set of objects to be tested are obtained according to the test results of each target object to be tested.

[0091] Figure 5 The schematic diagram schematically shows the principle of the selection of the object to be tested according to the embodiment of the present disclosure, as shown in FIG. Figure 5 As shown in FIG. 1 , the set of objects to be tested includes five objects to be tested, namely, objects 1, 2, 3, 4, and 5. Object 1 is the first object to be tested to participate in the election, and it elects itself as the leader (e.g., Figure 5 The voting action 111 shown in the figure indicates that the object 1 votes for the object 1 in the first round of voting. Since the number of votes obtained by the object 1 does not exceed half of the total number of objects in the object set, the object 1 cannot become the leader in the first round of election.

[0092] Object 2 is the second object to participate in the election. Since the object number of object 2 is greater than the object number of object 1, objects 1 and 2 elect object 2 as the leader (e.g. Figure 5 As shown in the voting actions 212 and 222, voting action 212 indicates that the object 1 votes for the object 2 in the second round of voting. For the meaning of the serial numbers of other voting actions in this figure, please refer to the above description). However, since the number of votes obtained by the object 2 does not exceed half of the total number of objects in the object set, the object 2 cannot become the leader in the second round of elections.

[0093] Object 3 is the third object to participate in the election. Since the object number of object 3 is greater than the object numbers of objects 1 and 2, objects 1, 2, and 3 elect object 3 as the leader. Since the number of votes obtained by object 3 exceeds half of the total number of objects in the object set, object 3 becomes the leader (primary object) in the third round of election.

[0094] When objects 4 and 5 participate in the election later, since a leader has been elected in the set of objects to be tested, although the object numbers of objects 4 and 5 are greater than the object number of object 3, since object 3 has been elected as the leader, objects 4 and 5 can only become followers (slave objects to be tested).

[0095] When the objects to be tested 1, 2, and 3 participate in the election, the number of the objects to be tested that collectively participate in the election exceeds half of the total number of the objects to be tested. At this time, the objects to be tested 1, 2, and 3 are determined to be the target objects to be tested.

[0096] Figure 5 The schematic diagram schematically describes the principle of the selection of the object to be tested, which does not impose any restrictions on the determination process of the target object to be tested.

[0097] Figure 6 The block diagram of the automated testing device according to an embodiment of the present disclosure is schematically shown.

[0098] like Figure 6 As shown, the device may include an acquisition module 601 , a first processing module 602 , a testing module 603 and a second processing module 604 .

[0099] Specifically, the acquisition module 601 is used to obtain test parameters for testing the object to be tested; the first processing module 602 is used to determine N target objects to be tested among the M objects to be tested in the object set, where M and N are positive integers and N<M; the testing module 603 is used to test the N target objects to be tested using the test parameters to obtain test results for each target object to be tested; the second processing module 604 is used to determine the test results of the object set according to the test results for each target object to be tested.

[0100] In the disclosed embodiment, by obtaining test parameters for testing the object to be tested; among the M objects to be tested in the object set, N target objects to be tested are determined, wherein M and N are positive integers and N<M; using the test parameters, the N target objects to be tested are tested to obtain test results for each target object to be tested; and according to the test results for each target object to be tested, the test results of the object set to be tested are determined. When using the test platform for automated testing, the test parameters for testing the object to be tested are obtained through the test platform, which is conducive to ensuring the timeliness and accuracy of the test parameters, and can effectively avoid the problems of inaccurate test results and low test efficiency caused by the lag of the test parameters, and is also conducive to reducing the difficulty of maintaining the test data; using the test platform to determine some of the objects to be tested in the object set to be tested is conducive to improving the test efficiency of automated testing compared to manually determining some of the objects to be tested.

[0101] As an optional embodiment, the acquisition module includes an acquisition request sending sub-module, which is used to send a parameter acquisition request to the business operation system; and a test parameter receiving sub-module, which is used to receive test parameters returned by the business operation system based on the parameter acquisition request, wherein the test parameters include at least one of business configuration parameters, interface parameters and test methods.

[0102] As an optional embodiment, the first processing module includes an election trigger instruction sending submodule, which is used to send an election trigger instruction to each of the M objects to be tested, so that at least some of the M objects to be tested will elect a main object to be tested; and a target object to be tested determination submodule, which is used to take the N objects to be tested participating in the election as target objects to be tested when the number of objects to be tested participating in the election reaches N, wherein N>M / 2.

[0103] As an optional embodiment, the test module includes a data call instruction generation submodule, which is used to generate data call instructions based on test parameters; a data call instruction sending submodule, which is used to send data call instructions to N target objects to be tested to obtain response data returned by each target object to be tested; and a first test result determination submodule, which is used to compare the response data returned by each target object to be tested with the standard response data to obtain the test results for each target object to be tested.

[0104] As an optional embodiment, the data call instruction sending submodule is also used to send the data call instruction to the preset reference test object; the test module also includes a standard response data receiving submodule, which is used to receive the standard response data returned by the reference test object.

[0105] As an optional embodiment, the test parameter receiving submodule is used to receive the test parameters returned by the business operation system through the message queue; the first processing module includes a disabled object to be tested setting submodule, which is used to use the message queue to set m disabled objects to be tested, wherein the m disabled objects to be tested cannot obtain the data call instructions generated based on the test parameters, m=MN; the target object to be tested determination submodule is also used to use the N objects to be tested except the m disabled objects to be tested as target objects to be tested.

[0106] As an optional embodiment, the second processing module includes a second test result determination submodule, which is used to determine that the test result of the set of objects to be tested is passed when the test result for each target object to be tested indicates a pass.

[0107] Optionally, any one of the modules and submodules in the acquisition module 601, the first processing module 602, the test module 603, and the second processing module 604, or at least part of the functions of any one of them can be implemented in one module. According to any one or more of the modules of the embodiments of the present disclosure, it can be split into multiple modules for implementation. According to any one or more of the modules of the embodiments of the present disclosure, it can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in any appropriate combination of any of them. Or according to one or more of the modules of the embodiments of the present disclosure, it can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0108] For example, any multiple of the acquisition module 601, the first processing module 602, the test module 603, and the second processing module 604 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. Optionally, at least one of the acquisition module 601, the first processing module 602, the test module 603, and the second processing module 604 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in any appropriate combination of any of them. Alternatively, at least one of the acquisition module 601, the first processing module 602, the test module 603, and the second processing module 604 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0109] Figure 7 A block diagram of an electronic device suitable for implementing an automated testing method and apparatus according to an embodiment of the present disclosure is schematically shown. Figure 7 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0110] like Figure 7As shown, the computer system 700 according to the embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0111] In RAM 703, various programs and data required for the operation of system 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other through bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0112] Optionally, the system 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The system 700 may further include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 706 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0113] Optionally, the method flow according to the embodiment of the present disclosure can be implemented as a computer software program. For example, the embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. Optionally, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0114] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0115] Alternatively, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device. For example, optionally, the computer-readable storage medium may include the ROM 702 and / or RAM 703 described above and / or one or more memories other than ROM 702 and RAM 703.

[0116] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0118] The embodiments of the present disclosure are described above. However, these embodiments are only for the purpose of illustration and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. An automated testing method, applied to a testing platform, comprising: Obtaining test parameters for testing the object to be tested; Determine N target test objects to be tested from the M test objects in the test object set, where M and N are positive integers and N<M; Using the test parameters, testing the N target objects to be tested to obtain a test result for each target object to be tested; Determining the test results of the set of objects to be tested according to the test results for each of the target objects to be tested; The step of determining N target objects to be tested from the M objects to be tested in the object set includes: Sending an election trigger instruction to each of the M objects to be tested, so that at least some of the M objects to be tested elect a master object to be tested; When the number of the test objects participating in the election reaches N, the N test objects participating in the election are used as the target test objects, wherein N>M / 2.

2. The method according to claim 1, wherein: The obtaining of test parameters for testing the object to be tested includes: Send a parameter acquisition request to the business operation system; Receive test parameters returned by the service operation system based on the parameter acquisition request, wherein the test parameters include at least one of service configuration parameters, interface parameters and test methods.

3. The method according to claim 1, wherein: The method of testing the N target objects to be tested by using the test parameters to obtain a test result for each target object to be tested includes: Generate a data call instruction according to the test parameters; Sending the data call instruction to the N target objects to be tested to obtain response data returned by each target object to be tested; The response data returned by each target object to be tested is compared with the standard response data to obtain the test result for each target object to be tested.

4. The method according to claim 3, wherein: The method for obtaining the standard response data comprises: Sending the data call instruction to a preset reference object to be tested; The standard response data returned by the reference object to be tested is received.

5. The method according to claim 2, wherein: The receiving the test parameters returned by the business operation system based on the parameter acquisition request includes: Receiving the test parameters returned by the business operation system through a message queue; The step of determining N target test objects to be tested from the M test objects in the test object set includes: Using the message queue, m disabled objects to be tested are set, wherein the m disabled objects to be tested cannot obtain the data call instruction generated based on the test parameters, m=MN; The N objects to be tested except the m disabled objects to be tested are used as the N target objects to be tested.

6. The method according to any one of claims 1 to 5, wherein: Determining the test result of the set of objects to be tested according to the test result of each target object to be tested includes: When the test result for each of the target objects to be tested indicates a pass, it is determined that the test result of the set of objects to be tested is a pass.

7. An automated testing device, comprising: An acquisition module, used for acquiring test parameters for testing the object to be tested; The first processing module is used to determine N target test objects to be tested from the M test objects in the test object set, where M and N are positive integers and N<M; A testing module, used to test the N target objects to be tested using the test parameters to obtain a test result for each target object to be tested; A second processing module, configured to determine the test result of the set of objects to be tested according to the test result of each of the target objects to be tested; Wherein, the first processing module includes: An election trigger instruction sending submodule, used to send an election trigger instruction to each of the M objects to be tested, so that at least some of the M objects to be tested perform an election for a main object to be tested; The target test object determination submodule is used to, when the number of test objects participating in the election reaches N, use the N test objects participating in the election as the target test objects, wherein N>M / 2.

8. An electronic device comprising: one or more processors; as well as a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Automatic testing method, automatic testing apparatus, computer readable storage medium and electronic device

    CN108647141A

  • Test method and device

    CN109976997A