Test case scheduling method and device, computer equipment and storage medium

By building and splitting the use case network, as well as reasonably allocating the execution machines and adopting appropriate calling strategies, the problem of inefficiency in use case management and scheduling in cloud computing tests is solved, and the effect of improving testing efficiency is achieved.

CN119576781AActive Publication Date: 2025-03-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411697961.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-07
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

In cloud computing testing, as the number of test cases increases, it is difficult for servers to effectively manage and schedule these use cases, resulting in inefficiency in testing.

Method used

By building a use case network, splitting it based on the root use case and the number of dependencies, obtaining the use case dependency set, use case tree set and use case diagram set, and allocating the execution machine according to the total execution time, and using different calling strategies to schedule each use case set.

Benefits of technology

This method can improve the execution efficiency of test cases, and reduce the test time of the use case network by reasonably allocating computing resources and optimizing the execution order of the use case.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576781A_ABST
    Figure CN119576781A_ABST
Patent Text Reader

Abstract

The invention relates to a test case scheduling method and device, computer equipment and a storage medium, and relates to the technical field of cloud computing testing. The method comprises the following steps: obtaining a dependency relationship among a plurality of use cases, and constructing a use case network based on the dependency relationship; based on root use cases in the use case network and the number of dependent use cases of each use case, splitting the use case network to obtain at least two use case sets of a use case independent set, a use case tree set and a use case graph set; the use cases in the use case tree set form a first use case tree, and the use cases in the use case graph set form a second use case tree; determining the total execution time corresponding to the use cases in each use case set, and determining an execution machine allocated to each use case set based on the total execution time; for each use case set, scheduling the use cases in the use case set through the corresponding execution machine and the calling strategy corresponding to the use case set; wherein different use case sets correspond to different calling strategies. By adopting the method, the test efficiency of the test case can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing testing, and in particular to a test case scheduling method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of cloud computing, a large number of enterprises have the need to migrate their businesses to the cloud. Before migrating to the cloud, test engineers are required to conduct full tests on the test cases to be migrated to the cloud, including multi-dimensional tests such as functional testing, performance testing, security testing, negative testing, and long-term stability testing. Test cases usually have dependencies. One test case depends on multiple test cases, and the test case is dependent on other test cases, thus forming a complex network structure.

[0003] As the number of application scenarios increases, the number of test cases increases. When a large number of test cases have similar dependencies, it becomes increasingly difficult for the server to manage and schedule the test cases. In the related art, the dependencies between test cases can be followed and the tests can be performed in sequence in the corresponding data structure. However, in the face of a large number of test cases, the number of execution machines and computing power are limited, and the testing time of the execution machines is long, resulting in insufficient testing efficiency for the test cases. Summary of the invention

[0004] Based on this, it is necessary to provide a test case scheduling method, device, computer equipment, computer-readable storage medium and computer program product that can improve test efficiency in response to the above technical problems.

[0005] In a first aspect, the present application provides a test case scheduling method. The method comprises:

[0006] Obtain dependency relationships between multiple use cases, and build a use case network based on the dependency relationships;

[0007] Based on the number of dependent use cases of the root use cases and each use case in the use case network, the use case network is split to obtain at least two use case sets including a use case non-dependency set, a use case tree set, and a use case diagram set; the number of dependent use cases of the use cases in the use case non-dependency set is 0, the use cases in the use case tree set constitute a first use case tree, the number of dependent use cases of the use cases in each first use case tree is greater than 0 and the number of root use cases is 1, the use cases in the use case diagram set constitute a second use case tree, the number of use case dependencies of the use cases in each second use case tree is greater than 0 and the number of root use cases is greater than or equal to 2;

[0008] Determine the total execution time corresponding to the use cases in each use case set, and determine the execution machine assigned to each use case set based on the total execution time;

[0009] For each use case set, the use cases in the use case set are scheduled through the corresponding execution machine and the calling strategy corresponding to the use case set; wherein different use case sets correspond to different calling strategies.

[0010] In one of the embodiments, the use case network is split based on the number of dependent use cases of the root use case and each use case in the use case network to obtain at least two use case sets of use case non-dependency set, use case tree set and use case diagram set, including:

[0011] Traversing each use case of the use case network, and determining the number of root use cases and dependent use cases corresponding to each use case;

[0012] Determine that each use case that meets the first judgment condition is a use case non-dependency set; the first judgment condition is that the number of dependent use cases of the use case is 0, and the root use case is itself;

[0013] Determine that a plurality of first use case trees formed by use cases that meet a second judgment condition are a use case tree set; the second judgment condition is that the number of dependent use cases of a use case is greater than 0, and the root use case is a use case other than the use case itself; wherein the root use cases of the use cases in the same first use case tree are the same;

[0014] Determine that a plurality of second use case trees formed by use cases that satisfy a third judgment condition are a use case atlas; the third judgment condition is that the number of use case dependencies of the use case is greater than 0, and the root use case contains at least two use cases.

[0015] In one embodiment, determining the total execution time corresponding to the use cases in each use case set, and determining the execution machine assigned to each use case set based on the total execution time, includes:

[0016] Determine the sum of the execution time of each use case included in the use case non-dependency set, the use case tree set and the use case diagram set in the use case network, which is the total execution time corresponding to each use case set;

[0017] According to the proportion of the total execution time of each use case set in the total execution time corresponding to the use case network, the multiple execution machines to be allocated are allocated in proportion to obtain the execution machines allocated to each use case set.

[0018] In one embodiment, the second use case tree in the use case diagram set includes a root use case tree and a common use case tree; the method further includes:

[0019] For the use case diagram, by traversing the use cases of the second use case tree, a common root use case of each of the use cases is determined; the common root use case is used to represent the root node of the common use case tree split out of the branch to which the use case belongs;

[0020] Based on the common root use case of each of the use cases and each of the dependency relationships, split the second use case tree to obtain a root use case subtree and a common use case subtree;

[0021] Among them, the root use case corresponding to each use case in the root use case subtree is one use case; the root use case corresponding to each use case in the common use case subtree includes at least two use cases.

[0022] In one embodiment, the calling strategy of the use case non-dependency set includes a calling strategy with the shortest execution time, the calling strategy of the use case tree set includes a traversal strategy with the longest dependency duration first, and the calling strategy of the use case graph set includes a traversal strategy with the public use case dependency first;

[0023] For each use case set, scheduling the use cases in the use case set through the corresponding execution machine and the call strategy corresponding to the use case set includes:

[0024] For a use case non-dependency set, for each execution machine corresponding to the use case non-dependency set, assign the use cases in the use case non-dependency set to the execution machine with the shortest current execution time until all the use cases in the use case non-dependency set are executed;

[0025] For a use case tree set, in the order of the execution time of the first use case trees in the use case tree set, the first use case trees are allocated to the execution machines corresponding to the use case tree set until all the first use case trees in the use case tree set are executed;

[0026] When the execution machine corresponding to the use case tree set executes the branch node of the first use case tree, it executes the remaining branches of the first use case tree in the order of the execution time of the remaining branch nodes; the execution time of the remaining branch nodes is the sum of the execution time of the dependent use cases of the remaining branch nodes and the remaining branch nodes;

[0027] For the use case diagram set, the root use case subtree corresponding to the second use case tree in the use case diagram set is executed first, and then the common use case subtree corresponding to the second use case tree is executed;

[0028] Among them, for the root use case tree and the common use case tree, when the execution machine corresponding to the use case diagram executes the branch node of the second use case tree, it executes the branches inside the second use case tree in the order of the number of common root use cases of the remaining branch nodes.

[0029] In one embodiment, the method further comprises:

[0030] For a use case tree set, if an execution machine corresponding to the use case tree set is idle, prune the first use case tree according to the order of execution time of each remaining branch node of the first use case tree being executed in a non-idle execution machine to obtain a plurality of pruned branch trees;

[0031] The branch tree is executed by an idle execution machine.

[0032] In one embodiment, the method further comprises:

[0033] For the use case diagram set, if the execution machine corresponding to the use case diagram set is idle, the second use case tree is pruned according to the order of the number of common root use cases of the remaining branch nodes of the second use case tree being executed in the non-idle execution machine and the order of the execution time of the remaining branch nodes to obtain multiple pruned branch trees;

[0034] The branch tree is executed by an idle execution machine.

[0035] In a second aspect, the present application also provides a test case scheduling device. The device comprises:

[0036] A network construction module, used to obtain dependency relationships between multiple use cases and construct a use case network based on the dependency relationships;

[0037] A network splitting module, configured to split the use case network based on the number of dependent use cases of the root use case and each use case in the use case network, to obtain at least two use case sets of a use case non-dependency set, a use case tree set, and a use case diagram set; the number of dependent use cases of the use cases in the use case non-dependency set is 0, the use cases in the use case tree set constitute a first use case tree, the number of dependent use cases of the use cases in each first use case tree is greater than 0 and the number of root use cases is 1, the use cases in the use case diagram set constitute a second use case tree, the number of use case dependencies of the use cases in each second use case tree is greater than 0 and the number of root use cases is greater than or equal to 2;

[0038] A machine allocation module, used to determine the total execution time corresponding to the use cases in each use case set, and determine the execution machine allocated to each use case set based on the total execution time;

[0039] The use case scheduling module is used to schedule the use cases in each use case set through the corresponding execution machine and the calling strategy corresponding to the use case set; different use case sets correspond to different calling strategies.

[0040] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect are implemented.

[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0042] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0043] The test case scheduling method, device, computer equipment, storage medium and computer program product construct a use case network through the dependency relationship between use cases. And the use case network is split by the root use case in the use case network and the number of dependent use cases of each use case to obtain at least two use case sets of use case non-dependency set, use case tree set and use case graph set. The dependent use case data of the use case in the useless non-dependency set is 0, the use case tree set contains a first use case tree composed of multiple use cases, and the number of dependent use cases of the use case is greater than 0, and the number of root use cases is 1. The use case graph set contains a second use case tree composed of multiple use cases, and the number of dependent use cases of the use case is greater than 0, and the number of root use cases is greater than or equal to 2. Afterwards, the total execution time of each use case set is determined, and the execution machine corresponding to each use case set is determined according to the total execution time. For each use case set, the use cases in the use case set can be scheduled by the execution machine and the call strategy corresponding to the use case set. Since the use case network is split into use case sets with different structures, the complex use case network is split into multiple use case sets containing simple structures. And according to the total execution time corresponding to each use case set, the execution machine is assigned to the use case set, which can reasonably allocate computing resources and improve execution efficiency. Finally, the use cases of each use case set are executed in a targeted manner through calling strategies. The execution efficiency can also be optimized according to the data structure of different use case sets, thereby reducing the testing time of the use case network and improving the testing efficiency of the test cases. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 An application environment diagram of a test case scheduling method in an embodiment;

[0046] Figure 2 A schematic diagram of a flow chart of a test case scheduling method in an embodiment;

[0047] Figure 3A schematic diagram of a use case network in one embodiment;

[0048] Figure 4 A schematic diagram of using a network classification in one embodiment;

[0049] Figure 5 A schematic diagram of a root use case tree and a common use case tree in a use case diagram in an embodiment;

[0050] Figure 6 A schematic diagram of splitting a use case diagram into a root use case tree and a common use case tree in one embodiment;

[0051] Figure 7 A schematic diagram of a process of use case dependency management in one embodiment;

[0052] Figure 8 A schematic diagram of use case tree pruning in one embodiment;

[0053] Fig. 9 A structural block diagram of a test case scheduling device in an embodiment;

[0054] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0056] The test case scheduling method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 can obtain multiple use cases to be tested provided in the terminal 102, and establish a use case network based on the dependencies between the use cases. The server 104 splits the use case network through the root use case in the use case network and the dependent use case data of each use case, and obtains at least two use case sets in the use case non-dependency set, the use case tree set and the use case diagram set. The server 104 can calculate the total execution time corresponding to the use case non-dependency set, the use case tree set and the use case diagram set respectively, and determine the execution machine corresponding to each use case set according to the total execution time. For different use case sets, the server can select the corresponding call strategy through the execution machine, and schedule each use case in the use case set, thereby completing the scheduling of the use case network.

[0057] The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, and tablet computers. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0058] In an exemplary embodiment, Figure 2 As shown, a test case scheduling method is provided, which is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps S202 to S208. Among them:

[0059] Step S202, obtaining dependency relationships between multiple use cases, and constructing a use case network based on the dependency relationships.

[0060] The dependency relationship is used to represent the execution relationship between use cases. For example, the execution relationship may be that use case B needs to be executed before use case A, and use case A needs to be executed before use case C.

[0061] Specifically, the server can obtain the dependency relationship between each use case, and use the use case as a node and the dependency relationship as an edge to determine the use case network composed of each use case. Each use case can be represented by a number in the use case network. The use case network can be a non-fully connected network, and the use case network can contain multiple individual use case nodes, as well as a use case tree and a use case diagram composed of multiple use cases.

[0062] Step S204, based on the number of dependent use cases of the root use case and each use case in the use case network, split the use case network to obtain at least two use case sets of a use case non-dependency set, a use case tree set, and a use case diagram set.

[0063] Among them, the number of dependent use cases of the use cases in the use case no dependency set is 0, the use cases in the use case tree set constitute the first use case tree, the number of dependent use cases of the use cases in each first use case tree is greater than 0 and the number of root use cases is 1, and the use cases in the use case diagram set constitute the second use case tree, the number of use case dependencies of the use cases in each second use case tree is greater than 0 and the number of root use cases is greater than or equal to 2. The number of dependent use cases is used to indicate the number of dependent use cases that need to be executed before executing the use case.

[0064] Specifically, the server can determine the root use case in the use case network by traversal, and determine the amount of dependent use case data corresponding to each use case through dependency relationships. The server can determine that the use case with a dependent use case number of 0 is the root use case. The server can determine that the use case with a dependent use case number greater than 0 and a root use case number of 1 is a use case included in the first use case tree. The server can determine that the use case with a dependent use case number greater than 0 and a root use case number greater than or equal to 2 is a use case included in the second use case tree. Based on the root use cases and the number of dependent use cases of each use case, different use cases can be distinguished, and multiple use cases that can be split in the same data structure can be determined through the dependency relationships between the use cases, thereby completing the splitting of the use case network and obtaining at least two of the use case non-dependency set, the use case tree set, and the use case diagram set. The use case non-dependency set contains at least one root use case, the use case tree set contains at least one first use case tree, and the use case diagram set contains at least one second use case tree.

[0065] Step S206, determining the total execution time corresponding to the use cases in each use case set, and determining the execution machine assigned to each use case set based on the total execution time.

[0066] Among them, the execution machine can provide computing power and is used to execute each use case in the use case set.

[0067] Specifically, for each use case set, the server can obtain the execution time of each use case in the use case set, obtain the sum of the execution time of all use cases in the use case set, and determine it as the total execution time. The server can allocate a corresponding execution machine to each use case set based on the total execution time of different use case sets. Generally, the longer the total execution time, the more execution machines are allocated.

[0068] Step S208, for each use case set, scheduling the use cases in the use case set through the corresponding execution machine and the call strategy corresponding to the use case set.

[0069] Among them, different use case sets correspond to different calling strategies.

[0070] Specifically, the server can send the calling strategy of each use case set to the execution machine corresponding to the use case set. The execution machine can schedule each use case in the use case set, the first use case tree or the second use case tree through the calling strategy, thereby optimizing the execution order of the use cases, optimizing the execution order of each use case in the first use case tree, and optimizing the execution order of each use case in the second use case tree.

[0071] In the above test case scheduling method, a use case network is constructed through the dependency relationship between use cases. The use case network is split according to the root use case in the use case network and the number of dependent use cases of each use case, and at least two use case sets are obtained, namely, a use case non-dependency set, a use case tree set and a use case diagram set. The dependent use case data of the use case in the non-dependency set is 0, the use case tree set contains a first use case tree composed of multiple use cases, and the number of dependent use cases of the use case is greater than 0, and the number of root use cases is 1. The use case diagram set contains a second use case tree composed of multiple use cases, and the number of dependent use cases of the use case is greater than 0, and the number of root use cases is greater than or equal to 2. Afterwards, the total execution time of each use case set is determined, and the execution machine corresponding to each use case set is determined according to the total execution time. For each use case set, the use cases in the use case set can be scheduled by the execution machine and the call strategy corresponding to the use case set. Since the use case network is split into use case sets with different structures, the complex use case network is split into multiple use case sets containing simple structures. And according to the total execution time corresponding to each use case set, the execution machine is assigned to the use case set, which can reasonably allocate computing resources and improve execution efficiency. Finally, the use cases of each use case set are executed in a targeted manner through calling strategies. The execution efficiency can also be optimized according to the data structure of different use case sets, thereby reducing the testing time of the use case network and improving the testing efficiency of the test cases.

[0072] In an exemplary embodiment, the specific implementation process of the step of "splitting the use case network based on the number of dependent use cases of the root use case and each use case in the use case network to obtain at least two use case sets of use case non-dependency set, use case tree set and use case diagram set" includes:

[0073] Traverse each use case of the use case network, determine the number of root use cases and dependent use cases corresponding to each use case; determine each use case that meets the first judgment condition as a use case non-dependency set; determine multiple first use case trees composed of each use case that meets the second judgment condition as a use case tree set; wherein the root use cases of each use case in the same first use case tree are the same; determine multiple second use case trees composed of each use case that meets the third judgment condition as a use case diagram set;

[0074] The first judgment condition is that the number of dependent use cases of a use case is 0, and the root use case is itself. The second judgment condition is that the number of dependent use cases of a use case is greater than 0, and the root use case is a use case other than itself. The third judgment condition is that the number of use case dependencies of a use case is greater than 0, and the root use case contains at least two use cases.

[0075] Specifically, the server can traverse multiple use cases in the use case network, determine the root use case of each use case, and the number of dependent use cases. The server can determine whether each use case meets the first judgment condition, the second judgment condition, and the third judgment condition. When the first judgment condition is met, the use case is determined to be a use case in the use case non-dependency set, and the use case is added to the use case non-dependency set. When the second judgment condition is met, it is determined that the use case may be a component of the first use case tree or the second use case tree. When the third judgment condition is met, the use case is determined to be a component of the second use case tree. After traversing all the use cases, the judgment conditions satisfied by each use case can be determined. Based on this, the server can find multiple use cases that meet the same judgment conditions according to the dependency relationship between the use cases, and determine the corresponding use case trees, thereby determining the first use case tree or the second use case tree according to the number of root use cases corresponding to the use case tree. When all the use cases in the use case diagram are split, the use case non-dependency set composed of each root use case, the use case tree set composed of each first use case tree, and the use case diagram set composed of each second use case tree can be obtained.

[0076] In this embodiment, the use case network can be split into a use case non-dependency set, a use case tree set and a use case diagram set through the root use case of the use case, the root use case of the use case tree and the number of dependent use cases of each use case, so that each use case set in the use case diagram can be quickly determined, thereby improving the splitting efficiency of the use case diagram.

[0077] In an exemplary embodiment, the specific implementation process of the step of "determining the total execution time corresponding to the use cases in each use case set, and determining the execution machine assigned to each use case set based on the total execution time" includes:

[0078] The sum of the execution time of each use case included in the use case non-dependency set, use case tree set and use case diagram set in the use case network is determined separately as the total execution time corresponding to each use case set; according to the proportion of the total execution time of each use case set in the total execution time corresponding to the use case network, the multiple execution machines to be allocated are allocated in proportion to obtain the execution machines allocated to each use case set.

[0079] Specifically, the server determines the sum of the execution time of each use case included in the use case non-dependency set in the use case network for each use case set, and uses it as the total execution time corresponding to the use case non-dependency set. The server determines the sum of the execution time of the use cases included in each first use case tree in the use case tree set, and uses it as the total execution time corresponding to the use case tree set. The server determines the sum of the execution time of the use cases included in each second use case tree in the use case diagram set, and uses it as the total execution time corresponding to the use case diagram set. The server can sum the total execution time of the use case non-dependency set, the total execution time of the use case tree set, and the total execution time of the use case diagram set to obtain the total execution time of the use case network. And determine the proportion of the total execution time of the use case non-dependency set in the total execution time of the use case network, determine the proportion of the total execution time of the use case tree set in the total execution time of the use case network, and determine the proportion of the total execution time of the use case diagram set in the total execution time of the use case network. The server multiplies the number of allocable execution machines by the corresponding proportions above to obtain the number of execution machines allocated to the use case non-dependency set, the number of execution machines allocated to the use case tree set, and the number of execution machines allocated to the use case diagram set. Finally, we get the execution machines assigned to each use case set. Generally speaking, the computing power of the execution machines is the same.

[0080] In this embodiment, the corresponding number of execution machines can be allocated based on the proportion of the total execution time corresponding to the use case dependency-free set, use case tree set and use case diagram set, which can optimize the actual execution time of the execution machines and improve the scheduling efficiency of the use case network.

[0081] In an exemplary embodiment, the second use case tree in the use case diagram set includes a root use case middle tree and a common use case middle tree, and the method further includes:

[0082] For the use case diagram, the common root use case of each use case is determined by traversing the use cases of the second use case tree; based on the common root use case of each use case and each dependency, the second use case tree is split to obtain a root use case subtree and a common use case subtree.

[0083] Among them, the common root use case is used to represent the root node of the common use case subtree split out from the branch to which the use case belongs; the root use case corresponding to each use case in the root use case subtree is a use case; the root use case corresponding to each use case in the common use case subtree contains at least two use cases.

[0084] Specifically, for each second use case tree in the use case diagram, the server can determine the common root use case corresponding to the use cases of the second use case tree in the process of traversing the second use case tree. For example, when the server traverses to the root use case of use case A as 1, and the root use case of the next use case B of use case A also includes other root use cases 2 in addition to root use case 1, the other root use cases 2 are added to the common root use case of use case A. Among them, use case B is a node in the common use case middle tree. Based on this, the server can determine the common root use case of each use case in the second use case tree. If the number of common root use cases of two directly connected use cases is different, the two use cases can be split to obtain two subtrees in the second use case tree. Through the root use cases corresponding to the two subtrees, it can be determined whether the subtree is a common root use case subtree or a root use case subtree. The number of root use cases of each use case in the common root use case subtree is at least two. The number of root use cases in the root use case subtree is one.

[0085] In this embodiment, by traversing the use cases of the second use case tree in the use case diagram and defining the common root use case of the use cases, the second use case tree can be split into multiple subtrees, and based on the number of root use cases corresponding to each subtree, the subtree is determined to be a root use case subtree or a common use case subtree, so that the second use case tree can be accurately split and the complexity of the second use case tree can be reduced.

[0086] In an exemplary embodiment, the calling strategy of the use case non-dependency set includes the shortest execution time calling strategy, the calling strategy of the use case tree set includes the longest dependency time first traversal strategy, and the calling strategy of the use case graph set includes the public use case dependency first traversal strategy. The specific implementation process of the step "for each use case set, scheduling the use cases in the use case set through the corresponding execution machine and the calling strategy corresponding to the use case set" includes:

[0087] For the use case non-dependency set, for each execution machine corresponding to the use case non-dependency set, the use cases in the use case non-dependency set are assigned to the execution machine with the shortest current execution time until all the use cases in the use case non-dependency set are executed.

[0088] Specifically, for the calling strategy corresponding to the use case non-dependency set, the server can sort the use cases in the use case non-dependency set according to the size of the execution time, and give priority to assigning the use cases with longer execution times to the execution machines. During the execution process, the execution machine will be idle after executing the use cases. If there are idle execution machines, the server can determine the current execution time of each idle execution machine, and give priority to assigning the next use case to be executed to the execution machine with the shortest execution time, so that the current execution time of each execution machine is as close as possible. When all the use cases in the use case non-dependency set are executed, no more use cases will be assigned to the execution machine. The above execution process can be determined as the calling strategy with the shortest execution time.

[0089] For the use case tree set, the first use case trees in the use case tree set are allocated to the execution machines corresponding to the use case tree set in the order of their execution time until all the first use case trees in the use case tree set are executed.

[0090] Among them, when the execution machine corresponding to the use case tree set executes the branch node of the first use case tree, it executes the remaining branches of the first use case tree in the order of the execution time of the remaining branch nodes; the execution time of the remaining branch nodes is the sum of the execution time of the dependent use cases of the remaining branch nodes and the remaining branch nodes.

[0091] Specifically, for the calling strategy corresponding to the use case tree set, the server can sort the first use case trees in the use case tree set according to the size of the execution time, and give priority to allocating the first use case trees with large execution time to the execution machine. During the execution process, the execution machine will traverse and execute each use case in the first use case tree. When executing to the branch node of the first use case tree, the execution machine can determine the total execution time of the branch path corresponding to the remaining branch nodes that depend on the branch node, and execute the remaining branches corresponding to the remaining branch nodes in order of size, thereby completing the traversal of all branches of the first use case. When all the first use case trees in the use case tree set have been executed, the first use case tree will no longer be allocated to the execution machine. The above execution process can be determined as a traversal strategy with the longest dependency time first.

[0092] For the use case diagram set, the root use case subtree corresponding to the second use case tree in the use case diagram set is executed first, and then the common use case subtree corresponding to the second use case tree is executed.

[0093] Among them, for the root use case tree and the common use case tree, when the execution machine corresponding to the use case diagram executes the branch node of the second use case tree, it executes the branches inside the second use case tree in the order of the number of common root use cases of the remaining branch nodes.

[0094] Specifically, for the call strategy corresponding to the use case diagram set, the server can sort the second use case trees in the use case diagram set according to the execution time, and preferentially assign the second use case trees with large execution time to the execution machine. During the execution process, the execution machine will preferentially traverse the root use case tree in the second use case tree, and after the root use case tree is traversed, the common use case tree will be executed.

[0095] For each root use case tree, during the traversal of the root use case tree, when the execution machine executes to a branch node of the root use case tree, the number of common root use cases of the remaining branch nodes is determined, and the remaining branches within the root use case tree are executed in order of number, so that more important use cases can be executed first.

[0096] For each common use case tree, in the process of traversing the common use case tree, when the execution machine executes to a branch node of the common use case tree, the number of common root use cases of the remaining branch nodes is determined, and the remaining branches in the common root use case tree are executed in the order of the number. If the number of common root use cases of the remaining branch nodes is the same, the total execution time of the branch paths corresponding to the remaining branch nodes can be determined, and the remaining branches in the common root use case tree are executed in the order of the number.

[0097] When the second use case tree of the use case diagram is completely executed, the second use case tree is no longer assigned to the execution machine. The above execution process can be determined as a public use case dependency priority traversal strategy.

[0098] In this embodiment, by calling each use case in the strategy execution use case set with no dependency by the shortest execution time, by traversing the first use case trees in the strategy execution use case tree set with the longest dependency time first, and by traversing the second use case tree in the strategy execution use case graph set with the public use case dependency first, the execution time of the execution machine can be reduced and the execution efficiency of the test cases can be improved.

[0099] In an exemplary embodiment, the method further comprises:

[0100] For the use case tree set, if the execution machine corresponding to the use case tree set is idle, the first use case tree is pruned according to the order of the execution time of the remaining branch nodes of the first use case tree being executed in the non-idle execution machine to obtain multiple pruned branch trees; the branch trees are executed by the idle execution machine.

[0101] Specifically, when the execution machine corresponding to the use case tree set is idle, it means that there is no first use case tree that can be executed in the use case tree set. At this time, the first use case tree being executed in the non-idle execution machine can be pruned so that the idle execution machine can continue to execute the use case. Based on this, the server can determine the execution time of each remaining branch node of the first use case tree being executed, and prune the first use case tree according to the order of the execution time to obtain multiple branch trees after pruning. Branch trees with large execution times are preferentially sent to idle execution machines, so that the idle execution machines can continue to execute test cases.

[0102] In this embodiment, by pruning the first use case tree being executed, multiple execution machines can execute the same use case tree, thereby increasing the utilization rate of the execution machines and reducing the execution time.

[0103] In an exemplary embodiment, the method further comprises:

[0104] For the use case diagram set, if the execution machine corresponding to the use case diagram set is idle, the second use case tree is pruned according to the order of the number of common root use cases of each remaining branch node of the second use case tree being executed in the non-idle execution machine, and the order of the execution time of each remaining branch node, to obtain multiple pruned branch trees; the branch trees are executed by the idle execution machine.

[0105] Specifically, when the execution machine corresponding to the use case diagram is idle, it means that there is no second use case tree that can be executed in the use case diagram. At this time, the second use case tree being executed in the non-spatial execution machine can be pruned so that the idle execution machine can continue to execute the test case. Based on this, the server can determine the number of common root use cases of each remaining branch node of the second use case tree being executed, and prune the first use case tree according to the order of the number of common root use cases to obtain multiple branch trees after pruning. If the number of common root use cases of the remaining branch nodes is the same, the execution time of the remaining branch nodes can be determined, and pruned according to the order of the execution time. If the execution time of the remaining branch nodes is the same, pruning can be performed according to the order of the number of the remaining branch nodes.

[0106] In this embodiment, by pruning the second use case tree being executed, multiple execution machines can execute the same use case tree, thereby increasing the utilization rate of the execution machines and reducing the execution time.

[0107] The following describes in detail the specific execution process of the test case scheduling method in conjunction with a specific embodiment. The embodiment of the present application splits a complex use case network into multiple units with smaller granularity, and formulates different calling strategies according to different types of units, thereby decoupling use case dependencies, improving machine utilization, shortening the total use case execution time, and improving test efficiency.

[0108] The embodiment of the present application can be divided into two parts: use case dependency management and use case scheduling execution.

[0109] For use case dependency management, assume that there are A test case, first of all The use cases are numbered as follows: , and the The execution time of the use case is .

[0110] For Use cases, create a use case dependency set and the use case is dependent on the set And initialize it to an empty collection, create a variable and The total number of dependent use cases and the total duration of the dependent use cases are saved and initialized to 0 respectively. Contains the total duration of all directly dependent and indirectly dependent use cases.

[0111] Traverse in sequence Test case, for Use case, record all the use case numbers that the use case depends on and put them in , and record ; Traverse For all use cases in Middle Use case, Add to Through this step, the dependency relationship between use cases is established, that is, for any use case, the use cases it depends on and the use cases it is dependent on are clear. The dependency relationship between these use cases forms a complex use case network, such as Figure 3 As shown in the figure, a use case network is established by performing dependency analysis on 31 use cases. After that, the use case network is split into more fine-grained units to facilitate scheduling and execution on the execution machine.

[0112] Among them, the unit can be defined:

[0113] (1) For any use case ,if , then define the use case For the root use case, such as Figure 3 In the figure, 17, 20, and 7 are root use cases. (2) For any use case ,if If it is an empty set, define a use case For leaf cases, such as Figure 3 In the figure, 18, 26, etc. are leaf cases. (3) Definition For use cases The root use case set to which it belongs, such as Figure 3 As shown, the root use case set of 26 is 17.

[0114] Traverse all use cases to get all root use cases, and start from the root use case to perform depth-first traversal. If Leaf use case, then , if it is not a leaf case, , and add the root use case number to middle.

[0115] Through the above operations, the use cases in the use case network can be Divided into three categories: (1) Use cases without dependency sets : and Contains only ; All use cases can be executed without relying on other use cases. (2) Use cases belong to a tree, the use case tree : and contains only one non Each use case tree contains only one root use case, and except for the root use case, all other nodes depend on the execution of the parent node. (3) Use cases belong to a directed graph, namely the use case diagram. : and Contains at least two numbers; each use case diagram contains at least 2 root use cases, and except for the root use case, other use cases depend on the execution of the parent node.

[0116] The above three categories are shown in the following diagrams: Figure 4 Based on this, the use cases in the use case network can be divided into the above three categories.

[0117] The above three types of use cases need to be handled separately: (1) Sort all the use cases in the table by their execution time from largest to smallest; and record The sum of execution time of all use cases in .

[0118] (2) For All trees in , according to the root use case of each tree Sort from largest to smallest; assuming The root node set of the tree is ,but The sum of execution time of all use cases in .

[0119] (3) Definition The root use case set in the diagram is , the total duration of all use cases is ;for All the figures in Sort by size. The sum of the use case execution time of all graphs is .

[0120] In an exemplary embodiment, as the number of use cases increases and the dependencies between use cases become more and more complex, the directed graph divided as described above will be very large; at this time, if the use cases in the use case diagram are scheduled directly, the granularity is too large, which is not conducive to the scheduling and execution of the use cases; at this time, the use case diagram needs to be split into use case trees.

[0121] At this point, the use case diagram can be defined. In the use case diagram, the use cases contained in the tree with at least two root use cases as root nodes constitute the common use case tree (common root use case tree), and the root node of the common use case tree is the common tree root use case; the opposite is called the root use case tree (root use case tree); obviously, a use case diagram is completely composed of the common use case tree and the root use case tree, and their schematic diagram is as follows Figure 5 As shown, the use case diagram is split into two root use case trees and one common use case tree, and the number of common tree root use cases is 25. In the root use case tree, each use case node defines a common root use case set. , the public root use case set is used to save the root node of the public use case tree cut out from the branch to which the node belongs. Figure 5 As shown, the CR of 17, 19, and 24 is 25, and the CR of 20 and 21 is 25, but the CR of 18 and 26 is empty, and the CR of 23 is empty.

[0122] for The A graph is constructed, and each root use case is traversed in depth first until the leaf use case or the root use case set to which the use case belongs is found. Return and update if there are other root use cases ; In this way, the The diagram is split into multiple common use case trees and root use case trees. The cutting diagram is shown in the following figure. Figure 6 As shown. Obviously, the public tree root use case Must be smaller than the root use case , because the root use case In addition to the common tree root use case, it also includes nodes of other root use case trees.

[0123] Finally The tree sets cut from all graphs in the above example are sorted in the order of root use case tree first and public use case tree last. In the root use case tree and root public use case tree, the root node The order of the use case tree from large to small can ensure that the common use case tree is arranged after the root use case tree composed of the root use cases. The embodiment of the present application names this method as a method for splitting the use case tree of the use case diagram.

[0124] After the above graph cutting steps, all use case directed graphs are cut into orderly arranged trees. At this point, the use case network is cut into use case non-dependency sets. and the use case tree As well as the root use case tree and common use case tree in the figure. The entire use case dependency management process is as follows Figure 7 shown.

[0125] In an exemplary embodiment, for a use case scheduling execution, assume that there are Use case execution machines, numbered . No dependencies on use cases , Use Case Tree , Use Case Diagram The trees in the , , Machine.

[0126] For The use cases in are scheduled for execution according to the following strategy. The use cases in have no dependencies and are sorted in descending order of use case execution time. Among the machines, The total execution time of the use cases allocated on the machines is , then Middle Machine number assigned to each case , and update the The total execution time of the test cases on the machines .

[0127] Through the above method, The use cases in the example are allocated to each machine. Since each allocation is to allocate the use case to the machine with the least execution time, this can ensure In the embodiment of the present application, the method is named as the calling method with the shortest execution time of the use case without dependency set.

[0128] For The use cases in the use case tree are scheduled for execution according to the following strategies. All use case trees in the , are sorted to ensure that the trees with the longest time consumption are placed first. The use case trees are scheduled in order from large to small. Execute from the root node on each machine, exceeding The use case tree waits for the idle machine to be scheduled again, that is, the idle machine is given priority The use case tree in .

[0129] For the traversal of the use case tree, the traditional depth-first or breadth-first traversal is not used, but the longest-time-first traversal is used. Specifically, for any use case in the use case tree, when the use case is dependent on multiple use cases, that is, when there are multiple choices for the next use case to be executed, the root node of the remaining branch is selected. The largest branch traversal is executed. In the embodiment of the present application, this method is named the branch with the longest dependency time first traversal method.

[0130] In an exemplary embodiment, when a use case tree is large and takes a long time to execute, there may be a machine that is constantly executing the use cases in the use case tree, while other machines are idle, which is not conducive to the utilization of machine resources and the improvement of test efficiency. Therefore, when there is an idle machine, it is necessary to prune the use case tree being executed.

[0131] In an example, starting from the root node of a tree, the breadth-first traversal is performed. The use cases of the first node that appears are executed, and the nodes with unexecuted branches are called pruning nodes. Figure 8 As shown, assuming that use cases 7 and 10 have been completed and use case 14 is currently being executed, the pruned node is 7, and the unexecuted branches are the subtrees with 8 and 9 as root nodes.

[0132] The strategy for pruning calls is as follows: Assuming there is If there are idle machines, start from the first use case tree (the use case tree that takes the longest time) and traverse the tree in breadth first to find the pruning node. Sort by large to small and prune. If If they are the same, they are pruned according to the order of the branch root node numbers and dispatched to Execute on machines; if the number of unexecuted branches is greater than , then pruning is suspended and pruning is called again when a machine is idle; if the number of unexecuted branches is less than , then the above pruning call is executed from the second use case tree. Obviously, through the pruning call strategy, the machine can be fully utilized to shorten the total execution time of all use cases in. In the embodiment of the present application, this method is named as the use case pruning call method.

[0133] For use case diagrams The cut tree use cases are scheduled and executed according to the following strategy. Use case diagram The split use case trees have been sorted before, and the sorting rules can ensure that the public use case trees are always sorted after the corresponding root use case trees. Execute on the machine; if the number of unexecuted root use case trees is greater than , the remaining root use case trees are waiting for idle machines to schedule execution, and the number of common use case trees is ranked after all root use case trees before scheduling execution. If the number of unexecuted root use case trees is less than , select the use case tree from all common use case trees Schedule execution on the remaining machines in the process. The selection criteria are to select the common use case tree whose root node depends on completed use cases in the order from front to back.

[0134] The executability of the common use case tree depends on the execution result of the corresponding root use case tree, or more precisely, on a branch in the corresponding root use case tree, such as Figure 6 As shown in the figure, the execution of the public use case tree only depends on the path 17->19->24 of the root use case tree 1 and the path 20->21 of the root use case tree 2. Therefore, when traversing the use cases in the execution tree, these dependent paths should be executed first. Otherwise, the machine may be idle, but the use cases that the public use case tree depends on are not executed, resulting in the situation that the execution cannot be performed, wasting machine resources and delaying the test progress. Therefore, for the traversal execution of the root use case tree, the strategy of traversing the dependent public use case tree with the highest priority is adopted, that is, Maximum priority traversal execution. When a node in the root use case tree is executed, if there are multiple branches to choose to execute, the branch root node is selected from all branches. The largest branch is executed, that is, the use case path that is dependent on the public use case tree is executed first, and the more public use case trees are dependent, the higher the priority. The embodiment of the present application names this method as public use case dependency priority traversal.

[0135] Similarly, Similar to the use case tree in , All use case trees in also use the pruning call strategy, except that The pruning call strategy in is different. Pruning is performed from the root use case tree first, and when pruning in the root use case tree, branches are pruned according to the branch root node. Sort by large to small and prune. If Same, then follow Sort and prune from large to small, if and If they are the same, prune them according to the order of branch root node numbers.

[0136] In the above scheduling, when the machine is idle, the scheduling execution of the corresponding category of use cases is completed first. Only when all the use cases of the corresponding category are executed can they be scheduled by use cases of other categories.

[0137] The embodiment of the present application completes the processing of use case dependencies through the above method, splits the complex use case network into multiple units with smaller granularity, and formulates different calling strategies according to different categories of units, thereby decoupling use case dependencies, improving machine utilization, shortening the total execution time of use cases, and improving testing efficiency.

[0138] In an exemplary embodiment, in order to help better understand the technical solution of the present invention, the technical solution of the present invention is further described below in conjunction with the drawings.

[0139] For the sake of convenience, suppose there are 31 use cases (the actual scenario may be much larger than 31, and the embodiment of this application is only used as an example), and the dependency relationship between the use cases is as follows: Figure 3In the use case network shown, use cases 5, 17, 20, 7, etc. are root use cases, and use cases 6, 11, etc. are leaf use cases.

[0140] Start from the root use case and perform depth-first traversal to calculate the At the same time, the root use case number is added to the root use case set, such as the root use case set of 26 is {17} and the root use case set of 25 is {17,20}.

[0141] Through the above operations, all use cases in the use case network can be divided into three major categories, such as Figure 4 As shown, all use cases are divided into , , middle.

[0142] for Sort all the use cases in the table by execution time from large to small. If the order is 1, 2, 3, 4, and record the execution time, The sum of the execution time of all use cases in .

[0143] for All trees in , according to the root use case of each tree Sort from large to small, such as 7, 5; The root node set of the tree is ,but The sum of the execution time of all use cases in is 5 With 7 sum.

[0144] for All graphs in , according to the total duration of the use case Sort by size, there is only one picture here. . Record all pictures The sum of the execution times of the use cases.

[0145] from Figure 4 It can be seen that the use case diagram is large in scale and needs to be split into multiple use case trees. Figure 5 As shown in FIG. 24 , the use case diagram consists of two root use case trees and one common use case tree, and the common tree root use case is 25. In the root use case tree, each use case node defines a common root use case set, as shown in FIG. , 21 .

[0146] for In the middle figure, according to the splitting rules, the split diagram is as follows Figure 6 Finally, The tree sets cut from all graphs in the above example are sorted in the order of root use case tree first and public use case tree last. In the root use case tree and root public use case tree, the root node By sorting from large to small, it can be ensured that the public use case tree must be arranged after the root use case tree composed of root use cases. Assuming that according to Sort by Figure 6 shown.

[0147] After the above graph cutting steps, all use case directed graphs are cut into orderly arranged trees. At this point, the use case network is cut into use case non-dependency sets. and the use case tree As well as the root use case tree and common use case tree in the figure. The entire use case dependency management process is as follows Figure 7 shown.

[0148] Assume there are 7 use case execution machines. , Use Case Tree , Use Case Diagram The trees in are allocated proportionally to 2, 3, and 2 machines respectively.

[0149] for For the use cases in , assuming that use cases 1, 2, 3, and 4 take 8, 6, 4, and 3 minutes respectively, then according to the principle of minimum allocation time, the use case sets scheduled for execution on machines 1 and 2 are {1,4} and {2,3} respectively. This ensures that all four use cases are executed in the shortest time on the two machines.

[0150] For the use case tree In the use case tree in the example, since there are only two trees, but machines 3, 4, and 5 are assigned, use case trees 7 and 5 are scheduled to be executed on machines 3 and 4 respectively. When use case 7 is executed, assuming that the child node The order from largest to smallest is use case 10, 8, and 9. According to the largest priority traversal, use case 10 is selected for execution on machine 3, and use case 7 becomes a pruning node. Assuming that machine 4 has completed the execution of use case tree 5, and machines 4 and 5 are idle, use case tree 7 should be pruned at this time, such as Figure 8 As shown, at this time, use case tree 8 and use case tree 9 should be scheduled to machines 4 and 5 respectively to execute the use cases.

[0151] For use case diagrams In the use case tree, machines 6 and 7 are assigned, such as Figure 6As shown, assume that the use case trees after sorting are 17, 20, and 25. According to the root use case tree priority principle, use case trees 17 and 20 are scheduled to be executed on machines 6 and 7 respectively. When use case 17 is completed, according to the maximum priority traversal execution strategy of the number of dependent public use cases, use case 19 should be selected for execution. Similarly, when use case 20 is completed, use case 21 should be selected for execution; when use cases 24 and 21 are completed, public use case tree 25 can start to execute. If there is an idle machine, 25 will be scheduled to the corresponding idle machine for execution.

[0152] In the above scheduling, when the machine is idle, the scheduling execution of the corresponding category of use cases is completed first. Only when all the use cases of the corresponding category are executed can they be scheduled by use cases of other categories.

[0153] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0154] Based on the same inventive concept, the embodiment of the present application also provides a test case scheduling device for implementing the test case scheduling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more test case scheduling device embodiments provided below can refer to the limitations of the test case scheduling method above, and will not be repeated here.

[0155] In an exemplary embodiment, Fig. 9 As shown, a test case scheduling device 900 is provided, comprising: a network construction module 901, a network splitting module 902, a machine allocation module 903 and a test case scheduling module 904, wherein:

[0156] The network construction module is used to obtain the dependencies between multiple use cases and build a use case network based on the dependencies;

[0157] A network splitting module is used to split the use case network based on the number of dependent use cases of the root use case and each use case in the use case network, to obtain at least two use case sets of a use case non-dependency set, a use case tree set, and a use case diagram set; the number of dependent use cases of the use cases in the use case non-dependency set is 0, the use cases in the use case tree set constitute a first use case tree, the number of dependent use cases of the use cases in each first use case tree is greater than 0 and the number of root use cases is 1, the use cases in the use case diagram set constitute a second use case tree, the number of use case dependencies of the use cases in each second use case tree is greater than 0 and the number of root use cases is greater than or equal to 2;

[0158] A machine allocation module is used to determine the total execution time corresponding to the use cases in each use case set, and based on the total execution time, determine the execution machine allocated to each use case set;

[0159] The use case scheduling module is used to schedule the use cases in the use case set through the corresponding execution machine and the calling strategy corresponding to the use case set for each use case set; different use case sets correspond to different calling strategies.

[0160] Furthermore, the network splitting module 902 is specifically used to: traverse each use case of the use case network to determine the root use cases and the number of dependent use cases corresponding to each use case; determine that each use case that meets the first judgment condition is a use case set with no dependencies; the first judgment condition is that the number of dependent use cases of the use case is 0, and the root use case is itself; determine that the multiple first use case trees formed by each use case that meets the second judgment condition are a use case tree set; the second judgment condition is that the number of dependent use cases of the use case is greater than 0, and the root use case is a use case that is not itself; wherein, the root use cases of each use case in the same first use case tree are the same; determine that the multiple second use case trees formed by each use case that meets the third judgment condition are a use case diagram set; the third judgment condition is that the number of use case dependencies of the use case is greater than 0, and the root use case contains at least two use cases.

[0161] Furthermore, the machine allocation module is specifically used to: respectively determine the sum of the execution time of each use case contained in the use case dependency-free set, the use case tree set and the use case diagram set in the use case network, which is the total execution time corresponding to each use case set; and allocate multiple execution machines to be allocated in proportion according to the proportion of the total execution time of each use case set in the total execution time corresponding to the use case network, so as to obtain the execution machine allocated to each use case set.

[0162] Furthermore, the second use case tree in the use case diagram includes a root use case middle tree and a common use case middle tree. The device also includes a use case tree splitting module, which is used to: for the use case diagram, determine the common root use case of each use case by traversing the use cases of the second use case tree; the common root use case is used to represent the root node of the common use case middle tree split from the branch to which the use case belongs; based on the common root use case of each use case and each dependency, split the second use case tree to obtain a root use case middle tree and a common use case middle tree; wherein, the root use case corresponding to each use case in the root use case tree is one use case; the root use case corresponding to each use case in the common use case tree includes at least two use cases.

[0163] Furthermore, the calling strategy of the use case non-dependency set includes the calling strategy of the shortest execution time, the calling strategy of the use case tree set includes the traversal strategy of the longest dependency duration first, and the calling strategy of the use case graph set includes the traversal strategy of the public use case dependency first. The use case scheduling module 904 is specifically used for: for a use case non-dependency set, for each execution machine corresponding to the use case non-dependency set, assigning the use cases in the use case non-dependency set to the execution machine with the shortest current execution time until all the use cases in the use case non-dependency set are executed; for a use case tree set, assigning the first use case tree to the execution machine corresponding to the use case tree set in the order of the execution time of the first use case tree in the use case tree set until all the first use case trees in the use case tree set are executed; wherein, when the execution machine corresponding to the use case tree set executes a branch node of the first use case tree, it executes the remaining branches of the first use case tree in the order of the execution time of the remaining branch nodes; the execution time of the remaining branch nodes is the sum of the execution time of the dependent use cases of the remaining branch nodes and the remaining branch nodes; for a use case diagram set, the root use case tree corresponding to the second use case tree in the use case diagram set is executed first, and then the common use case tree corresponding to the second use case tree is executed; wherein, for the root use case tree and the common use case tree, when the execution machine corresponding to the use case diagram set executes a branch node of the second use case tree, it executes the branches inside the second use case tree in the order of the number of common root use cases of the remaining branch nodes.

[0164] Furthermore, the device also includes a first pruning module, which is used to: for the use case tree set, if the execution machine corresponding to the use case tree set is idle, prune the first use case tree according to the order of execution time of each remaining branch node of the first use case tree being executed in a non-idle execution machine to obtain multiple pruned branch trees; and execute the branch trees through the idle execution machine.

