CN113760708A - Automatic testing method and device - Google Patents

Automatic testing method and device Download PDF

Info

Publication number
CN113760708A
CN113760708A CN202011028887.7A CN202011028887A CN113760708A CN 113760708 A CN113760708 A CN 113760708A CN 202011028887 A CN202011028887 A CN 202011028887A CN 113760708 A CN113760708 A CN 113760708A
Authority
CN
China
Prior art keywords
tested
objects
test
target
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011028887.7A
Other languages
Chinese (zh)
Inventor
何晔
罗彦颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011028887.7A priority Critical patent/CN113760708A/en
Publication of CN113760708A publication Critical patent/CN113760708A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure provides an automated testing method applied to a testing platform, the method includes: acquiring test parameters for testing an object to be tested; determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer, and N is less than M; testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested; and determining the test result of the object set to be tested according to the test result of each target object to be tested. The disclosure also provides an automatic testing device, an electronic device and a computer readable storage medium.

Description

Automatic testing method and device
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to an automated testing method, an automated testing apparatus, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of internet technology, various service types are increasing, and the updating frequency of service contents is also accelerated. Testing computer hardware and software applications in a service operation system is a key factor for ensuring safe and stable operation of services.
In the process of implementing the disclosed concept of the present invention, the inventors found that when an object to be tested is tested, because the service type and the service content are continuously updated, the test parameters for testing need to be continuously updated, so as to avoid the problem of inaccurate test results caused by test parameter lag, and when a large number of objects to be tested need to be tested, a part of the objects to be tested need to be manually selected for testing, which has the problems of high difficulty in maintaining test data and low test efficiency.
Disclosure of Invention
In view of this, the present disclosure provides an automated testing method and apparatus with low test data maintenance difficulty and high test efficiency.
One aspect of the present disclosure provides an automated testing method applied to a testing platform, including: acquiring test parameters for testing an object to be tested; determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer, and N is less than M; testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested; and determining the test result of the object set to be tested according to the test result aiming at each target object to be tested.
Optionally, the obtaining of the test parameters for testing the object to be tested includes sending a parameter obtaining request to the service operating system; and receiving a test parameter returned by the service operation system based on the parameter acquisition request, wherein the test parameter comprises at least one of a service configuration parameter, an interface parameter and a test method.
Optionally, the determining N target objects to be tested from among the M objects to be tested in the object set to be tested includes: sending an election triggering instruction to each object to be tested in the M objects to be tested so as to enable at least part of the M objects to be tested to carry out election aiming at a main object to be tested; and when the number of the objects to be detected participating in the election reaches N, taking the N objects to be detected participating in the election as the target object to be detected, wherein N is more than M/2.
Optionally, the testing N target objects to be tested by using the test parameters to obtain a test result for each target object to be tested includes generating a data call instruction according to the test parameters; sending the data calling instruction to N target objects to be detected to obtain response data returned by each target object to be detected; and comparing the response data returned by each target object to be tested with the standard response data to obtain a test result aiming at each target object to be tested.
Optionally, the method for obtaining the standard response data includes sending the data call instruction to a preset reference object to be tested; and receiving the standard response data returned by the reference object to be tested.
Optionally, the receiving of the test parameter returned by the service operation system based on the parameter acquisition request includes receiving the test parameter returned by the service operation system through a message queue; determining N target objects to be tested from M objects to be tested in the object set to be tested, including setting M forbidden objects to be tested by using the message queue, where the M forbidden objects to be tested cannot obtain a data call instruction generated based on the test parameters, and M is M-N; and taking N objects to be measured except the m forbidden objects to be measured as N target objects to be measured.
Optionally, the determining the test result of the object set to be tested according to the test result for each target object to be tested includes determining that the test result of the object set to be tested passes when the test result for each target object to be tested indicates pass.
Another aspect of the present disclosure provides an automated testing apparatus, including an obtaining module, configured to obtain test parameters for testing an object to be tested; the first processing module is used for determining N target objects to be tested in M objects to be tested in the object set to be tested, wherein M, N is a positive integer, and N is less than M; the test module is used for testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested; and the second processing module is used for determining the test result of the object set to be tested according to the test result aiming at each target object to be tested.
Optionally, the acquiring module includes an acquiring request sending submodule, configured to send a parameter acquiring request to the service operating system; and the test parameter receiving submodule is used for receiving the test parameters returned by the service operation system based on the parameter acquisition request, wherein the test parameters comprise at least one of service configuration parameters, interface parameters and test methods.
Optionally, the first processing module includes an election triggering instruction sending sub-module, configured to send an election triggering instruction to each object to be tested in the M objects to be tested, so that at least part of the M objects to be tested performs election on a main object to be tested; and the target object-to-be-detected determining submodule is used for taking the N objects to be detected participating in the election as the target object-to-be-detected when the number of the objects to be detected participating in the election reaches N, wherein N is more than M/2.
Optionally, the test module includes a data call instruction generation sub-module, configured to generate a data call instruction according to the test parameter; a data call instruction sending submodule, configured to send the data call instruction to N target objects to be tested, so as to obtain response data returned by each target object to be tested; and the first test result determining submodule is used for comparing the response data returned by each target object to be tested with the standard response data to obtain a test result aiming at each target object to be tested.
Optionally, the data call instruction sending submodule is further configured to send the data call instruction to a preset reference object to be tested; the test module further comprises a standard response data receiving submodule for receiving the standard response data returned by the reference object to be tested.
Optionally, the test parameter receiving sub-module is configured to receive the test parameter returned by the service operating system through a message queue; the first processing module comprises a forbidden object to be tested setting submodule for setting M forbidden objects to be tested by using the message queue, wherein the M forbidden objects to be tested cannot acquire a data calling instruction generated based on the test parameters, and M is M-N; the target object-to-be-detected determination sub-module is further configured to use N objects to be detected, excluding the m disabled objects to be detected, as the target object to be detected.
Optionally, the second processing module includes a second test result determining sub-module, configured to determine that the test result of the set of objects to be tested passes when the test result for each of the target objects to be tested indicates passing.
Another aspect of the present disclosure provides an electronic device. The electronic device includes at least one processor, and a memory communicatively coupled to the at least one processor. Wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to implement the methods of the embodiments of the present disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, implement the method of embodiments of the present disclosure.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method of an embodiment of the disclosure when executed.
According to the embodiment of the disclosure, the test parameters for testing the object to be tested are acquired; determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer, and N is less than M; testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested; according to the technical scheme for determining the test result of the object set to be tested according to the test result of each target object to be tested, the technical problems of high test data maintenance difficulty and low test efficiency in the related technology are at least partially solved, and the technical effects of effectively reducing the test data maintenance difficulty and effectively improving the test efficiency are further achieved.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
FIG. 1 schematically illustrates an automated test system architecture according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of an automated testing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of an automated testing method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates an overall flow diagram of an automated testing method according to an embodiment of the present disclosure;
FIG. 5 schematically shows a schematic diagram of a selection of an object to be measured according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of an automated testing apparatus according to an embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of an electronic device suitable for implementing automated testing methods and apparatus according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It is to be understood that such description is merely illustrative and not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, operations steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Various embodiments of the present disclosure provide an automated testing method and a testing apparatus to which the method can be applied. The method comprises the steps of obtaining test parameters for testing objects to be tested, determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer and N is less than M, 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, and determining the test result of the object set to be tested according to the test result for each target object to be tested.
As shown in fig. 1, the system architecture 100 includes at least one object under test (a plurality of objects under test 101, 102, 103, which may be a set of objects under test, not shown) and a test platform 104. In the system architecture 100, the test platform 104 obtains test parameters for testing objects to be tested (such as the objects to be tested 101, 102, 103), and determines N target objects to be tested from M objects to be tested in the object set to be tested, where M, N is a positive integer and N is less than M, then tests the N target objects to be tested by using the test parameters to obtain a test result for each target object to be tested, and finally determines the test result for the object set to be tested according to the test result for each target object to be tested.
In the process of implementing the inventive concept of the present disclosure, the inventor finds that a test case for testing an object to be tested is formed according to pre-stored test parameters in the related art. However, due to the continuous update of the service types and the service contents, the pre-stored test parameters may have a problem of hysteresis, and when the test case formed based on the test parameters is used to perform the automated test on the object to be tested, the test result may be inaccurate, and even the test result may need to be judged by manual intervention, which not only affects the test effect of the automated test, but also affects the test efficiency of the automated test.
Illustratively, the sale time period of the product A in Beijing is already regulated from 2020.5.1-2020.8.1 to 2020.5.1-2020.7.1, and when the time period of 2020.7.15-2020.8.1 is used as a test parameter to test an object to be tested in a business system, the object to be tested cannot return the product data of the product A. At this time, if the object to be tested is judged to be abnormal, the problem of inaccurate test result may occur.
The present disclosure will be described in detail below with reference to the drawings and specific embodiments.
FIG. 2 schematically shows a flow diagram of an automated testing method, which employs a test platform, according to an embodiment of the present disclosure.
As shown in fig. 2, the method may include operations S210 to S240, for example.
In operation S210, test parameters for testing an object to be tested are acquired.
In the embodiment of the present disclosure, specifically, the test parameters may include, for example, service configuration parameters, interface parameters, a test method, and the like. The service configuration parameter describes configuration information of the service object, and the service configuration parameter may include, for example, information such as a commodity name, a selling region, a selling time period, a flash purchase price, an activity time, preferential information, a limited purchase quantity, and the like, and exemplarily, the service configuration parameter describes a selling time period of the product a in different regions, or describes a promotion price of the product a in different regions, and the like. The interface parameter describes parameter information of an interface to be called by the object to be tested, for example, parameter information describing a flash purchase price acquisition interface.
The object to be tested may be an instance in a product running system, and the instance may specifically be a service container installed with a software application, for example, a computer installed with the software application. And testing the object to be tested, including testing computer hardware and software application in the service operation system. When the test result for the object to be tested indicates an exception, specifically, it may be a computer hardware exception, for example, it may be a computer CPU exception, or it may also be a software application exception, for example, it may be that the version of the software installation package is not the latest version, or the like.
The method for obtaining test parameters for testing an object to be tested may include, for example: sending a parameter acquisition request to a service operation system; and receiving a test parameter returned by the service operation system based on the parameter acquisition request, wherein the test parameter comprises at least one of a service configuration parameter, an interface parameter and a test method.
The test platform sends a parameter acquisition request to the service operation system, and the service operation system acquires parameters such as service configuration parameters, interface parameters, a test method and the like as test parameters after receiving the parameter acquisition request. And the service operation system asynchronously stores the test parameters and returns the test parameters to the test platform. By acquiring the test parameters from the service operation system, the real-time performance and the effectiveness of the test parameters are favorably ensured, the problem of inaccurate test results caused by lagging test parameters can be effectively avoided, and meanwhile, the test efficiency of automatic testing is favorably improved.
Optionally, the method may further include parsing the service parameters returned by the service operating system to implement processing the service parameters into parameter contents in a preset format required by the detection platform, and then performing subsequent testing tasks by using the parsed service parameters.
Next, in operation S220, N target objects to be tested are determined from M objects to be tested in the object set to be tested, where M, N is a positive integer and N is less than M.
In the embodiment of the present disclosure, specifically, the object to be tested may include a large number of objects to be tested in a set, and in order to improve the testing efficiency and reduce the testing cost, part of the objects to be tested in the set may be tested. In the related art, part of objects to be tested are manually selected, which is not beneficial to improving the testing efficiency of the automatic testing. The method comprises the steps of determining N target objects to be tested in M objects to be tested in an object set to be tested by using a test platform, wherein M, N is a positive integer, and N is less than M, so that the test platform is used for automatically determining part of the objects to be tested.
Optionally, the value of N may be a positive integer smaller than M but larger than M/2, that is, more than half of the objects to be tested in the object set to be tested are tested, and the test result of the object set to be tested is determined according to the test result of more than half of the objects to be tested. The method is beneficial to improving the testing efficiency of the automatic testing, and is better suitable for carrying out the automatic testing on the computer cluster containing a large number of objects to be tested. Of course, the value of N may be determined according to the test effect and the test requirement, and the number of the selected part of the objects to be tested is not limited in the embodiment of the present disclosure.
Next, in operation S230, the N target objects to be tested are tested by using the test parameters, and a test result for each target object to be tested is obtained.
In the embodiment of the present disclosure, specifically, a data call instruction is generated according to a test parameter; and sending the data calling instruction to a preset reference object to be detected and N target objects to be detected so as to obtain standard response data returned by the reference object to be detected and response data returned by each target object to be detected. And comparing the response data returned by each target object to be tested with the standard response data to obtain a test result aiming at 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.
Illustratively, the test parameters describe that the product A is sold in Beijing, Chengdu, Shanghai, and a data call instruction is generated based on the test parameters to request to call price data of the product A in the Beijing area. And inputting the data calling instruction into the reference object to be detected and the N target objects to be detected to obtain price data of the product A in the Beijing area returned by the reference object to be detected and the N target objects to be detected. And comparing the price data returned by each target object to be tested with the price data returned by the reference object to be tested to obtain a test result aiming at each target object to be tested.
Before sending the data call instruction to the reference object to be tested, it is necessary to determine whether the reference object to be tested is normal. Specifically, a test data call request may be generated based on a preset test parameter with normal aging, the test data call request is input to the reference object to be tested to obtain test response data returned by the reference object to be tested, the test response data is compared with the test standard response data, and when the test response data is consistent with the test standard response data, it is determined that the reference object to be tested is normal. Alternatively, the detection of the reference object to be measured may also be performed manually, for example, by manually determining whether computer hardware of the reference object to be measured is normal, determining whether a software application installed in the reference object to be measured is normal, or the like. When the detection reference object is abnormal, the abnormality correction processing needs to be performed on the reference object.
Next, in operation S240, a test result of the object set to be tested is determined according to the test result for each target object to be tested.
In the embodiment of the present disclosure, specifically, when the test result indication for each target object to be tested passes, it is determined that the test result of the object set to be tested passes. And selecting part of the objects to be tested in the object set to be tested as target objects to be tested for testing, determining that the object set to be tested is normal when the test results of all the target objects to be tested pass, namely when the test results of the tested part of the objects to be tested all pass, sending cluster normal mails at the moment, and finishing the automatic test.
And when the test result of the individual target object to be tested does not pass, determining that the computer hardware or software application in the part of the target object to be tested has an abnormality, and sending an abnormality notification mail for the part of the target object to be tested. And when the test results of all the target objects to be tested do not pass, determining that the test results of the object set to be tested do not pass, at the moment, sending cluster abnormal mails, and finishing the automatic test.
When testing the N target objects to be tested, the testing task is decomposed into N +1 testing subtasks according to the IP addresses of the N target objects to be tested, and the decomposed N +1 testing subtasks can be processed in parallel in the testing platform. For example, N +1 test subtasks may be executed in parallel in a multi-thread manner without interfering with each other, and specifically, N test subtasks for N target objects to be tested and 1 test subtask for a reference object to be tested may be executed in parallel in a multi-thread manner.
When the automatic test is carried out on the object to be tested, a timing task can be established, the test task aiming at the object to be tested is stored in the timing task, and the automatic test task is executed when the preset time threshold of the timing task is reached. Specifically, when the preset time threshold of the timing task is reached, a plurality of test subtasks can be executed in parallel in a multi-thread manner.
In the embodiment of the disclosure, test parameters for testing an object to be tested are obtained; determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer, and N is less than M; testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested; and determining the test result of the object set to be tested according to the test result aiming at each target object to be tested. When the test platform is used for carrying out automatic test, the test platform is used for obtaining test parameters for testing an object to be tested, so that timeliness and accuracy of the test parameters are guaranteed, the problems of inaccurate test result and low test efficiency caused by test parameter lag can be effectively avoided, and the maintenance difficulty of test data is reduced; the test platform is used for determining part of objects to be tested in the object set to be tested, and compared with the method for manually determining part of objects to be tested, the method is beneficial to improving the test efficiency of automatic test.
FIG. 3 schematically illustrates a flow diagram of an automated testing method according to another embodiment of the present disclosure.
As shown in fig. 3, operation S220 may include, for example, operations S310 to S320.
In operation S310, an election triggering instruction is sent to each object to be tested in the M objects to be tested, so that at least some of the M objects to be tested perform election for the main object to be tested.
In the embodiment of the present disclosure, specifically, when a part of objects to be tested is selected in the object set to be tested through the test platform, the test platform sends an election triggering instruction to M objects to be tested in the object set to be tested to trigger at least part of the M objects to be tested to be elected, and the election process may be implemented by using a Zookeeper election algorithm. The process of electing the object to be detected may include, for example, according to an object number of at least one object to be detected participating in the election, where the object to be detected with the largest voted object number of the at least one object to be detected is a main object to be detected (i.e., leader), and when the number of votes of a certain object to be detected elected as leader exceeds half of the number of objects to be detected participating in the election, determining that the object to be detected is leader. After the leader in the objects to be tested is elected, other objects to be tested are used as slave objects to be tested (namely, the follower) of the leader, wherein the other objects to be tested comprise the objects to be tested which subsequently participate in the election, the object number of the objects to be tested which subsequently participate in the election 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 the larger object number of the objects which subsequently participate in the election are also used as the follower.
Next, in operation S320, when the number of the objects to be measured participating in the election reaches N, the N objects to be measured participating in the election are taken as target objects to be measured, where N > M/2.
In the embodiment of the present disclosure, specifically, when the number of the objects to be tested participating in the election exceeds half of the total number of the objects to be tested in the object set to be tested, the object set to be tested is represented as a healthy cluster, and at this time, the N objects to be tested participating in the election are used as target objects to be tested for testing. By the method, the partial objects to be tested which are tested in a centralized manner can be automatically determined, and the automatic testing efficiency can be effectively improved.
Communication connection exists among M objects to be tested in the object set to be tested, and when the communication connection between a certain object to be tested and other objects to be tested is disconnected, the M objects to be tested cannot participate in voting. Specifically, in the voting process, the voting results of different objects to be tested are exchanged, and when other objects to be tested cannot obtain the voting result of a certain object to be tested, it can be determined that the communication connection between the object to be tested and the other objects to be tested is disconnected, and the object to be tested fails in voting. The failure of voting of the object to be tested may be due to an abnormal reason such as a communication failure of the object to be tested, or a hardware failure of the object to be tested, and at this time, a mail notification for the abnormal object to be tested is sent.
When more than half of the objects to be tested in the set of objects to be tested are abnormal, the set of objects to be tested may have a high risk, and may not provide external services normally. Therefore, when more than half of the objects to be detected in the object set fail to vote, an abnormal mail notification of the object set to be detected is sent out, and the automatic detection is finished.
In addition to the method of determining N target objects described in operations S310 to S320, the N target objects may be determined by the following operations. When the test platform obtains the test parameters, the test parameters returned by the service operation system through the message queue are obtained. Since the forbidden object for the transmitted message can be set through the message queue, the forbidden object to be tested for the test parameter can be set through the message queue, the forbidden object to be tested cannot acquire the parameter to be tested transmitted by the message queue, and further the data calling instruction generated based on the parameter to be tested cannot be acquired. Therefore, after receiving the test parameters returned by the service operating system through the message queue, M forbidden objects to be tested are set by using the message queue, wherein the M forbidden objects to be tested cannot acquire the data call instruction generated based on the test parameters, and M is M-N, and then N objects to be tested except the M forbidden objects to be tested are used as N target objects to be tested. The design mode can also realize automatic determination of the target object to be tested, which is beneficial to effectively improving the automatic testing efficiency.
Fig. 4 schematically shows an overall flowchart of an automated testing method according to an embodiment of the present disclosure, and as shown in fig. 4, the overall flowchart of the testing method may include operations S401 to S412.
In operation S401, test parameters are acquired.
Specifically, test parameters are obtained from the business operation system, and the test parameters are used for testing the object to be tested.
In operation S402, a data call instruction is generated.
Specifically, a data call instruction is generated according to the acquired test parameters.
In operation S403, N target objects to be measured are determined in the object set to be measured.
In operation S404, it is determined that the reference object to be measured is normal.
Specifically, if it is determined that the reference object to be measured is abnormal, manual intervention processing needs to be performed on the abnormal reference object to be measured until it is determined that the reference object to be measured is normal.
After performing operation S401, operation S402 is performed. While operations S401 and S402 are performed, operation S403 is performed in synchronization, and operation S404 is performed in synchronization. After completing operations S402, S403, and S404 are performed, operation S405 is performed.
In operation S405, N +1 test subtasks are generated.
After the execution of operation S405, operations S406 and S408 are performed, after the execution of operation S406, operation S407 is performed, and after the execution of operation S408, operation S409 is performed.
In operation S406, inputting a data call instruction to the N target objects to be tested;
in operation S407, response data returned by each target object to be detected is obtained;
in operation S408, a data call instruction is input to the reference object to be measured;
in operation S409, standard response data returned by the reference object to be tested is obtained;
after performing operations S407 and S409, operation S410 is performed.
In operation S410, comparing response data returned by each target object to be tested with standard response data;
in operation S411, a test result of each target object to be tested is obtained;
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.
In operation S412, a test result of the set of objects to be tested is obtained.
Specifically, the test result of the object set to be tested is obtained according to the test result of each target object to be tested.
Fig. 5 schematically illustrates a schematic principle diagram of the election of the objects to be measured according to the embodiment of the disclosure, as shown in fig. 5, the set of objects to be measured includes 5 objects to be measured, which are respectively the objects to be measured 1, 2, 3, 4, and 5, the object to be measured 1 is the 1 st object to be measured participating in the election, and the election itself is a leader (as shown in fig. 5, the voting action 111 indicates that the object to be measured 1 votes to the object to be measured 1 in the 1 st round of voting), because the number of votes obtained by the object to be measured 1 does not exceed half of the total number of the objects to be measured in the set of objects to be measured, the object to be measured 1 cannot become a leader in the 1 st round of election.
The object 2 to be tested is the 2 nd object to be tested participating in the election, since the object number of the object 2 to be tested is greater than the object number of the object 1 to be tested, the objects 1 and 2 to be tested vote for the object 2 to be tested (as shown in fig. 5, the voting actions 212 indicate that the object 1 to be tested votes to the object 2 to be tested in the 2 nd round of voting, and the sequence numbers of the other voting actions in this figure refer to the foregoing description), but since the number of votes obtained by the object 2 to be tested does not exceed half of the total number of the objects to be tested in the set of objects to be tested, the object 2 to be tested cannot become a leader in the 2 nd round of election.
The object 3 to be detected is the 3 rd object to be detected participating in election, and the object 1 to be detected, the object 2 to be detected and the object 3 to be detected are leader because the object number of the object 3 to be detected is larger than the object numbers of the objects 1 and 2 to be detected. Since the number of tickets obtained by the object 3 to be measured exceeds half of the total number of the objects to be measured in the object set to be measured, the object 3 to be measured becomes a leader (main object to be measured) in the 3 rd round of election.
When the objects 4 and 5 to be measured participate in the subsequent election, since the leader is already elected in the set of objects to be measured, although the object numbers of the objects 4 and 5 to be measured are greater than the object number of the object 3 to be measured, since the object 3 to be measured is already elected as the leader, the objects 4 and 5 to be measured can only become a follower (slave object to be measured).
When the objects to be detected 1, 2 and 3 participate in the election, the number of the objects to be detected participating in the election in the object set to be detected exceeds half of the total number of the objects to be detected, and at the moment, the objects to be detected 1, 2 and 3 are determined to be target objects to be detected for detection.
Fig. 5 schematically illustrates a schematic diagram of the selection of the target object, which does not limit the determination process of the target object.
FIG. 6 schematically illustrates a block diagram of an automated testing apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the apparatus may include an acquisition module 601, a first processing module 602, a testing module 603, and a second processing module 604.
Specifically, the obtaining module 601 is configured to obtain a test parameter for testing an object to be tested; the first processing module 602 is configured to determine N target objects to be tested from among M objects to be tested in the object set to be tested, where M, N is a positive integer and N is less than M; the test module 603 is configured to test the N target objects to be tested by using the test parameters, so as to obtain a test result for each target object to be tested; the second processing module 604 is configured to determine a test result of the object set to be tested according to the test result for each target object to be tested.
In the embodiment of the disclosure, test parameters for testing an object to be tested are obtained; determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer, and N is less than M; testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested; and determining the test result of the object set to be tested according to the test result aiming at each target object to be tested. When the test platform is used for carrying out automatic test, the test platform is used for obtaining test parameters for testing an object to be tested, so that timeliness and accuracy of the test parameters are guaranteed, the problems of inaccurate test result and low test efficiency caused by test parameter lag can be effectively avoided, and the maintenance difficulty of test data is reduced; the test platform is used for determining part of objects to be tested in the object set to be tested, and compared with the method for manually determining part of objects to be tested, the method is beneficial to improving the test efficiency of automatic test.
As an optional embodiment, the obtaining module includes an obtaining request sending submodule, configured to send a parameter obtaining request to the service operating system; and the test parameter receiving submodule is used for receiving the test parameters returned by the service operation system based on the parameter acquisition request, wherein the test parameters comprise at least one of service configuration parameters, interface parameters and a test method.
As an optional embodiment, the first processing module includes an election trigger instruction sending submodule, configured to send an election trigger instruction to each object to be tested among the M objects to be tested, so that at least part of the M objects to be tested performs election on the main object to be tested; and the target object-to-be-detected determining submodule is used for taking the N objects to be detected participating in the election as the target object-to-be-detected when the number of the objects to be detected participating in the election reaches N, wherein N is greater than M/2.
As an optional embodiment, the test module includes a data call instruction generation sub-module, configured to generate a data call instruction according to the test parameter; the data calling instruction sending submodule is used for sending the data calling instruction to the N target objects to be detected so as to obtain response data returned by each target object to be detected; and the first test result determining submodule is used for comparing the response data returned by each target object to be tested with the standard response data to obtain a test result aiming at each target object to be tested.
As an optional embodiment, the data call instruction sending submodule is further configured to send the data call instruction to a preset reference object to be tested; the test module also comprises a standard response data receiving submodule used for receiving the standard response data returned by the reference object to be tested.
As an optional embodiment, the test parameter receiving submodule is configured to receive a test parameter returned by the service operating system through the message queue; the first processing module comprises a forbidden object to be tested setting submodule and a message queue, wherein the forbidden object to be tested setting submodule is used for setting M forbidden objects to be tested, the M forbidden objects to be tested cannot acquire a data calling instruction generated based on test parameters, and M is M-N; the target object to be measured determination sub-module is further configured to use the N objects to be measured, excluding the m disabled objects to be measured, as target objects to be measured.
As an alternative embodiment, the second processing module includes a second test result determining sub-module, configured to determine that the test result of the object set to be tested passes when the test result for each target object to be tested indicates passing.
Alternatively, at least part of the functions of any of the modules, sub-modules, or any of the modules in the obtaining module 601, the first processing module 602, the testing module 603, and the second processing module 604 may be implemented in one module. Any one or more of the modules according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules according to the embodiments of the present disclosure may be implemented at least in part 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 may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging the circuit, or in any one of three implementations, or in any suitable combination of any of the software, hardware, and firmware. Or one or more of the modules according to embodiments of the disclosure, may be implemented at least partly as computer program modules which, when executed, may perform corresponding functions.
For example, any number of the obtaining module 601, the first processing module 602, the testing module 603, and the second processing module 604 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. Alternatively, at least one of the obtaining module 601, the first processing module 602, the testing module 603, and the second processing module 604 may 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 may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented by any one of or a suitable combination of software, hardware, and firmware. Alternatively, at least one of the obtaining module 601, the first processing module 602, the testing module 603 and the second processing module 604 may be at least partly implemented as a computer program module, which when executed may perform a corresponding function.
FIG. 7 schematically illustrates a block diagram of an electronic device suitable for implementing automated testing methods and apparatus according to an embodiment of the present disclosure. The computer system illustrated in FIG. 7 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 7, a computer system 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 703, various programs and data necessary for the operation of the system 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. The processor 701 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. It is noted that the programs may also be stored in one or more memories other than the ROM 702 and RAM 703. The processor 701 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Optionally, the system 700 may also include an input/output (I/O) interface 705, the input/output (I/O) interface 705 also being connected to the bus 704. The system 700 may also include one or more of the following components connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. 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, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
Alternatively, the method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the processor 701, performs the above-described functions defined in the system of the embodiment of the present disclosure. Alternatively, the systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
Alternatively, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may optionally include one or more memories other than the ROM 702 and/or RAM 703 and/or ROM 702 and RAM 703 described above.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. An automatic test method is applied to a test platform and comprises the following steps:
acquiring test parameters for testing an object to be tested;
determining N target objects to be tested in M objects to be tested in an object set to be tested, wherein M, N is a positive integer, and N is less than M;
testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested;
and determining the test result of the object set to be tested according to the test result of each target object to be tested.
2. The method of claim 1, wherein the obtaining test parameters for testing an object to be tested comprises:
sending a parameter acquisition request to a service operation system;
and receiving a test parameter returned by the service operation system based on the parameter acquisition request, wherein the test parameter comprises at least one of a service configuration parameter, an interface parameter and a test method.
3. The method of claim 1, wherein the determining N target objects to be tested among the M objects to be tested in the set of objects to be tested comprises:
sending an election triggering instruction to each object to be tested in the M objects to be tested so as to enable at least part of the M objects to be tested to carry out election aiming at a main object to be tested;
and when the number of the objects to be detected participating in the election reaches N, taking the N objects to be detected participating in the election as the target objects to be detected, wherein N is more than M/2.
4. The method of claim 1, wherein the testing N target objects to be tested by using the test parameters to obtain a test result for each target object to be tested comprises:
generating a data calling instruction according to the test parameters;
sending the data calling instruction to N target objects to be detected to obtain response data returned by each target object to be detected;
and comparing the response data returned by each target object to be tested with the standard response data to obtain a test result aiming at each target object to be tested.
5. The method of claim 4, wherein the standard response data is obtained by a method comprising:
sending the data calling instruction to a preset reference object to be tested;
and receiving the standard response data returned by the reference object to be tested.
6. The method of claim 2, wherein the receiving of the test parameter returned by the service operation system based on the parameter acquisition request comprises:
receiving the test parameters returned by the service operation system through a message queue;
among the M objects to be tested in the object set to be tested, N target objects to be tested for testing are determined, and the method comprises the following steps:
setting M forbidden objects to be tested by using the message queue, wherein the M forbidden objects to be tested cannot acquire a data calling instruction generated based on the test parameters, and M is M-N;
and taking N objects to be tested except the m forbidden objects to be tested as N target objects to be tested.
7. The method of any of claims 1 to 6, wherein said determining test results for the set of objects under test from the test results for each of the target objects under test comprises:
and when the test result indication for each target object to be tested passes, determining that the test result of the object set to be tested passes.
8. An automated test apparatus, comprising:
the acquisition module is used for acquiring test parameters for testing an object to be tested;
the first processing module is used for determining N target objects to be tested in M objects to be tested in the object set to be tested, wherein M, N is a positive integer, and N is less than M;
the test module is used for testing the N target objects to be tested by using the test parameters to obtain a test result aiming at each target object to be tested;
and the second processing module is used for determining the test result of the object set to be tested according to the test result of each target object to be tested.
9. An electronic device, comprising:
one or more processors; and
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 7.
CN202011028887.7A 2020-09-25 2020-09-25 Automatic testing method and device Pending CN113760708A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011028887.7A CN113760708A (en) 2020-09-25 2020-09-25 Automatic testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011028887.7A CN113760708A (en) 2020-09-25 2020-09-25 Automatic testing method and device

