Use Case Concurrent Execution Scheduling Method, System, Device and Medium for a Single Execution Machine
By setting up multiple concurrent time windows on a single executor and using the time windows to match and combine them with the use cases, the use case serial execution problem caused by limited executor resources is solved, and the parallel execution of use cases is realized, which improves execution efficiency and saves hardware resources.
Patent Information
- Application Number
- CN202211021024.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-08-24
AI Technical Summary
Due to the limited environmental resources of the executor, multiple projects can only be executed serially when they are executed concurrently, resulting in inefficient use cases.
By setting up multiple concurrency time windows on a single executor, using the time windows to match and combine them with the use cases, determining the concurrency order and execution order of the use cases, and realizing parallel execution of the use cases.
Improve the execution efficiency of automated use cases, shorten execution time, and save the hardware resources of the executor.
Smart Images

Figure CN115373993B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically to a method, system, device and medium for concurrent execution scheduling of use cases on a single execution machine. Background Art
[0002] A test case is a description of the test tasks for a specific software product, reflecting the test plan, methods, techniques and strategies. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. A test case is a set of test inputs, execution conditions and expected results compiled for a specific purpose, used to verify whether a specific software requirement is met. A test case is a scientific organization and induction of the behavior activities of software testing, aiming to transform the behavior of software testing into a manageable mode; at the same time, a test case is also one of the methods to specifically quantify testing, and test cases are different for different types of software.
[0003] Currently, the scale of stored baseline automated test cases has reached more than 3000. However, due to limited environmental resources of the execution machine and multi-project concurrency, there is no extra execution machine to be allocated to each set of environments, resulting in serial execution of test cases during execution, consuming a large amount of test case execution time and affecting the test case execution efficiency. Summary of the Invention
[0004] Aiming at the above problems, the purpose of the present invention is to provide a method, system, device and medium for concurrent execution scheduling of use cases on a single execution machine, which can automatically schedule use cases concurrently when there is one execution machine, realizing parallel execution of multiple use cases without interference, saving the test case execution time and improving the test case execution efficiency.
[0005] To achieve the above object, the present invention is realized through the following technical solutions: A method for concurrent execution scheduling of use cases on a single execution machine, comprising:
[0006] Running all test cases serially, recording the execution time of each test case and the test case module name, and setting the default value of the parallel tag of each test case to 0;
[0007] After all test cases are executed, classify the test cases by module and sort them by execution time;
[0008] Select a preset proportion of test cases from the sorted all test cases, calculate the reference execution time of the test cases according to a preset algorithm, and use it as the time window;
[0009] Match the time window with all test cases, update the tag of each test case, and determine the concurrent order and execution order of relevant test cases according to the matching result;
[0010] Adjust the duration of the time window repeatedly. After each adjustment, use the time window to match the test cases that were not successfully matched before, and update the tags of the corresponding test cases. Determine the concurrency order and execution order of the relevant test cases according to the matching results until all test cases are matched;
[0011] Generate the concurrency order and execution order of all test cases according to the matching results;
[0012] Execute the test cases on a single execution machine according to the concurrency order and execution order of all test cases.
[0013] Further, taking out a preset proportion of test cases from the sorted all test cases, calculating the reference execution time of the test cases according to a preset algorithm, and using it as the time window, including:
[0014] Take out the middle 60% of the test cases from the all test cases sorted by execution time, calculate the average execution time of the selected test cases, and round up the average execution time to minutes, denoted as the reference execution time T of the test cases. Use T as the time window.
[0015] Further, using the time window to match with all test cases and update the tag of each test case, including:
[0016] Set the concurrency number to N, and randomly select test cases by module according to preset conditions within N parallel time windows; the preset conditions include: the total execution duration of the test cases configured in each time window is less than or equal to T, and the test cases of the same module are not run in different time windows at the same running time;
[0017] Execute the test cases in N time windows in parallel. If the test passes, set the tag of the test case to 1, and record the test case ID, window ID, and the longest execution time among the test cases in N time windows as the window time in the storage; if the test fails, replace the test case with other test cases with a matchable duration in a different module; repeat the execution until the test passes, set the tag of the test case that passes the test to 1, set the tag of the replaced test case to 2, and record it in the storage.
[0018] Further, using the time window to match with all test cases and update the tag of each test case, further includes:
[0019] If the test cases with tag 2 are not successfully matched after W times of matching, set the tag of the corresponding test case to 3.
[0020] Further, the repeatedly adjusting the duration of the time window, and after each adjustment, using the time window to match the test cases that were not successfully matched before, includes:
[0021] For use cases with an execution duration greater than T, set the time window to the ceiling of the execution duration of the use case, and use this time window to match the use case.
[0022] Further, the method of repeatedly adjusting the duration of the time window and, after each adjustment, using the time window to match the use cases that have not been successfully matched before includes:
[0023] If there are use cases that have not been successfully matched and the tag of the use case < 2, increase the duration of the time window by 1 minute and continue to match with the use cases.
[0024] Further, the method further includes:
[0025] After all use cases are matched, set the use cases with a tag value greater than or equal to 2 to be executed serially.
[0026] Correspondingly, the present invention also discloses a use case concurrent execution scheduling system for a single execution machine, including: an initialization module for serially running all use cases, recording the execution time of each use case and the use case module name, and setting the default value of the parallel tag of each use case to 0;
[0027] A sorting module for classifying use cases by module and sorting them by execution time after all use cases are executed; a time window setting module for extracting a preset proportion of use cases from the sorted all use cases, calculating the reference execution time of the use cases according to a preset algorithm, and using it as the time window;
[0028] A first matching module for using the time window to match all use cases, updating the tag of each use case, and determining the concurrent order and execution order of relevant use cases according to the matching result;
[0029] A second matching module for repeatedly adjusting the duration of the time window and, after each adjustment, using the time window to match the use cases that have not been successfully matched before, updating the tag of the corresponding use case, and determining the concurrent order and execution order of relevant use cases according to the matching result until all use cases are matched;
[0030] An execution policy generation module for generating the concurrent order and execution order of all use cases according to the matching result; an execution module for executing use cases on a single execution machine according to the concurrent order and execution order of all use cases.
[0031] Correspondingly, the present invention discloses a use case concurrent execution scheduling device for a single execution machine, including:
[0032] A memory for storing a use case concurrent execution scheduling program for a single execution machine;
[0033] A processor, which is used to implement the steps of the use case concurrent execution scheduling method of the single execution machine as described in any one of the above when executing the use case concurrent execution scheduler of the single execution machine.
[0034] Correspondingly, the present invention discloses a readable storage medium, on which a use case concurrent execution scheduler of a single execution machine is stored. When the use case concurrent execution scheduler of the single execution machine is executed by a processor, the steps of the use case concurrent execution scheduling method of the single execution machine as described in any one of the above are implemented.
[0035] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention discloses a use case concurrent execution scheduling method, system, device and medium for a single execution machine. By setting multiple concurrent time windows, the use cases are matched and combined by using the time windows, and the concurrent order and execution order of the use cases are determined according to the matching results, so as to realize the non-interfering concurrent execution of the use cases. The execution efficiency of the automated use cases is improved, the execution time is shortened, and the hardware resources of the execution machine are saved.
[0036] It can be seen that compared with the prior art, the present invention has prominent substantive features and significant progress, and the beneficial effects of its implementation are also obvious. Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0038] Figure 1 It is a flowchart of the method in the specific implementation manner of the present invention.
[0039] Figure 2 It is a system structure diagram of the specific implementation manner of the present invention.
[0040] In the figure, 1 is an initialization module; 2 is a sorting module; 3 is a time window setting module; 4 is a first matching module; 5 is a second matching module; 6 is an execution strategy generation module; 7 is an execution module. Specific Embodiments
[0041] The core of the present invention is to provide a use case concurrent execution scheduling method for a single execution machine. In the prior art, the scale of the stored baseline automated use cases has reached more than 3,000. However, due to the limited environmental resources of the execution machine and the multi-project concurrency, there is no extra execution machine to be allocated to each set of environments. As a result, the use cases can only be executed serially during execution, consuming a large amount of use case execution time and affecting the use case execution efficiency.
[0042] The use case concurrent execution scheduling method for a single execution machine provided by the present invention first serially runs all use cases, records the execution time of each use case and the use case module name, and sets the default value of the parallel tag of each use case to 0. After all use cases are executed, the use cases are classified by module and sorted by execution time. Then, a preset proportion of use cases are taken out from the sorted all use cases, and the reference execution time of the use cases is calculated according to a preset algorithm and used as the time window. At this time, the time window is matched with all use cases, and the tag of each use case is updated. According to the matching result, the concurrent order and execution order of relevant use cases are determined. For the use cases that fail to match, the duration of the time window is repeatedly adjusted and matched until all use cases are successfully matched, and the concurrent order and execution order of all use cases are generated. Finally, the use cases are executed on a single execution machine according to the concurrent order and execution order of all use cases. It can be seen that the present invention can automatically schedule use cases concurrently when there is one execution machine, realizes the parallel execution of multiple use cases without interference, saves the use case execution time, and improves the use case execution efficiency.
[0043] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0044] Embodiment 1:
[0045] As Figure 1 shown, this embodiment provides a use case concurrent execution scheduling method for a single execution machine, including the following steps:
[0046] S1: Serially run all use cases, record the execution time of each use case and the use case module name, and set the default value of the parallel tag of each use case to 0.
[0047] S2: After all use cases are executed, classify the use cases by module and sort them by execution time.
[0048] S3: Take out a preset proportion of use cases from the sorted all use cases, calculate the reference execution time of the use cases according to a preset algorithm, and use it as the time window.
[0049] Specifically, take out 60% of the all use cases sorted by execution time, calculate the average execution time of the taken use cases, and round up the average execution time to minutes, denoted as the reference execution time T of the use cases, and use T as the time window.
[0050] As an example, for all cases sorted by execution time, take the middle 60% of the cases, calculate the average execution time of the selected cases as 5 minutes and 12 seconds, and round up to 6 minutes as the "time window".
[0051] S4: Match the time window with all cases, update the tag of each case, and determine the concurrency order and execution order of relevant cases according to the matching result.
[0052] This step specifically includes:
[0053] First, set the concurrency number to N, and randomly select cases by module within N parallel time windows according to preset conditions; the preset conditions include: the total execution duration of the cases configured in each time window is less than or equal to T, and the same module cases are not run in different time windows at the same running time.
[0054] Then, execute the cases in N time windows in parallel. If the test passes, set the case tag to 1, and record the case ID, window ID, and the longest execution time among the N time window cases as the window time in the storage; if the test fails, replace the case with other cases with a matchable duration in a different module; repeat the execution until the execution passes, set the tag of the passed test case to 1, set the tag of the replaced case to 2, and record it in the storage. If the case with tag 2 fails to match successfully after W times of matching, set the tag of the corresponding case to 3.
[0055] As an example:
[0056] First, set the concurrency number to 3, and randomly select case IDs by module within 3 parallel time windows. For example: Time window 1 configures 2 cases, time window 2 configures 1 case, time window 3 configures 3 cases, the total execution duration of the cases configured in each time window is less than 6 minutes, and it meets the condition that the same module cases are not run in different windows at the same running time.
[0057] Then, execute the cases of the 3 window modules in parallel. If the test passes, set the case tag to 1, and record the case ID, window ID, and the longest execution time among the 3 window cases as the window time in the storage. If the test fails, replace it with other cases with a matchable duration in a different module; repeat the execution until the execution passes, set the case tag to 1, set the tag of the replaced case to 2, and record it in the storage as in the previous step.
[0058] However, if the case with tag 2 fails to match successfully after 5 times of matching, set the tag of the corresponding case to 3.
[0059] S5: Repeatedly adjust the duration of the time window. After each adjustment, use the time window to match with the test cases that have not been successfully matched before, and update the tags of the corresponding test cases. Determine the concurrency order and execution order of the relevant test cases according to the matching results until all test cases are successfully matched.
[0060] Specifically:
[0061] For a test case with an execution duration greater than T, set the time length obtained by rounding up the execution duration of this test case as the time window, and use this time window to match with this test case. That is, update the duration of the time window, and repeat step S4 to perform test case matching.
[0062] If there are still test cases that have not been successfully matched at this time, and the tag of the test case < 2, increase the duration of the time window by 1 minute, and repeat step S4 to perform test case matching. If it is still not successfully matched, continue to increase the duration of the time window by 1 minute and then try to match. Until all test cases are successfully matched.
[0063] It should be particularly noted that after the matching is completed, the test cases with a tag number greater than or equal to 2 are set to be executed serially according to the strategy. If there are incremental test cases, the strategy can be set to match with the serial test cases, or perform a full-scale match, and the matching method is the same as steps S1 - S5.
[0064] S6: Generate the concurrency order and execution order of all test cases according to the matching results.
[0065] S7: Execute the test cases on a single execution machine according to the concurrency order and execution order of all test cases.
[0066] This embodiment provides a method for scheduling the concurrent execution of test cases on a single execution machine. By setting multiple concurrent time windows, using the time windows to match and combine the test cases, and determining the concurrency order and execution order of the test cases according to the matching results, the concurrent and non-interfering execution of test cases is achieved. It improves the execution efficiency of automated test cases, shortens the execution time, solves the problem of test case coupling, and saves the hardware resources of the execution machine.
[0067] Embodiment Two:
[0068] Based on Embodiment One, as Figure 2 shown, the present invention also discloses a system for scheduling the concurrent execution of test cases on a single execution machine, including: an initialization module 1, a sorting module 2, a time window setting module 3, a first matching module 4, a second matching module 5, an execution strategy generation module 6, and an execution module 7.
[0069] The initialization module 1 is used to serially run all test cases, record the execution time of each test case and the name of the test case module, and set the default value of the parallel tag of each test case to 0.
[0070] The sorting module 2 is used to classify the test cases by module and sort them by execution time after all test cases are executed.
[0071] The time window setting module 3 is used to extract a preset proportion of test cases from the sorted full set of test cases, calculate the reference execution time of the test cases according to a preset algorithm, and use it as the time window. Specifically, the time window setting module 3 is used to: extract the middle 60% of the test cases from the full set of test cases sorted by execution time, calculate the average execution time of the extracted test cases, and round up the average execution time to minutes, which is recorded as the reference execution time T of the test cases, and use T as the time window.
[0072] The first matching module 4 is used to match the time window with the full set of test cases, update the tag of each test case, and determine the concurrent order and execution order of the relevant test cases according to the matching results. Specifically, the first matching module 4 is used to: set the number of concurrency to N, randomly select test cases by module according to preset conditions within N parallel time windows; the preset conditions include: the total execution duration of the test cases configured in each time window is less than or equal to T, and the same module test cases are not run in different time windows at the same running time; execute the test cases in N time windows in parallel. If the test passes, set the test case tag to 1, and record the test case ID, window ID, and the longest execution time among the N time window test cases as the window time in the storage; if the test fails, replace the test case with other test cases with a matchable duration in a different module; repeat the execution until the test passes, set the tag of the test case that passes the test to 1, set the tag of the replaced test case to 2, and record it in the storage. If the test case with tag 2 fails to match successfully after W times of matching, the tag of the corresponding test case will be set to 3.
[0073] The second matching module 5 is used to repeatedly adjust the duration of the time window. After each adjustment, use the time window to match the test cases that have not been successfully matched before, update the tags of the corresponding test cases, and determine the concurrent order and execution order of the relevant test cases according to the matching results until all test cases are matched. Specifically, the second matching module 5 is used to: for test cases with an execution duration greater than T, set the time window to the time length obtained by rounding up the execution duration of the test case, and use this time window to match the test case. If there are test cases that have not been successfully matched and the tag of the test case < 2, increase the duration of the time window by 1 minute and continue to match with the test case.
[0074] The execution strategy generation module 6 is used to generate the concurrent order and execution order of the full set of test cases according to the matching results.
[0075] The execution module 7 is used to execute the test cases on a single execution machine according to the concurrent order and execution order of the full set of test cases.
[0076] This embodiment provides a use case concurrent execution scheduling system for a single execution machine. By setting multiple concurrent time windows, the use cases are matched and combined using the time windows, and the concurrent order and execution order of the use cases are determined according to the matching results, so as to achieve non-interfering concurrent execution of the use cases. This improves the execution efficiency of automated use cases, shortens the execution time, solves the problem of use case coupling, and saves the hardware resources of the execution machine.
[0077] Embodiment 3:
[0078] This embodiment discloses a use case concurrent execution scheduling device for a single execution machine, including a processor and a memory; wherein, when the processor executes the use case concurrent execution scheduling program stored in the memory, the following steps are implemented:
[0079] 1. Run all use cases serially, record the execution time of each use case and the use case module name, and set the default value of the parallel tag of each use case to 0.
[0080] 2. After all use cases are executed, classify the use cases by module and sort them by execution time.
[0081] 3. Select a preset proportion of use cases from the sorted all use cases, calculate the reference execution time of the use cases according to a preset algorithm, and use it as the time window.
[0082] 4. Use the time window to match with all use cases, and update the tag of each use case. Determine the concurrent order and execution order of relevant use cases according to the matching results.
[0083] 5. Repeatedly adjust the duration of the time window. After each adjustment, use the time window to match with the use cases that have not been successfully matched before, and update the tags of the corresponding use cases. Determine the concurrent order and execution order of relevant use cases according to the matching results until all use cases are matched.
[0084] 6. Generate the concurrent order and execution order of all use cases according to the matching results.
[0085] 7. Execute the use cases on the single execution machine according to the concurrent order and execution order of all use cases.
[0086] Furthermore, the use case concurrent execution scheduling device for a single execution machine in this embodiment may further include:
[0087] An input interface, which is used to obtain the use case concurrent execution scheduler of a single execution machine imported from the outside world, save the obtained use case concurrent execution scheduler of the single execution machine in the memory, and can also be used to obtain various instructions and parameters transmitted by an external terminal device and transmit them to the processor, so that the processor can perform corresponding processing using the above various instructions and parameters. In this embodiment, the input interface may specifically include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, etc.
[0088] An output interface, which is used to output various data generated by the processor to a terminal device connected thereto, so that other terminal devices connected to the output interface can obtain various data generated by the processor. In this embodiment, the output interface may specifically include, but is not limited to, a USB interface, a serial interface, etc.
[0089] A communication unit, which is used to establish a remote communication connection between the use case concurrent execution scheduling device of a single execution machine and an external server, so that the use case concurrent execution scheduling device of the single execution machine can mount an image file to the external server. In this embodiment, the communication unit may specifically include, but is not limited to, a remote communication unit based on wireless communication technology or wired communication technology.
[0090] A keyboard, which is used to obtain various parameter data or instructions input by the user by tapping the key caps in real time.
[0091] A display, which is used to display in real time the relevant information of the short-circuit location process of the server power supply line.
[0092] A mouse, which can be used to assist the user in inputting data and simplify the user's operation.
[0093] Embodiment 4:
[0094] This embodiment also discloses a readable storage medium. The readable storage medium here includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium well-known in the technical field. The use case concurrent execution scheduler of a single execution machine is stored in the readable storage medium. When the use case concurrent execution scheduler of the single execution machine is executed by the processor, the following steps are implemented:
[0095] 1. Serially run all use cases, record the execution time of each use case and the use case module name, and set the default value of the parallel tag of each use case to 0.
[0096] 2. After all use cases are executed, classify the use cases by module and sort them by execution time.
[0097] 3. Take out a preset proportion of test cases from the sorted full set of test cases, calculate the reference execution time of the test cases according to a preset algorithm, and use it as the time window.
[0098] 4. Use the time window to match with the full set of test cases, and update the tag of each test case. Determine the concurrent order and execution order of relevant test cases according to the matching results.
[0099] 5. Repeatedly adjust the duration of the time window. After each adjustment, use the time window to match with the test cases that have not been successfully matched before, and update the tags of the corresponding test cases. Determine the concurrent order and execution order of relevant test cases according to the matching results until all test cases are matched.
[0100] 6. Generate the concurrent order and execution order of the full set of test cases according to the matching results.
[0101] 7. Execute the test cases on a single execution machine according to the concurrent order and execution order of the full set of test cases.
[0102] In summary, the present invention can automatically schedule test cases concurrently when there is one execution machine, realizing parallel execution of multiple test cases without interference, saving the test case execution time, and improving the test case execution efficiency.
[0103] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the methods disclosed in the embodiments, since they correspond to the systems disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part.
[0104] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0105] In several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of systems or units can be in electrical, mechanical or other forms.
[0106] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing unit, or each module can exist physically alone, or two or more modules can be integrated in a unit.
[0108] Similarly, in each embodiment of the present invention, the processing units can be integrated in a functional module, or each processing unit can exist physically, or two or more processing units can be integrated in a functional module.
[0109] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0110] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
[0111] The above has introduced in detail the use case concurrent execution scheduling method, system, device and readable storage medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A use case concurrent execution scheduling method for a single execution machine, characterized in that Including: Running all test cases serially, recording the execution time of each test case and the name of the test case module, and setting the default value of the parallel tag of each test case to 0; After all test cases are executed, classify the test cases by module and sort them by execution time; Select a preset proportion of test cases from the sorted all test cases, calculate the reference execution time of the test cases according to a preset algorithm, and use it as the time window; Match the time window with all test cases, update the tag of each test case, and determine the concurrent order and execution order of relevant test cases according to the matching result; Repeatedly adjust the duration of the time window. After each adjustment, match the time window with the test cases that have not been successfully matched before, update the tags of the corresponding test cases, and determine the concurrent order and execution order of relevant test cases according to the matching result until all test cases are successfully matched; Generate the concurrent order and execution order of all test cases according to the matching result; Execute test cases on a single execution machine according to the concurrent order and execution order of all test cases; The matching of the time window with all test cases and the update of the tag of each test case include: Set the number of concurrent executions to N, and randomly select test cases by module according to preset conditions within N parallel time windows; the preset conditions include: the total execution duration of the test cases configured in each time window is less than or equal to T, and different time windows do not run test cases of the same module at the same running time; Execute the test cases in N time windows in parallel. If the test passes, set the test case tag to 1, and record the test case ID, window ID, and the longest execution time among the test cases in N time windows as the window time; if the test fails, replace the test case with other test cases with a matching duration from a different module; repeat the execution until the test passes, set the tag of the test case that passes the test to 1, set the tag of the replaced test case to 2, and record it; 2. The use case concurrent execution scheduling method of a single execution machine according to claim 1, characterized in that, The selection of a preset proportion of test cases from the sorted all test cases, the calculation of the reference execution time of the test cases according to a preset algorithm, and the use of it as the time window include: Take out 60% of the middle test cases from the all test cases sorted by execution time, calculate the average execution time of the selected test cases, round up the average execution time to minutes, record it as the reference execution time T of the test cases, and use T as the time window; 3. The use case concurrent execution scheduling method of a single execution machine according to claim 1, wherein The matching of the time window with all test cases and the update of the tag of each test case further include: If the test case with tag 2 fails to be successfully matched after W times of matching, set the tag of the corresponding test case to 3; 4. The use case concurrent execution scheduling method for a single execution machine according to claim 3, characterized in that, The repeated adjustment of the duration of the time window, and after each adjustment, the matching of the time window with the test cases that have not been successfully matched before include: For test cases with an execution duration greater than T, set the time window to the rounded-up time length of the execution duration of the test case, and match this time window with the test case; 5. The use case concurrent execution scheduling method for a single execution machine according to claim 4, wherein The repeated adjustment of the duration of the time window, and after each adjustment, the matching of the time window with the test cases that have not been successfully matched before include: If there are test cases that have not been successfully matched and the tag of the test case < 2, increase the duration of the time window by 1 minute and continue to match with the test case; 6. The use case concurrent execution scheduling method for a single execution machine according to claim 5, characterized in that, The method further includes: After all use cases are successfully matched, set the use cases with tag values greater than or equal to 2 to be executed serially.
7. A use case concurrent execution scheduling system with a single execution machine, characterized in that, Including: An initialization module for serially running all use cases, recording the execution time of each use case and the name of the use case module, and setting the default parallel tag value of each use case to 0; A sorting module for classifying use cases by module and sorting them by execution time after all use cases are executed; A time window setting module for extracting a preset proportion of use cases from the sorted all use cases, calculating the reference execution time of the use cases according to a preset algorithm, and using it as the time window; A first matching module for matching the time window with all use cases and updating the tag of each use case, and determining the concurrent order and execution order of relevant use cases according to the matching result; A second matching module for repeatedly adjusting the duration of the time window. After each adjustment, match the time window with the use cases that have not been successfully matched before, update the tags of the corresponding use cases, and determine the concurrent order and execution order of relevant use cases according to the matching result until all use cases are successfully matched; An execution strategy generation module for generating the concurrent order and execution order of all use cases according to the matching result; An execution module for executing use cases on a single execution machine according to the concurrent order and execution order of all use cases; The matching of the time window with all use cases and the updating of the tag of each use case include: Set the number of concurrent executions to N, and randomly select use cases by module according to preset conditions within N parallel time windows; the preset conditions include: the total execution duration of the use cases configured in each time window is less than or equal to T, and different time windows do not run use cases of the same module at the same running time; Execute the use cases in N time windows in parallel. If the test passes, set the use case tag to 1, and record the use case ID, window ID, and the longest execution time among the use cases in N time windows as the window time in storage; if the test fails, replace the use case with other use cases with a matching duration in a different module; repeat the execution until the test passes, set the tag of the use case that passes the test to 1, set the tag of the replaced use case to 2, and record it in storage.
8. A use case concurrent execution scheduling device with a single execution machine, characterized in that Including: A memory for storing the use case concurrent execution scheduler for a single execution machine; A processor for implementing the steps of the use case concurrent execution scheduling method for a single execution machine as described in any one of claims 1 to 6 when executing the use case concurrent execution scheduler for a single execution machine.
9. A readable storage medium, characterized in that: The readable storage medium stores a use case concurrent execution scheduler for a single execution machine. When the use case concurrent execution scheduler for a single execution machine is executed by a processor, it implements the steps of the use case concurrent execution scheduling method for a single execution machine as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Scheduling execution method, device and equipment of test cases and computer storage medium
CN107729234A
Test case execution method and system and test equipment
CN114691494A