[0165] Furthermore, the device also includes a second pruning module, which is used to: for the use case diagram set, if the execution machine corresponding to the use case diagram set is idle, prune the second use case tree according to the order of the number of common root use cases of each remaining branch node of the second use case tree being executed in a non-idle execution machine, and the order of the execution time of each remaining branch node, to obtain multiple pruned branch trees; and execute the branch trees through the idle execution machine.

[0166] Each module in the above test case scheduling device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0167] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data corresponding to each test case. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test case scheduling method is implemented.

[0168] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0169] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0170] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0171] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0173] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0174] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A test case scheduling method, characterized in that: The method comprises: Obtain dependency relationships between multiple use cases, and build a use case network based on the dependency relationships; Based on the number of dependent use cases of the root use cases and each use case in the use case network, the use case network is split to obtain at least two use case sets including a use case non-dependency set, a use case tree set, and a use case diagram set; the number of dependent use cases of the use cases in the use case non-dependency set is 0, the use cases in the use case tree set constitute a first use case tree, the number of dependent use cases of the use cases in each first use case tree is greater than 0 and the number of root use cases is 1, the use cases in the use case diagram set constitute a second use case tree, the number of use case dependencies of the use cases in each second use case tree is greater than 0 and the number of root use cases is greater than or equal to 2; Determine the total execution time corresponding to the use cases in each use case set, and determine the execution machine assigned to each use case set based on the total execution time; For each use case set, the use cases in the use case set are scheduled through the corresponding execution machine and the calling strategy corresponding to the use case set; wherein different use case sets correspond to different calling strategies.

2. The method according to claim 1, characterized in that The method of splitting the use case network based on the number of dependent use cases of the root use case and each use case in the use case network to obtain at least two use case sets of use case non-dependency set, use case tree set and use case diagram set includes: Traversing each use case of the use case network, and determining the number of root use cases and dependent use cases corresponding to each use case; Determine that each use case that meets the first judgment condition is a use case non-dependency set; the first judgment condition is that the number of dependent use cases of the use case is 0, and the root use case is itself; Determine that a plurality of first use case trees formed by use cases that meet a second judgment condition are a use case tree set; the second judgment condition is that the number of dependent use cases of a use case is greater than 0, and the root use case is a use case other than the use case itself; wherein the root use cases of the use cases in the same first use case tree are the same; Determine that a plurality of second use case trees formed by use cases that satisfy a third judgment condition are a use case diagram set; the third judgment condition is that the number of use case dependencies of the use case is greater than 0, and the root use case contains at least two use cases.

3. The method according to claim 1, characterized in that The determining of the total execution time corresponding to the use cases in each use case set, and determining the execution machine assigned to each use case set based on the total execution time, includes: Determine the sum of the execution time of each use case included in the use case non-dependency set, the use case tree set and the use case diagram set in the use case network, which is the total execution time corresponding to each use case set; According to the proportion of the total execution time of each use case set in the total execution time corresponding to the use case network, the multiple execution machines to be allocated are allocated in proportion to obtain the execution machines allocated to each use case set.

4. The method according to claim 1, characterized in that: The second use case tree in the use case diagram includes a root use case tree and a common use case tree; the method further includes: For the use case diagram set, by traversing the use cases of the second use case tree, a common root use case of each of the use cases is determined; the common root use case is used to represent the root node of the common use case tree split out of the branch to which the use case belongs; Based on the common root use case of each of the use cases and each of the dependency relationships, split the second use case tree to obtain a root use case subtree and a common use case subtree; Among them, the root use case corresponding to each use case in the root use case subtree is one use case; the root use case corresponding to each use case in the common use case subtree includes at least two use cases.

5. The method according to claim 4, characterized in that The calling strategy of the use case non-dependency set includes the shortest execution time calling strategy, the calling strategy of the use case tree set includes the longest dependency duration first traversal strategy, and the calling strategy of the use case graph set includes the public use case dependency first traversal strategy; For each use case set, scheduling the use cases in the use case set through the corresponding execution machine and the call strategy corresponding to the use case set includes: For a use case non-dependency set, for each execution machine corresponding to the use case non-dependency set, assign the use cases in the use case non-dependency set to the execution machine with the shortest current execution time until all the use cases in the use case non-dependency set are executed; For a use case tree set, in the order of the execution time of the first use case trees in the use case tree set, the first use case trees are allocated to the execution machines corresponding to the use case tree set until all the first use case trees in the use case tree set are executed; When the execution machine corresponding to the use case tree set executes the branch node of the first use case tree, it executes the remaining branches of the first use case tree in the order of the execution time of the remaining branch nodes; the execution time of the remaining branch nodes is the sum of the execution time of the dependent use cases of the remaining branch nodes and the remaining branch nodes; For the use case diagram set, the root use case subtree corresponding to the second use case tree in the use case diagram set is executed first, and then the common use case subtree corresponding to the second use case tree is executed; Among them, for the root use case tree and the common use case tree, when the execution machine corresponding to the use case diagram executes the branch node of the second use case tree, it executes the branches inside the second use case tree in the order of the number of common root use cases of the remaining branch nodes.

6. The method according to claim 5, characterized in that The method further comprises: For a use case tree set, if an execution machine corresponding to the use case tree set is idle, prune the first use case tree according to the order of execution time of each remaining branch node of the first use case tree being executed in a non-idle execution machine to obtain a plurality of pruned branch trees; The branch tree is executed by an idle execution machine.

7. The method according to claim 5, characterized in that The method further comprises: For the use case diagram set, if the execution machine corresponding to the use case diagram set is idle, the second use case tree is pruned according to the order of the number of common root use cases of the remaining branch nodes of the second use case tree being executed in the non-idle execution machine and the order of the execution time of the remaining branch nodes to obtain multiple pruned branch trees; The branch tree is executed by an idle execution machine.

8. A test case scheduling device, characterized in that: The device comprises: A network construction module, used to obtain dependency relationships between multiple use cases and construct a use case network based on the dependency relationships; A network splitting module, configured to split the use case network based on the number of dependent use cases of the root use case and each use case in the use case network, to obtain at least two use case sets of a use case non-dependency set, a use case tree set, and a use case diagram set; the number of dependent use cases of the use cases in the use case non-dependency set is 0, the use cases in the use case tree set constitute a first use case tree, the number of dependent use cases of the use cases in each first use case tree is greater than 0 and the number of root use cases is 1, the use cases in the use case diagram set constitute a second use case tree, the number of use case dependencies of the use cases in each second use case tree is greater than 0 and the number of root use cases is greater than or equal to 2; A machine allocation module, used to determine the total execution time corresponding to the use cases in each use case set, and determine the execution machine allocated to each use case set based on the total execution time; The use case scheduling module is used to schedule the use cases in each use case set through the corresponding execution machine and the calling strategy corresponding to the use case set; different use case sets correspond to different calling strategies.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Interface testing method and device, client and computer readable storage medium

    CN107741911A

  • Test data processing method and device

    CN113282478A

  • Test case recommendation method and device, electronic equipment and storage medium

    CN114153954A

  • Test case sorting method and device, electronic equipment and storage medium

    CN117149606A

  • Hybrid fuzzy test optimization method for mining security vulnerabilities

    CN117331826A