Publications (1)

Publication Number Publication Date
CN113760708A true CN113760708A (en) 2021-12-07

Family

ID=78785788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011028887.7A Pending CN113760708A (en) 2020-09-25 2020-09-25 Automatic testing method and device

Country Status (1)

Country Link
CN (1) CN113760708A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250291A (en) * 2022-07-28 2022-10-28 中国银行股份有限公司 Parameter data verification method, device and equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090007072A1 (en) * 2007-06-29 2009-01-01 Microsoft Corporation Test framework for automating multi-step and multi-machine electronic calendaring application test cases
CN108647141A (en) * 2018-04-26 2018-10-12 腾讯科技(深圳)有限公司 Automatic test approach, device, computer-readable medium and electronic equipment
CN109976997A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 Test method and device
WO2020119434A1 (en) * 2018-12-15 2020-06-18 深圳壹账通智能科技有限公司 Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090007072A1 (en) * 2007-06-29 2009-01-01 Microsoft Corporation Test framework for automating multi-step and multi-machine electronic calendaring application test cases
CN109976997A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 Test method and device
CN108647141A (en) * 2018-04-26 2018-10-12 腾讯科技(深圳)有限公司 Automatic test approach, device, computer-readable medium and electronic equipment
WO2020119434A1 (en) * 2018-12-15 2020-06-18 深圳壹账通智能科技有限公司 Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250291A (en) * 2022-07-28 2022-10-28 中国银行股份有限公司 Parameter data verification method, device and equipment and readable storage medium
CN115250291B (en) * 2022-07-28 2024-03-22 中国银行股份有限公司 Parameter data verification method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN108521353B (en) Processing method and device for positioning performance bottleneck and readable storage medium
CN108762907B (en) Task processing method and system based on multiple clients
CN108804215B (en) Task processing method and device and electronic equipment
CN109710624B (en) Data processing method, device, medium and electronic equipment
CN113760708A (en) Automatic testing method and device
CN110417597B (en) Method and device for monitoring certificate, electronic equipment and readable storage medium
CN116701123A (en) Task early warning method, device, equipment, medium and program product
CN110955597B (en) Object testing method and device, electronic equipment and computer readable storage medium
CN113127363B (en) Parameter adjustment method, parameter adjustment device, electronic device, and readable storage medium
CN113656313A (en) Automatic test processing method and device
CN110737572B (en) Big data platform resource preemption test method, system, terminal and storage medium
CN113127082A (en) Data processing method, server, service node, system and storage medium
CN113127362A (en) Object testing method, object testing device, electronic device, and readable storage medium
CN112988339A (en) Data management method and device
CN112445597A (en) Timing task scheduling method and device
CN113297053A (en) Method and device for determining test coverage rate and storage medium
CN111581042A (en) Cluster deployment method, deployment platform and server to be deployed
CN111726418B (en) Cloud resource allocation method and device, terminal equipment and storage medium
CN111694556A (en) Verification method and system, computer system and medium
CN114666256B (en) Gray scale test method, device, equipment and medium
CN112650687B (en) Method, device, equipment and medium for testing execution priority of engine scheduling action
CN117290113B (en) Task processing method, device, system and storage medium
US11061745B2 (en) Shared resource analysis for embedded multi-core systems
CN114356993A (en) Data processing method, data processing apparatus, computer system, and storage medium
CN116561018A (en) Service system counting method, device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination