Use case execution method, apparatus, program product, device cluster and storage medium
By identifying and replacing replaceable steps in test cases as the execution results of replacement steps in large-scale software testing in cloud computing, and combining this with path merging optimization, the problem of low testing efficiency caused by resource contention is solved, resulting in faster and more accurate test results.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-03-19
AI Technical Summary
In large-scale software testing scenarios in the cloud computing field, existing technologies require a large amount of resources for parallel testing, leading to resource competition and conflicts, resulting in low testing efficiency, especially with limited acceleration effects in ultra-large-scale scenarios.
By identifying the replacement steps corresponding to the replaceable steps in the test cases and replacing the replaceable steps with the execution results of the replacement steps during the test case execution, the number of calculation steps is reduced, and the scale of test case execution is optimized by utilizing the merged path tree, thereby improving testing efficiency.
In large-scale testing scenarios, it improves the execution speed and efficiency of test cases, and ensures the accuracy and consistency of test results.
Smart Images

Figure CN2025092611_19032026_PF_FP_ABST
Abstract
Description
Use case execution method, device, program product, device cluster and storage medium
[0001] The present application claims priority from the Chinese patent application No. 202411295425.X filed on September 14, 2024, and entitled "Use case execution method, device, program product, device cluster and storage medium", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the field of cloud computing, and in particular to a use case execution method, device, program product, device cluster and storage medium. BACKGROUND
[0003] With the continuous development of cloud computing technology and scale, the scale and complexity of software testing in the field of cloud computing also grow exponentially. In the face of growing testing needs, multiple use cases are executed simultaneously mainly by using parallel or distributed frameworks, testing environments are quickly deployed and recycled through containerization technology, and the execution order of use cases is optimized through use case selection and priority strategies, so as to realize software testing acceleration.
[0004] However, in a large-scale testing scenario with a large number of use cases, all use cases need to be tested in parallel, which requires a large amount of resources (such as computing resources, storage resources, communication resources, etc.), and resource competition and conflict will occur during parallel testing, resulting in low testing efficiency. SUMMARY
[0005] The present application provides a use case execution method, device, program product, device cluster and storage medium, which can improve the testing efficiency in the scenario of super large-scale use cases.
[0006] In a first aspect, a use case execution method is provided, which includes: obtaining at least one use case, each use case containing at least one execution step, and the at least one use case containing an replaceable step; determining a replacement step corresponding to the replaceable step, the similarity between the replaceable step and the replacement step being greater than or equal to a preset threshold; obtaining a first execution result of the replacement step; and replacing the replaceable step with the first execution result in the execution process of the at least one use case.
[0007] Based on the use case execution method, a replaceable step of an execution step included in at least one use case is determined to correspond to a replacement step, and a first execution result of the replacement step is obtained before execution of the use case. Since the replaceable step and the replacement step can be considered to be equivalent, the execution result of the replaceable step and the execution result of the replacement step can also be considered to be equivalent. The execution result of the replacement step is obtained before execution of the use case, and the replaceable step is replaced by the execution result of the replacement step during execution of the use case, so that the replaceable step does not need to be calculated during execution of the use case, and the number of execution steps that need to be calculated during testing of the use case is reduced. In this way, the execution speed of the test case is improved in a large-scale test scenario, thereby improving the test efficiency.
[0008] As a possible implementation, the replacement step can be a first replacement step similar to the replaceable step in a replacement step set, and the first execution result is determined to be an execution result of the first replacement step in the replacement step set. In this way, the execution result of the replacement step can be saved in the preset replacement step set, so that the replacement step does not need to be executed, and the first execution result of the replacement step can be directly obtained, thereby improving the speed of obtaining the first execution result of the replacement step and further improving the execution speed of the test case.
[0009] Optionally, the replacement step set can be a set including at least one execution step included in at least one use case. In this way, the replaceable step and the replacement step can be completely the same, thereby further improving the accuracy of the execution result of the use case.
[0010] Optionally, the replacement step set can also be a set including execution steps other than the execution steps included in at least one use case. In this way, the replacement step of the replaceable step is determined in the preset replacement step set, and the range of the replacement step is wider, which ensures the similarity between the replacement step and the replaceable step, thereby improving the accuracy of the execution result of the use case.
[0011] As a possible implementation, the replaceable step can be an equivalent step in the at least one execution step, and the equivalent step includes at least two execution steps with a similarity greater than or equal to a preset threshold; and the replacement step can be any execution step in the equivalent step.
[0012] Based on the use case execution method, since the equivalent step includes at least two execution steps that can be considered to be equivalent, and the replacement step can be considered to be equivalent to any execution step in the equivalent step, the execution result of the replacement step and the execution result of the at least two execution steps in the equivalent step can also be considered to be equivalent. During execution of at least one use case, the equivalent step is replaced by the execution result of the replacement step, and repeated calculation of the at least two similar execution steps in the equivalent step is not needed, thereby further reducing the number of execution steps that need to be calculated during testing of the use case, and improving the test efficiency.
[0013] As a possible implementation, the at least one execution step includes a first execution step. In the flow of the use case execution method, a first step model of the first execution step is established, a similarity of the first step model to a step model of each of other execution steps is determined, and in a case where a second step model of a second execution step of the other execution steps is greater than or equal to a preset threshold value, it is determined that the equivalent step includes the first execution step and the second execution step.
[0014] The first step model includes an object, a behavior, a precondition, and an expected result of the first execution step. The object is used to indicate an object involved in the first execution step. The behavior is used to indicate an algorithm and input data of the first execution step. The precondition is used to indicate a pre-existing environmental state of the first execution step. The expected result is used to indicate an expected execution result of the first execution step. In this way, the execution step is described by a standardized method, ensuring consistency and comparability of the execution step in the at least one test case.
[0015] The similarity includes an object similarity, a behavior similarity, a precondition similarity, and an expected result similarity in the step model. The other execution step refers to an execution step other than the first execution step in the plurality of execution steps. In this way, by calculating the similarity of the step model and comparing it with the preset threshold value, the same or similar execution steps can be identified in the at least one use case, the same or similar execution steps are used as equivalent steps in the at least one test case, the unified arrangement and compression of the equivalent steps are achieved, the execution of redundant execution steps is reduced, and the execution speed of the use case is improved.
[0016] As a possible implementation, the first execution result is used to replace the replaceable step during execution of the at least one use case. The at least one use case after the replacement is run to obtain a total execution result of the at least one use case.
[0017] Based on the above implementation, the first execution result of the replaceable step can be directly used to replace the corresponding replaceable step when calculating the execution result of the at least one use case, ensuring that the total execution result of the use case is calculated according to the running sequence of the execution steps in the use case, thereby ensuring the accuracy of the total execution result of each use case.
[0018] Optionally, paths corresponding to each of the at least one use case in the set of merged path trees are merged. The set of merged path trees includes at least one merged path tree, which is generated with the execution steps of the at least one use case as nodes. One node in the merged path tree corresponds to an execution step of one or more use cases. Each node in the set of merged path trees includes a node corresponding to a replaceable step that is replaced by a node corresponding to a replacement step. An execution result of an execution step corresponding to each node in the set of merged path trees is determined as the node. A total execution result of the at least one use case is obtained by combining the execution results of the execution steps corresponding to each node in the path.
[0019] Since the merged path tree includes paths corresponding to each use case, and one node in the merged path tree corresponds to an execution step of one or more use cases, that is, a node corresponding to a replacement step corresponds to one or more replaceable steps, the execution scale of the test use case is compressed. Moreover, the paths corresponding to each use case in the merged path tree are the same as the running sequence of the execution steps in the use case, thereby ensuring the consistency of the use case execution process based on the merged path tree and the accuracy of the total execution result of each use case.
[0020] The replacement step is any execution step in the equivalent step, and the construction process of the set of merged path trees includes: constructing a full-step tree according to a use case model of the at least one use case; the use case model includes a running sequence of execution steps of the use case, and one node in the full-step tree corresponds to one execution step; replacing a node corresponding to an equivalent step in the full-step tree with a replacement step; and performing path optimization on the full-step tree to obtain the set of merged path trees.
[0021] The execution scale of the use case is compressed through step replacement and path optimization, and the path optimization reduces the number of nodes and ensures the consistency of the order of the nodes, thereby ensuring the consistency of the execution process of the optimized set of merged path trees and the full-step tree.
[0022] Optionally, the at least one use case includes a first use case. The use case execution method runs the replaced first use case according to the execution result corresponding to each execution step in the first use case and a weight, to obtain a total execution result and a weighted average value of the first use case. The first use case is executed successfully if the total execution result of the first use case is greater than the weighted average value.
[0023] By using the weight value corresponding to the execution step, the importance of a certain execution step can be highlighted or the importance of a certain execution step can be reduced, thereby being applicable to a scenario in which an important execution step affects the execution result of the entire use case, thereby improving the adaptability of the use case execution method.
[0024] As a possible implementation, the use case is any one or more of a test use case, a use case composed of system inspection steps of system inspection, and a use case composed of operation steps of system operation. The use case execution method does not limit the application scenarios of the method, and can be applied to test scenarios, system inspection scenarios, and system operation scenarios, thereby improving the scenario adaptability of the use case execution method.
[0025] In a second aspect, a use case execution apparatus is provided, and the apparatus includes various modules for executing the use case execution method in the first aspect or any possible implementation of the first aspect.
[0026] The use case execution apparatus in the second aspect can be a terminal device or a network device, or a chip (system), a network card, or other components or assemblies that can be arranged in the terminal device or the network device, or an apparatus including the terminal device or the network device, and the present application does not limit this.
[0027] In addition, the technical effects of the use case execution apparatus in the second aspect can refer to the technical effects of the use case execution method in the first aspect, which will not be repeated here.
[0028] In a third aspect, a computer program product is provided, which, when running on a computer, causes the computer to perform the operation steps of the method in any possible implementation of the first aspect.
[0029] In a fourth aspect, a computing device is provided, which includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, which are loaded and executed by the processor to enable the computing device to implement the operation steps of the method in any possible implementation of the first aspect.
[0030] In a fifth aspect, a computing device cluster is provided, which includes at least one computing device, and the at least one computing device performs the operation steps of the method in any possible implementation of the first aspect.
[0031] In a sixth aspect, a computer-readable storage medium is provided, which includes computer software instructions; when the computer software instructions run in a computer, the computer performs the operation steps of the method in any possible implementation of the first aspect.
[0032] In a seventh aspect, the present application provides a chip system. The chip system includes a memory and at least one processor. The memory is used to store a set of computer instructions, and when the processor executes the set of computer instructions, the operation steps of the method in any possible implementation of the first aspect are executed.
[0033] On the basis of the implementation manners of the above aspects provided by the application, further combinations can be made to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS
[0034] Fig. 1 is a schematic diagram of the architecture of a cloud platform provided by an embodiment of the application;
[0035] Fig. 2 is a schematic diagram of the hierarchical structure of a cloud platform provided by an embodiment of the application;
[0036] Fig. 3 is a system architecture diagram of a cloud platform provided by an embodiment of the application;
[0037] Fig. 4 is a schematic diagram of a use case execution method provided by an embodiment of the application;
[0038] Fig. 5 is a schematic diagram of a use case execution provided by an embodiment of the application;
[0039] Fig. 6 is a schematic diagram of a use case processing process provided by an embodiment of the application;
[0040] Fig. 7 is a schematic diagram of an equivalent step identification process provided by an embodiment of the application;
[0041] Fig. 8 is a schematic diagram of a use case compression arrangement process provided by an embodiment of the application;
[0042] Fig. 9 is a schematic diagram of an execution process of a merged path tree set provided by an embodiment of the application;
[0043] Fig. 10 is a schematic diagram of a use case execution apparatus 1000 provided by an embodiment of the application;
[0044] Fig. 11 is a schematic diagram of the structure of a computing device provided by an embodiment of the application;
[0045] Fig. 12 is a schematic diagram of the structure of a computing device cluster provided by an embodiment of the application;
[0046] Fig. 13 is a schematic diagram of the structure of a computing device connected through a network provided by an embodiment of the application. DETAILED DESCRIPTION
[0047] The application can not only be applied to existing cloud computing technology, software testing scenarios in the field of cloud computing, but also can be applied to future cloud computing technology, software testing scenarios in the field of cloud computing, and other large-scale batch homogeneous non-cross execution software engineering scenarios, such as large-scale system inspection scenarios and large-scale system batch operation scenarios. The terms used in part of the embodiments of the application are only used to explain the specific embodiments of the application, and are not intended to limit the application.
[0048] For ease of understanding, the related terms involved in the embodiments of the present application are introduced first.
[0049] (1) Cloud computing
[0050] Cloud computing is a model that can achieve convenient access to required resources (for example, network, server, storage, application and service) from a configurable computing resource sharing pool at any time and on demand, and the resources can be quickly shared and released, so that the workload of managing resources and the interaction of service providers are reduced to a minimum.
[0051] Cloud computing is a kind of distributed computing, which refers to dividing huge data computing processing programs into countless small programs through a network "cloud", and then processing and analyzing these small programs through a system composed of multiple servers to obtain results and return them to the user.
[0052] (2) Use case
[0053] A use case describes the response of a system to the request of a participant under different conditions. A use case usually makes a request to the system through an actor, and the system performs a certain behavior sequence under different conditions according to the request of the actor.
[0054] Use cases include test cases, use cases composed of inspection steps of system inspection, and use cases composed of operation steps of system operation.
[0055] (3) Test case
[0056] A test case refers to a description of a test task for a specific software product, which embodies test plans, methods, techniques and strategies. Its content includes test objectives, test environments, input data, execution steps, expected results, test scripts, etc., and finally forms a document.
[0057] (4) Execution step
[0058] An execution step is a specific description of how to execute each step of a use case in a use case, such as a sentence in a text form use case.
[0059] When the use case is a test case, the execution step can also be called a test step. When the use case is a use case of system inspection, the execution step can also be called an inspection step. When the use case is a use case of system operation, the execution step can also be called an operation step.
[0060] In order to facilitate understanding of technical problems, the existing use case execution method is described below.
[0061] In the current digital era, cloud computing has become an infrastructure as important as water and electricity, and the quality of service of cloud computing has become a matter of national economy and people's livelihood. Therefore, the scale and complexity of software testing in the field of cloud computing are expanding at an exponential rate.
[0062] In order to meet the growing testing needs, it is necessary to improve the execution efficiency of use cases, that is, to accelerate the execution speed of use cases. The existing acceleration technology mainly uses parallel or distributed framework to execute multiple use cases at the same time, quickly deploys and recycles the test environment through containerization technology, and optimizes the execution order of use cases through use case selection and priority strategy, so as to realize software testing acceleration. The foregoing scheme can improve the speed and efficiency of test execution in small and medium-sized test scenarios, while ensuring the stability and comprehensiveness of test execution.
[0063] The core idea of the foregoing scheme is "exchange time for resources", but the foregoing scheme still has the following problems:
[0064] Firstly, the foregoing scheme needs to rely on the number of resources, and only sufficient resources can produce obvious acceleration effect, so the cost of the foregoing scheme is high. Moreover, with the increase of resources, the marginal effect decreases obviously.
[0065] Secondly, resource competition and conflict will occur in parallel testing process, especially in the case of shared resources or databases, which will cause part of the use case execution to be blocked, and even affect the final execution result and produce deviation.
[0066] Therefore, in the case of large-scale testing, due to the existence of the above two problems, the acceleration effect of use case execution is limited, and the testing efficiency is still low.
[0067] In order to solve the above problems, the embodiment of the present application provides a use case execution method, especially provides a method for determining the first execution result of the replacement step corresponding to the replaceable step in the use case, and replacing the replaceable step with the execution result of the replacement step in the use case execution process. Determine the replacement step corresponding to the replaceable step of the execution step contained in at least one use case, and replace the replaceable step with the first execution result of the replacement step in the execution process of at least one use case. Since the replaceable step and the replacement step can be regarded as equivalent, the execution result of the replaceable step and the execution result of the replacement step can also be regarded as equivalent. The execution result of the replacement step is obtained before the execution of the use case, and the replaceable step is replaced with the execution result of the replacement step in the execution process of the use case, so that the replaceable step does not need to be calculated in the execution process of the use case, and the number of execution steps required for testing the use case is reduced. In this way, in the case of large-scale testing, the execution speed of the test use case is improved, thereby improving the testing efficiency.
[0068] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0069] Fig. 1 is a schematic diagram of an architecture of a cloud platform provided by an embodiment of the present application. As shown in Fig. 1, the cloud platform 100 includes a computing server cluster 110, a storage server cluster 120, a management server cluster 130, a network device cluster 140, and a user terminal 150. The computing server cluster 110, the storage server cluster 120, and the management server cluster 130 respectively communicate with the user terminal 150 through the network device cluster 140.
[0070] The computing server cluster 110 includes one or more computing servers (two computing servers, i.e., a computing server 111 and a computing server 112, are shown in Fig. 1, but the number of computing servers is not limited to two).
[0071] The computing server, as a computing resource in the cloud platform 100, such as a server or a desktop computer, is configured to generate and allocate computing resources according to user requirements based on a virtualization technology. In the hardware layer, the computing server is provided with a processor and a memory (not shown in Fig. 1), and the computing function of the computing server is realized by running a program in the memory by the processor. The computing server is also capable of reading / writing data in each storage server in the storage server cluster 120 according to user requirements.
[0072] The storage server cluster 120 includes one or more storage servers (two storage servers, i.e., a storage server 121 and a storage server 122, are shown in Fig. 1, but the number of storage servers is not limited to two).
[0073] The storage server, as a storage resource in the cloud platform 100, such as a server, a desktop computer, or a controller of a storage array or a hard disk frame, is configured to provide logical disk storage, unstructured data storage, and integrated backup services for cloud virtual machines in the cloud platform 100. In the hardware layer, the storage server is provided with a network card, a processor, and a memory. The processor in the storage server is configured to process data from outside the storage server. The network card is configured to control the access process of the memory, such as the control of address signals, data signals, and various command signals, so that the storage server can provide the memory as a storage resource to users. The memory is configured to store data, and can include an internal memory and / or a hard disk. The internal memory refers to an internal memory that directly exchanges data with the processor, and the internal memory can quickly read / write data at any time and serve as a temporary data storage for an operating system or other programs that are running. Unlike the internal memory, the hard disk has a slower reading / writing speed and is usually used to store data persistently.
[0074] The management server cluster 130 includes one or more management servers (two management servers, i.e., a management server 131 and a management server 132, are shown in Fig. 1, but the number of management servers is not limited to two).
[0075] The management server is used to manage all computing services, shared storage, and network of the whole cloud platform 100, and provides an application programming interface (API) for users or administrators to manage the whole node.
[0076] The network device cluster 140 includes one or more switches and routers, as shown in FIG. 1, and in this embodiment, the network device cluster 140 includes a router 141, a switch 142, a switch 143, a switch 144, and a switch 145. The user terminal 150 is connected to the Internet and the router 141, the router 141 is connected to the switch 142 and the switch 143, the switch 143 is connected to each computing server in the computing server cluster 110. The switch 144 is connected to each computing server in the computing server cluster 110 and each storage server in the storage server cluster 120. The switch 145 is connected to each computing server in the computing server cluster 110, each storage server in the storage server cluster 120, and each management server in the management server cluster 130.
[0077] Optionally, the number and type of switches included in the network device cluster 140 can be adjusted according to the needs of the cloud platform 100, and the switch 142, the switch 143, the switch 144, and the switch 145 can be switches with different functions. For example, the switch 142 is a core switch, and the switch 143, the switch 144, and the switch 145 are used to manage specific network segments. For example, the switch 142 can be a core switch, the switch 143 can be an internal and external switching network segment switch, the switch 144 can be a storage network segment switch, and the switch 145 can be a management network segment switch.
[0078] The user terminal 150 includes one or more user terminals (two user terminals, i.e., a user terminal 151 and a user terminal 152, are shown in FIG. 1, but the number of user terminals is not limited to two). The user terminal includes interfaces and applications required to access the cloud platform 100.
[0079] It is worth noting that FIG. 1 is only a schematic diagram and should not be construed as a limitation on the present application. The cloud platform 100 can also include other devices that are not shown in FIG. 1.
[0080] On the basis of the devices of the cloud platform 100 as shown in FIG. 1, the cloud platform 100 implements the functions of service nodes based on infrastructure as a service (IaaS), platform as a service (PaaS) and software as a service (SaaS), and provides services (for example, computing services, storage services and network services) for users through the service nodes. The service node can be a cloud node obtained by virtualizing resources (for example, computing resources and storage resources) of the cloud platform 100.
[0081] Next, the layered structure of the cloud platform 100 is described in combination with FIG. 2.
[0082] FIG. 2 is a schematic diagram of a layered structure of a cloud platform provided in an embodiment of the present application. As shown in FIG. 2, the infrastructure as a service platform 210 is configured to perform virtualization of all infrastructure resources in the cloud platform 100, and provide virtual resources (for example, computing resources, network resources and storage resources) for users in a software-defined manner. The infrastructure resources refer to resources provided by the computing server cluster 110, the storage server cluster 120, the management server cluster 130 and / or the network device cluster 140 in the cloud platform 100.
[0083] The platform as a service platform 220 is configured to implement a runtime environment and application support function of the cloud platform 100, so that users can apply for computing units within a quota instead of virtual resources to run their own services. Optionally, the computing unit can be a container, and the cloud platform 100 deploys and runs the code of the user by scheduling the container. It should be noted that the number of containers in the platform as a service platform 220 can be one or more, and two containers are taken as an example in FIG. 2.
[0084] As a possible implementation manner, the cloud platform 100 can inject one or more components into the container to implement the deployment and running of the code. Optionally, the resources (computing resources or storage resources) used by the plurality of components in the same container can belong to the same hardware device (for example, a computing server, a storage server or a management server) or different hardware devices in the cloud platform 100.
[0085] The components can include a database component, a message queue component, an orchestration component, a log component, a virtualization component, a business database component, a configuration database component, an authority management component and the like.
[0086] The software as a service application 230 is configured to provide the user with the user-deployed application as a service in the form of an API response based on the infrastructure as a service platform 210 and the platform as a service platform 220. The application of the software as a service application 230 and the container can communicate through a web server.
[0087] It is worth noting that FIG. 2 is only a schematic diagram and should not be construed as a limitation of the present application. The cloud platform 100 can further include other modules in the hierarchical structure, which are not shown in FIG. 2.
[0088] The steps of the use case execution method provided by the embodiments of the present application are executed by the service nodes of the cloud platform 100. Next, the use case execution method provided by the embodiments of the present application will be described in combination with FIG. 3.
[0089] The use case execution method provided by the embodiments of the present application can be applied to the cloud platform shown in FIG. 2. The cloud platform can run a plurality of functional modules through one or more service nodes, for example, as shown in FIG. 3, which is a system architecture diagram of a cloud platform provided by the embodiments of the present application. In the cloud platform 100, the cloud platform 100 includes a use case analysis module 310, a use case library 320, an execution step model cache library 330, an algorithm executor module 340, an executor module 350, and an execution result data management module 360.
[0090] The use case analysis module 310 is communicatively connected to the use case library 320 and the execution step model cache library 330, respectively. The use case library 320 is communicatively connected to the use case module 310 and the algorithm executor module 340, respectively. The execution step model cache library 330 is communicatively connected to the use case analysis module 310 and the algorithm executor module 340, respectively. The algorithm executor module 340 is communicatively connected to the use case library 320, the execution step model cache library 330, the executor module 350, and the execution result data management module 360, respectively. The executor module 350 is communicatively connected to the algorithm executor module 340, the execution result data management module 360, and the cloud environment under test, respectively.
[0091] Each module in the cloud platform 100 can be distributed on one service node or on multiple service nodes. The service node can be virtualized from one device in FIG. 1 or from multiple devices in FIG. 1.
[0092] The use case analysis module 310 is configured to obtain at least one use case, and establish a use case model of the use case and a step model of each execution step in the use case. Each use case includes at least one execution step, and the execution steps included in at least one use case include replaceable steps.
[0093] The use case library 320 is configured to receive and store the use case model of the at least one use case sent by the use case parsing module 310. The use case model of the at least one use case can be used to construct a full step tree. The use case model includes a running sequence of execution steps of the use case, and one node in the full step tree corresponds to one execution step in the use case.
[0094] The execution step model cache 330 is configured to receive and store the step model of each execution step of the at least one use case sent by the use case parsing module 310. The step model includes an object, a behavior, a precondition and an expected result of the execution step. The object is used to indicate the object involved in the execution step. The behavior is used to indicate the algorithm and input data of the execution step. The precondition is used to indicate the pre-condition of the execution step. The expected result is used to indicate the expected execution result of the execution step.
[0095] The algorithm executor module 340 is configured to determine a replacement step corresponding to a replaceable step, and obtain a first execution result of the replacement step. The similarity between the replaceable step and the replacement step is greater than or equal to a preset threshold.
[0096] The preset threshold is used to determine whether the execution steps are similar. If the similarity is greater than or equal to the preset threshold, it means that the execution steps are similar or identical. For example, the preset threshold can be 75%, 80%, 99.3%, 99.9%, 100%, 98.9%, etc.
[0097] As a possible implementation manner, the algorithm executor module 340 is configured to replace the node corresponding to the replaceable step in the full step tree with the replacement step, and perform path optimization on the full step tree to obtain a merged path tree set.
[0098] The executor module 350 is configured to be responsible for the execution of the merged path tree set. The executor module 350 includes a task bus 351 and an execution step executor 352. The task bus 351 is configured to manage the running sequence of the execution steps. The serial part in the path is executed according to the running sequence, and the parallel part in the path is distributed to the idle algorithm executor module 340. The task bus 351 is configured to ensure that the running sequence is consistent with the execution timing of the execution steps in the merged path tree set. The execution step executor 352 is configured to send the execution result of the execution step to the execution result data management module 360.
[0099] As a possible implementation manner, the executor module 350 is configured to determine the execution result corresponding to each node according to the execution step corresponding to each node of the merged path tree set. The executor module 350 combines the execution result of each execution step corresponding to each node in the path of the merged path tree set to obtain the total execution result of the at least one use case.
[0100] Optionally, the executor module 350 is configured to determine an execution result of a corresponding non-replaceable step of a node in the merged path tree set according to the first execution result of the corresponding replaceable step, the corresponding node of the corresponding replaceable step, and the corresponding node of the corresponding non-replaceable step, and use the execution result to update the corresponding node.
[0101] The use case execution method of the embodiment of the present application is described below by taking the cloud platform 100 in FIG. 3 as an example. FIG. 4 is a flowchart of a use case execution method provided by the embodiment of the present application. The cloud platform 100 in FIG. 4 can refer to the description of FIG. 3, and the description is not repeated here.
[0102] As shown in FIG. 4, the use case execution method can include steps 401-404.
[0103] In step 401, the cloud platform 100 acquires at least one use case.
[0104] In step 401, the cloud platform 100 acquires at least one use case.
[0105] As a possible implementation manner, after the cloud platform 100 acquires the at least one use case, the cloud platform 100 parses the use case.
[0106] Optionally, the use case can be described in a text form, and therefore the cloud platform 100 can use artificial intelligence technology to parse the use case and the execution steps in the use case. For example, the cloud platform 100 uses natural language processing (NLP) or a large language model (LLM) to parse the use case and the execution steps in the text form, so as to realize the structured modeling of the use case and the execution steps.
[0107] The process of the cloud platform 100 establishing the use case model and the step model can refer to the related description of FIG. 6 below, and the description is not repeated here.
[0108] Each use case includes at least one execution step, and the execution steps included in the at least one use case include replaceable steps.
[0109] In step 402, the cloud platform 100 determines a replaceable step corresponding to a replaceable step.
[0110] As a possible implementation manner, the cloud platform 100 can determine the replacement step as a first replacement step in the replacement step set that is similar to the replaceable step. That is, the cloud platform 100 determines the similarity of each replacement step in the replacement step set to the replaceable step, and determines the first replacement step with the similarity greater than or equal to a preset threshold.
[0111] Optionally, the cloud platform 100 can establish a step model of the replaceable step, determine the similarity of the step model of the replaceable step to the step model of the replacement step in the replacement step set, and determine the replacement step corresponding to the replaceable step as the first replacement step in a case that the similarity of the first replacement step is greater than or equal to the preset threshold.
[0112] The replacement step set can be a set of at least one execution step included in at least one use case, or the replacement step set can be a set of execution steps other than the execution steps of at least one use case.
[0113] As another possible implementation manner, the cloud platform 100 can determine the replaceable step as an equivalent step in the at least one execution step; the equivalent step includes at least two execution steps with the similarity greater than or equal to a preset threshold; and determine the replacement step as any execution step in the equivalent step.
[0114] Optionally, the at least one execution step includes a first execution step. The cloud platform 100 can establish a first step model of the first execution step, and determine the similarity of the first step model to the step model of each execution step in other execution steps. The other execution steps refer to the execution steps other than the first execution step in the multiple execution steps. The similarity includes the object similarity, the behavior similarity, the precondition similarity and the expected result similarity in the step model. The cloud platform 100 determines that the equivalent step includes the first execution step and a second execution step in a case that a second step model of the second execution step in the other execution steps has the similarity greater than or equal to the preset threshold to the first step model.
[0115] Optionally, the cloud platform 100 can calculate the similarity of the second step model to the first step model by a step similarity algorithm. The similarity of the second step model to the first step model greater than or equal to the preset threshold means that the object similarity of the second step model to the first step model is greater than the preset threshold, the behavior similarity is greater than the preset threshold, the precondition similarity is greater than the preset threshold, and the expected result similarity is greater than the preset threshold.
[0116] The expected result includes an environmental state change, and the environmental state change is derived according to a pre-established environmental digital model.
[0117] The preset threshold corresponding to the object similarity, the preset threshold corresponding to the behavior similarity, the preset threshold corresponding to the precondition similarity and the preset threshold corresponding to the expected result can be the same or different, and the embodiments of the present application do not limit this.
[0118] The specific process in which the cloud platform 100 identifies the equivalent steps can refer to FIG. 7 and the related description below, and will not be repeated here.
[0119] In step 403, the cloud platform 100 obtains the first execution result of the replacement step.
[0120] As a possible implementation manner, the cloud platform 100 can determine that the first execution result is the execution result of the first replacement step in the replacement step set.
[0121] As another possible implementation manner, when the replaceable step is the equivalent step in the at least one execution step, and the replacement step is any execution step in the equivalent step, the cloud platform 100 can run the replacement step to determine the first execution result.
[0122] In step 404, the cloud platform 100 replaces the replaceable step with the first execution result in the execution process of the at least one use case.
[0123] As a possible implementation manner, the cloud platform 100 can replace the replaceable step with the first execution result in the execution process of the at least one use case. The cloud platform 100 runs the replaced at least one use case to obtain the total execution result of the at least one use case.
[0124] Optionally, the at least one use case includes a first use case. The cloud platform 100 runs the replaced first use case according to the execution result corresponding to each execution step in the first use case and the weight to obtain the total execution result and the weighted average value of the first use case. The total execution result of the first use case is greater than the weighted average value, which indicates that the first use case is executed successfully.
[0125] Optionally, the cloud platform 100 can perform use case execution in the step tree manner, replace the replaceable step in the step tree, obtain the merged path tree set after path compression through path optimization, and run the merged path tree set to obtain the total execution result of the at least one use case.
[0126] The cloud platform 100 performs use case execution in the step tree manner can refer to the related description of FIGS. 8-9 below, and the embodiments of the present application will not be repeated here.
[0127] As another possible implementation, the cloud platform 100 can also be configured to, in at least one use case, replace the replaceable step with the replacement step, determine a first execution result of the replacement step and a second execution result of the non-replaceable step in the at least one use case, run the at least one use case after the replacement, and obtain a total execution result of the at least one use case by using the first execution result of the replacement step and the second execution result of the non-replaceable step during the running.
[0128] The present application does not limit the specific execution device or module of the above steps 401-404. For example, in the above use case execution method, step 401 can be executed by the use case analysis module 310 of the cloud platform 100, step 402 can be executed by the algorithm executor module 340 of the cloud platform 100, step 403 can be executed by the executor module 350 of the cloud platform 100, and step 404 can be executed by the algorithm executor module 340 and the executor module 350 of the cloud platform 100.
[0129] Based on the above description of steps 401-404 in FIG. 4, the cloud platform 100 determines the replacement step corresponding to the replaceable step of the execution step included in the at least one use case, and replaces the replaceable step with the first execution result of the replacement step during the execution of the at least one use case. Since the replaceable step and the replacement step can be considered equivalent, the execution result of the replaceable step and the execution result of the replacement step can also be considered equivalent. The execution result of the replacement step is obtained before the execution of the use case, and the replaceable step is replaced with the execution result of the replacement step during the execution of the use case, so that the replaceable step does not need to be calculated during the execution of the use case, reducing the number of execution steps that need to be calculated for the test use case. In this way, in a large-scale test scenario, the execution speed of the test use case is improved, thereby improving the test efficiency of the cloud platform 100.
[0130] The above describes the complete flow of the use case execution method, and the use case execution method of the cloud platform 100 is described through a specific embodiment in combination with FIGS. 5-9. FIG. 5 is a flowchart of a use case execution method according to an embodiment of the present application. As shown in FIG. 5, the flow can include the following steps one to four.
[0131] Step one, the use case analysis module 310 models the use case and the execution step. Step one includes sub-step one and sub-step two. Sub-step one, obtain the use case, and establish the use case model according to the execution step. Sub-step two, establish the step model.
[0132] As a possible implementation, the use case analysis module 310 establishes a step model of the execution step according to the object, the behavior, the precondition and the expected structure involved in the execution step. The step model is a four-dimensional model, i.e., the step model includes four key dimensions of object, behavior, precondition and expected result. The use case analysis module 310 establishes a use case model of the use case according to the sequence of the execution steps. Each execution step in the use case model is in the form of the step model.
[0133] As a possible implementation, the use case analysis module 310 can save the use case model in the use case library 320. Each use case in the use case library 320 has a task identifier indicating the task implemented by the use case. One task can correspond to one use case, one task can correspond to multiple use cases, one use case can correspond to multiple tasks, and the embodiments of the present application do not limit this.
[0134] As a possible implementation, the use case analysis module 310 can also save the step model in the execution step model cache library 330. Each step model of the execution step in the execution step model cache library 330 has a task identifier, and a corresponding code is generated for each step model and managed.
[0135] FIG. 6 is a process schematic diagram of a use case processing provided by an embodiment of the present application. The use case analysis module 310, the use case library 320 and the execution step model cache library 330 in FIG. 6 can refer to the description of FIG. 3, and will not be described here.
[0136] As shown in FIG. 6, the use case analysis module 310 stores the use case model of the at least one constructed use case into the use case library 320. The use case library 320 includes the use case model of use case 1, use case 2, use case 3 to use case n, and the use case model includes the running sequence of the execution steps of the use case. For example, the use case model of use case 1 includes 5 execution steps and a running sequence composed of arrows. The use case analysis module 310 stores the step model of the execution step of the at least one constructed use case into the execution step model cache library 330. The execution step model cache library 330 includes the step model of execution step 1, execution step 2, execution step 3 to execution step n.
[0137] Step two, the algorithm executor module 340 identifies equivalent steps and determines replacement steps.
[0138] The algorithm executor module 340 identifies equivalent steps based on the step model of the execution step in the execution step model cache library 330.
[0139] The algorithm executor module 340 determines the similarity of each step model saved in the execution step model library 330 with other step models, and determines that a certain step model and the execution step corresponding to the step model belong to equivalent steps if there is a step model in the other step models that is similar to the step model by more than or equal to a preset threshold.
[0140] After determining all at least one equivalent step, the algorithm executor module 340 determines any execution step in each equivalent step as a replacement step of the equivalent step, and replaces the step model of the equivalent step with the step model of the replacement step in the execution step model library 330.
[0141] FIG. 7 is a process diagram of equivalent step identification provided by an embodiment of the present application. The algorithm executor module 340 and the execution step model library 330 in FIG. 7 can refer to the related description of FIG. 3 above, and will not be described here.
[0142] As shown in FIG. 7, the execution step library 330 on the left side of FIG. 7 is the original execution step library, and the execution step library 330 on the right side is the execution step library after the replacement step replacement. The original execution step library includes execution step 1, execution step 2, execution step 3, and execution step n. The execution step library after the replacement step replacement includes replacement step 1, replacement step 2, replacement step 3, and replacement step m. The circle filled with horizontal lines in FIG. 7 represents the step model of replacement step 1, the circle filled with horizontal and vertical lines represents the step model of replacement step 2, the circle filled with right diagonal lines represents the step model of replacement step 3, and the circle filled with dots represents the step model of replacement step m.
[0143] As shown in FIG. 7, the algorithm executor module 340 obtains the objects, preconditions, and behaviors in the step model of each execution step, obtains the expected results in the step model of each execution step, determines the replacement step of each execution step by calculating the similarity of the step model of the execution step. The algorithm executor module 340 determines that replacement step 1 is the replacement step of execution step 4 and execution step 5, and uses replacement step 1 to replace execution step 4 and execution step 5. The algorithm executor module 340 determines that replacement step 2 is the replacement step of execution step 3 and other execution steps, and uses replacement step 2 to replace execution step 3. The algorithm executor module 340 determines that replacement step 3 is the replacement step of execution step 2 and execution step n, and uses replacement step 3 to replace execution step 2 and execution step n. The algorithm executor module 340 determines that replacement step m is the replacement step of execution step 1 and other execution steps, and uses replacement step m to replace execution step 1.
[0144] Step three, the algorithm executor module 340 performs compression arrangement on the use case. Step three includes sub-step three and sub-step four. Sub-step three, at least one use case establishes a full step tree, and equivalent steps are replaced by replacement steps. Sub-step four, the full step tree is optimized to obtain a merged path tree set, and the path corresponding to the use case is determined.
[0145] The algorithm executor module 340 constructs a full step tree according to the use case model of at least one use case. The use case model includes a running sequence of execution steps of the use case. One node in the full step tree corresponds to one execution step. The algorithm executor module 340 replaces the nodes corresponding to equivalent steps in the full step tree by replacement steps. The algorithm executor module 340 performs path optimization on the full step tree to obtain a merged path tree set, and determines the path corresponding to the use case.
[0146] As a possible implementation manner, the algorithm executor module 340 performs path optimization on the full step tree by using a path optimization algorithm. For example, the path optimization algorithm can be a pruning algorithm or the like.
[0147] In a first possible example, the algorithm executor module 340 generates one merged path tree by using the path optimization algorithm, and the merged path tree covers all use case paths.
[0148] In a second possible example, when the merged path tree generated by the algorithm executor module 340 by using the path optimization algorithm cannot cover all use case paths, the path conflict is solved by establishing local sub-trees of the merged path tree to form the merged path tree set, so that the merged path tree set covers all use case paths in the full step tree.
[0149] In a third possible example, when the merged path tree generated by the algorithm executor module 340 by using the path optimization algorithm cannot cover all use case paths, the path conflict is solved by using a step rollback manner, so that the merged path tree covers all use case paths in the full step tree. The step rollback manner refers to a manner in which an execution step is returned to a previous execution step and then a next execution step is determined.
[0150] The above three possible examples are different examples of performing path optimization on the full step tree provided by the embodiments of the present application, and should not be understood as a limitation on the present application. For example, according to different paths included in the full step tree, the manner of performing path optimization by the algorithm executor module 340 can be changed or adjusted.
[0151] FIG. 8 is a process schematic diagram of compression arrangement of a use case provided by an embodiment of the present application. The algorithm executor module 340, the use case library 320 and the execution step model cache library 330 in FIG. 8 can be referred to the related description of FIG. 3, and will not be described herein.
[0152] As shown in FIG. 8, the algorithm executor module 340 replaces the step models of the equivalent steps in the use case model saved in the use case library 320 with the replacement steps in the replacement step model cache library 330. The algorithm executor module 340 builds a full step tree according to the replaced use case model, and performs path optimization on the full step tree to obtain a merged path tree set and update the use case library 320. The merged path tree set after path optimization saved in the use case library 320 shown in FIG. 8 is shown in the upper tree diagram, which represents the merged path tree set constructed in the subtree manner, and is shown in the lower tree diagram, which represents the merged path tree constructed in the step rollback manner.
[0153] Step four, the algorithm executor module 340 and the executor module 350 execute the use cases according to the optimized merged path tree set to obtain the total execution result of the use cases. Step four includes sub-step five and sub-step six. Sub-step five, execute according to the merged path tree set, and record the execution result of each execution step. Sub-step six, calculate the total execution result of each use case according to the path corresponding to the use case.
[0154] As a possible implementation manner, the executor module 350 runs each node of the merged path tree set to execute the corresponding execution step, and determines the execution result of each execution step corresponding to each node. The algorithm executor module 340 combines the execution result of each execution step corresponding to each node in the path according to the path of the merged path tree set to obtain the total execution result of at least one use case.
[0155] The merged path tree set includes at least one merged path tree, and the merged path tree is generated by taking the execution steps of the at least one use case as nodes, and one node in the merged path tree corresponds to the execution step of one or more use cases. Each node of the merged path tree set includes a node corresponding to the replacement step in which the equivalent step is replaced, and a node corresponding to the non-replaceable step.
[0156] FIG. 9 is a schematic diagram of an execution process of a merged path tree set provided by an embodiment of the present application. The algorithm executor module 340, the use case library 320 and the executor module 350 in FIG. 9 can be referred to the related description of FIG. 3 above, and will not be described here.
[0157] As shown in FIG. 9, the algorithm executor module 340 obtains the merged path tree after use case compression, and sends the merged path tree to the executor module 350.
[0158] The executor module 350 traverses each node of the merged path tree to determine a running sequence of each execution step corresponding to the node. The task bus 351 of the executor module 350 manages the running sequence of the execution steps. The execution step executor 352 is responsible for compiling and executing the code corresponding to each execution step to implement the execution of the execution step in the running sequence of the execution steps managed by the task bus 351 in the cloud environment under test, thereby obtaining the execution result of the execution step.
[0159] The execution step executor 352 sends the execution result to the execution result data management module 360 for storage.
[0160] The algorithm executor module 340 obtains the execution result of the execution step from the execution result data management module 360 and marks the execution result of the execution step according to each node corresponding to the path of the use case. The algorithm executor module 340 combines the execution result of each execution step corresponding to each node in the path according to the path of each use case in the merged path tree set to obtain the total execution result of at least one use case. The algorithm executor module 340 marks the corresponding total execution result on the path corresponding to each use case in the merged path tree set in the use case library 320.
[0161] Based on the above embodiments, when the use case is a test case, the equivalent test steps in different test cases are accurately identified and optimized by constructing a model and comparing the similarity of the test case and the test steps of the test case, significantly reducing the execution of unnecessary test steps, achieving compression of the arrangement of the test case, and improving the execution speed of the test case. A large amount of test resources, including time resources, human resources and computing resources, are saved. It provides strong support for the rapid iteration and high-quality delivery of cloud computing services.
[0162] To cooperate with the above-mentioned use case execution method shown in FIG. 4 provided by the embodiments of the present application, the present application further provides a use case execution device 1000, which can be used to realize the functions of the use case analysis module 310, the algorithm executor module 340 and the executor module 350 in the above-mentioned use case execution method shown in FIG. 4. FIG. 10 is a schematic diagram of a use case execution device 1000 provided by an embodiment of the present application, as shown in FIG. 10, the use case execution device 1000 comprises an obtaining module 1001, a determining module 1002 and an executing module 1003.
[0163] The obtaining module 1001 is configured to obtain at least one use case, each use case comprising at least one execution step, and the execution steps included in the at least one use case comprising replaceable steps. For example, the obtaining module 1001 is configured to perform step 401 in FIG. 4.
[0164] The determining module 1002 is configured to determine a replacement step corresponding to the replaceable step, and a similarity between the replaceable step and the replacement step is greater than or equal to a preset threshold. For example, the determining module 1002 is configured to perform step 402 in FIG. 4.
[0165] The obtaining module 1001 is configured to obtain a first execution result of the replacement step. For example, the obtaining module 1001 is configured to perform step 403 in FIG. 4.
[0166] The execution module 1003 is configured to replace the replaceable step with the first execution result during execution of the at least one use case. For example, the execution module 1003 is configured to perform step 404 in FIG. 4.
[0167] As a possible implementation, the determining module 1002 is specifically configured to determine that the replacement step is a first replacement step similar to the replaceable step in a replacement step set. The obtaining module 1001 is specifically configured to determine that the first execution result is an execution result of the first replacement step in the replacement step set.
[0168] As a possible implementation, the replacement step set is a set of at least one execution step included in the at least one use case.
[0169] As a possible implementation, the replacement step set is a set of execution steps other than the execution steps included in the at least one use case.
[0170] As a possible implementation, the determining module 1002 is specifically configured to determine that the replaceable step is an equivalent step in the at least one execution step; the equivalent step includes at least two execution steps with a similarity greater than or equal to a preset threshold; and the replacement step is any execution step in the equivalent step.
[0171] As a possible implementation manner, the at least one execution step includes a first execution step. The determining module 1002 is specifically configured to establish a first step model of the first execution step, the first step model including an object of the first execution step, an action of the first execution step, a precondition of the first execution step, and an expected result of the first execution step, the object being used to indicate an object involved in the first execution step, the action being used to indicate an algorithm and input data of the first execution step, the precondition being used to indicate an environmental state of a precondition of the first execution step, and the expected result being used to indicate an execution result expected by the first execution step; determine a similarity between the first step model and a step model of each execution step in other execution steps, the other execution steps being execution steps other than the first execution step in the multiple execution steps; and in a case where a second step model of a second execution step in the other execution steps has a similarity with the first step model greater than or equal to the preset threshold, determine that the equivalent step includes the first execution step and the second execution step.
[0172] As a possible implementation manner, the execution module 1003 is specifically configured to replace the replaceable step with the first execution result during execution of the at least one use case; and run the at least one use case after the replacement to obtain a total execution result of the at least one use case.
[0173] As a possible implementation manner, the merged path tree set includes paths corresponding to each use case in the at least one use case. The merged path tree set includes at least one merged path tree, and the merged path tree is generated by taking execution steps of the at least one use case as nodes, and one node in the merged path tree corresponds to an execution step of one or more use cases.
[0174] The execution module 1003 is specifically configured to determine, according to an execution step corresponding to each node of the merged path tree set, that an execution result of the execution step corresponding to the each node corresponds to the each node; and combine, according to paths of the merged path tree set, execution results of each execution step corresponding to each node in the paths to obtain a total execution result of the at least one use case.
[0175] As a possible implementation manner, each node of the merged path tree set includes a node corresponding to the replaceable step and a node corresponding to a non-replaceable step.
[0176] As a possible implementation manner, the replacing step is any one of the equivalent steps, and the execution module 1003 is further configured to construct a full-step tree according to a use case model of the at least one use case; the use case model includes a running sequence of execution steps of the use case, one node in the full-step tree corresponds to one execution step; the node corresponding to the equivalent step in the full-step tree is replaced by the replacing step; and path optimization is performed on the full-step tree to obtain the merged path tree set.
[0177] As a possible implementation manner, the at least one use case includes a first use case, and the execution module 1003 is specifically configured to run the replaced first use case according to an execution result corresponding to each execution step in the first use case and a weight, to obtain a total execution result of the first use case and a weighted average value; and the first use case is considered to be successfully executed when the total execution result of the first use case is greater than the weighted average value.
[0178] As a possible implementation manner, the use case is any one or more of the following: a test use case, a use case composed of patrol steps of system patrol, and a use case composed of operation steps of system operation.
[0179] The obtaining module 1001, the determining module 1002, and the execution module 1003 can be implemented by software or hardware. For example, the implementation of the determining module 1002 is described below. Similarly, the implementation of the obtaining module 1001 and the execution module 1003 can refer to the implementation of the determining module 1002.
[0180] As an example of a software functional unit, the determining module 1002 can include code running on a computing instance. The computing instance can include at least one of a physical host (computing device), a virtual machine, and a container. Further, the computing instance can be one or more. For example, the determining module 1002 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple data centers with similar geographical locations. Generally, one region can include multiple AZs.
[0181] Similarly, the plurality of hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, usually one VPC is set in one region, and a communication gateway needs to be set in each VPC for cross-region communication between two VPCs in the same region and between VPCs in different regions, and the interconnection between VPCs is realized through the communication gateway.
[0182] As an example of a hardware functional unit, the determination module 1002 can include at least one computing device, such as a server, etc. Alternatively, the determination module 1002 can also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. Among them, the above-mentioned PLD can be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0183] The plurality of computing devices included in the determination module 1002 can be distributed in the same region or in different regions. The plurality of computing devices included in the determination module 1002 can be distributed in the same AZ or in different AZs. Similarly, the plurality of computing devices included in the determination module 1002 can be distributed in the same VPC or in multiple VPCs. Among them, the plurality of computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, and GALs, etc.
[0184] It should be noted that in other embodiments, any of the acquisition module 1001, the determination module 1002, and the execution module 1003 can be used to perform any step in the use case execution method, and the steps responsible for the acquisition module 1001, the determination module 1002, and the execution module 1003 can be specified as needed. By implementing different steps in the use case execution method through the acquisition module 1001, the determination module 1002, and the execution module 1003, respectively, the entire function of the use case execution device 1000 can be realized.
[0185] The application also provides a computing device 1100. As shown in FIG. 11, the computing device 1100 includes a bus 1102, a processor 1104, a memory 1106, and a communication interface 1108. The processor 1104, the memory 1106, and the communication interface 1108 communicate through the bus 1102. The computing device 1100 can be a server or a terminal device. It should be understood that the number of processors and memories in the computing device 1100 is not limited.
[0186] The bus 1102 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is shown in FIG. 11, but it does not mean that there is only one bus or only one type of bus. The bus 1102 can include a path for transmitting information between various components (for example, the memory 1106, the processor 1104, the communication interface 1108) of the computing device 1100.
[0187] The processor 1104 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc.
[0188] The memory 1106 can include a volatile memory, such as a random access memory (RAM). The processor 1104 can also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0189] The memory 1106 stores executable program code, and the processor 1104 executes the executable program code to respectively implement the functions of each module included in the use case execution apparatus 1000, thereby implementing the use case execution method. That is, the memory 1106 has instructions for executing the use case execution method.
[0190] Alternatively, the memory 1106 stores executable code, and the processor 1104 executes the executable code to implement the functions of the aforementioned use case parsing module 310, algorithm executor module 340 and executor module 350 respectively, thereby implementing the use case execution method. That is, the memory 906 stores instructions for executing the use case execution method.
[0191] The communication interface 1108 uses a transceiver module such as, but not limited to, a network interface card and a transceiver, to implement communication between the computing device 1100 and other devices or communication networks.
[0192] It is considered that the use case execution method provided in the present application is applied in the cloud platform 100, and the infrastructure of each server in the cloud platform 100 usually includes multiple computing devices. Therefore, the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a notebook computer, or a smart phone.
[0193] As shown in FIG. 12, the computing device cluster includes at least one computing device 1100. The memory 1106 in one or more computing devices 1100 in the computing device cluster can store the same instructions for executing the use case execution method.
[0194] In some possible implementations, the memory 1106 of one or more computing devices 1100 in the computing device cluster can also store partial instructions for executing the use case execution method respectively. In other words, the combination of one or more computing devices 1100 can collectively execute the instructions for executing the use case execution method.
[0195] It should be noted that the memories 1106 in different computing devices 1100 in the computing device cluster can store different instructions for executing part of the functions of the use case execution apparatus 1000 respectively. That is, the instructions stored in the memories 1106 in different computing devices 1100 can implement the functions of one or more modules included in the use case execution apparatus 1000.
[0196] In some possible implementation, one or more of the computing devices in the cluster of computing devices can be connected through a network. Among others, the network can be a wide area network or a local area network, etc. FIG. 13 shows one possible implementation. As shown in FIG. 13, two computing devices 1100A and 1100B are connected through a network. Specifically, the connection is made through a communication interface in each of the computing devices. In this class of possible implementation, the memory 1106 in the computing device 1100A stores instructions for the functionality of one or more of the obtaining module 1001, the determining module 1002, and the performing module 1003, and FIG. 13 shows an example where the memory 1106 in the computing device 1100A stores instructions for the functionality of the obtaining module 1001. Meanwhile, the memory 1106 in the computing device 1100B stores instructions for the functionality of one or more of the obtaining module 1001, the determining module 1002, and the performing module 1003, and FIG. 13 shows an example where the memory 1106 in the computing device 1100B stores instructions for the functionality of the determining module 1002 and the performing module 1003.
[0197] It should be understood that the functionality of the computing device 1100A shown in FIG. 13 can also be accomplished by multiple computing devices 1100. Similarly, the functionality of the computing device 1100B can also be accomplished by multiple computing devices 1100.
[0198] The embodiments of the present application also provide a computer program product containing instructions. The computer program product can be a software or program product containing instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to perform the use case execution method shown in FIG. 4.
[0199] The embodiments of the present application also provide a computer readable storage medium. The computer readable storage medium can be any available medium or a data storage device containing one or more available media that is accessible by a computing device, such as a data center, etc. The available medium can be a magnetic medium, (e.g., a floppy diskette, a hard disk drive, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state hard drive), etc. The computer readable storage medium contains instructions that instruct the computing device to perform the use case execution method shown in FIG. 4.
[0200] The above-described embodiments can be implemented in whole or in part by software, hardware (such as circuitry), firmware, or any combination thereof. When implemented in software, the above-described embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded on or executed by a computer, the processes or functions described in the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available medium collections. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid state disk.
[0201] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software 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 beyond the scope of the present application.
[0202] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0203] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0204] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed on multiple network units. Part or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0205] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0206] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and various media that can store program codes.
[0207] In the present application, "at least one" means one or more, and "multiple" means two or more. The association relationship between the associated objects is described as "and / or", which means that there can be three kinds of relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c, which can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b and c can be single or multiple.
[0208] It should be noted that in the present application, the words "exemplary" or "for example" are used to mean an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of "exemplary" or "for example" is intended to present the relevant concept in a specific manner.
[0209] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the same; although the present application has been described in detail with reference to the foregoing examples, those of ordinary skill in the art should understand that the technical solutions recorded in the foregoing examples can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A use case execution method, characterized by, The method comprises: acquiring at least one use case, each use case comprising at least one execution step, the at least one use case comprising an execution step comprising a replaceable step; determining a replacement step corresponding to the replaceable step, the similarity between the replaceable step and the replacement step being greater than or equal to a preset threshold; acquiring a first execution result of the replacement step; replacing the replaceable step with the first execution result during execution of the at least one use case.
2. The method of claim 1, wherein, The determination of the replacement step corresponding to the replaceable step comprises: determining the replacement step as a first replacement step similar to the replaceable step in a replacement step set; The acquisition of the first execution result of the replacement step comprises: determining the first execution result as an execution result of the first replacement step in the replacement step set.
3. The method of claim 2, wherein, The replacement step set is a set comprising at least one execution step included in at least one use case.
4. The method of claim 3, wherein, The replacement step set is a set comprising execution steps other than the execution step included in the at least one use case.
5. The method of claim 1, wherein, The determination of the replacement step corresponding to the replaceable step comprises: determining the replaceable step as an equivalent step in the at least one execution step; the equivalent step comprises at least two execution steps with a similarity greater than or equal to a preset threshold; determining the replacement step as any execution step in the equivalent step.
6. The method of claim 5, wherein, The at least one execution step comprises a first execution step, and the determination of the equivalent step in the execution step included in the at least one use case comprises: establishing a first step model of the first execution step; the first step model comprises an object, a behavior, a precondition and an expected result of the first execution step, the object is used to indicate an object involved in the first execution step, the behavior is used to indicate an algorithm and input data of the first execution step, the precondition is used to indicate a pre-conditional environment state of the first execution step, and the expected result is used to indicate an execution result expected by the first execution step; determining the similarity between the first step model and a step model of each execution step in other execution steps; the similarity comprises object similarity, behavior similarity, precondition similarity and expected result similarity in the step model, and the other execution steps refer to execution steps other than the first execution step in the multiple execution steps; in a case where a second step model of a second execution step in the other execution steps has a similarity with the first step model greater than or equal to the preset threshold, determining that the equivalent step comprises the first execution step and the second execution step.
7. The method according to any one of claims 1 to 6, characterized in that, The replacement of the replaceable step with the first execution result during the execution of the at least one use case comprises: replacing the replaceable step with the first execution result during the execution of the at least one use case; running the replaced at least one use case to obtain a total execution result of the at least one use case.
8. The method of claim 7, wherein, merge a path tree set including a path corresponding to each of the at least one use case, the path tree set including at least one merged path tree, the merged path tree being generated with execution steps of the at least one use case as nodes, one node in the merged path tree corresponding to an execution step of one or more use cases; the using the first execution result to replace the replaceable step during execution of the at least one use case includes: determining, according to an execution step corresponding to each node of the path tree set, that an execution result of the execution step corresponding to the each node corresponds to the each node; the running the at least one use case after replacement to obtain a total execution result of the at least one use case includes: combining, according to a path of the path tree set, an execution result of each execution step corresponding to each node in the path to obtain the total execution result of the at least one use case.
9. The method of claim 8, wherein, each node of the path tree set includes a node corresponding to the replaceable step and a node corresponding to a non-replaceable step.
10. The method according to claim 8 or 9, characterized in that, the replaceable step is any execution step in equivalent steps, and the construction process of the path tree set includes: constructing a full-step tree according to a use case model of the at least one use case, the use case model including a running sequence of execution steps of a use case, one node in the full-step tree corresponding to one execution step; replacing a node corresponding to the equivalent step in the full-step tree with the replaceable step; performing path optimization on the full-step tree to obtain the path tree set.
11. The method according to any one of claims 7-10, characterized in that, the at least one use case includes a first use case, and the running the at least one use case after replacement to obtain a total execution result of the at least one use case includes: running the first use case after replacement according to an execution result corresponding to each execution step in the first use case and a weight to obtain a total execution result of the first use case and a weighted average value, the total execution result of the first use case being greater than the weighted average value indicating that the first use case is executed successfully.
12. The method according to any one of claims 1-11, characterized in that, the use case is any one or more of the following: a test use case, a use case composed of a system inspection step, and a use case composed of a system operation step.
13. A use case execution apparatus characterized by comprising: the apparatus includes: an acquisition module configured to acquire at least one use case, each use case including at least one execution step, the at least one use case including a replaceable step; a determination module configured to determine a replaceable step corresponding to a replaceable step, a similarity between the replaceable step and the replaceable step being greater than or equal to a preset threshold; the acquisition module is further configured to acquire a first execution result of the replaceable step; an execution module configured to replace the replaceable step with the first execution result during execution of the at least one use case.
14. The apparatus of claim 13, wherein, the determination module is specifically configured to determine that the replaceable step is a first replaceable step in a replaceable step set similar to the replaceable step; the acquisition module is specifically configured to determine that the first execution result is an execution result of the first replaceable step in the replaceable step set.
15. The apparatus of claim 14, wherein, The replacement step set is a set of at least one execution step included in the at least one use case.
16. The apparatus of claim 15, wherein, The replacement step set is a set of execution steps other than the execution step included in the at least one use case.
17. The apparatus of claim 13, wherein, The determination module is specifically configured to determine that the replaceable step is an equivalent step in the at least one execution step; the equivalent step includes at least two execution steps with a similarity greater than or equal to a preset threshold; and the replacement step is determined as any execution step in the equivalent step.
18. The apparatus of claim 17, wherein, The at least one execution step includes a first execution step, and the determination module is specifically configured to establish a first step model of the first execution step; the first step model includes an object, a behavior, a precondition and an expected result of the first execution step, the object is used to indicate an object involved in the first execution step, the behavior is used to indicate an algorithm and input data of the first execution step, the precondition is used to indicate a pre-existing environmental state of the first execution step, and the expected result is used to indicate an expected execution result of the first execution step; determine the similarity of the first step model and the step model of each execution step in other execution steps; the similarity includes object similarity, behavior similarity, precondition similarity and expected result similarity in the step model; the other execution steps refer to the execution steps other than the first execution step in the multiple execution steps; in a case where a second step model of a second execution step in the other execution steps has a similarity to the first step model greater than or equal to the preset threshold, it is determined that the equivalent step includes the first execution step and the second execution step.
19. The apparatus of any of claims 13-18, wherein, The execution module is specifically configured to replace the replaceable step with the first execution result during execution of the at least one use case; and run the at least one use case after replacement to obtain a total execution result of the at least one use case.
20. The apparatus of claim 19, wherein, The execution module is specifically configured to determine, according to the execution step corresponding to each node of the merged path tree set, that the execution result of the execution step corresponding to each node corresponds to the each node; and combine the execution result of each execution step corresponding to each node in the path according to the path of the merged path tree set to obtain a total execution result of the at least one use case.
21. The apparatus of claim 20, wherein, Each node of the merged path tree set includes a node corresponding to the replacement step and a node corresponding to a non-replaceable step.
22. The apparatus of claim 20 or 21, wherein, The replacement step is any one of the equivalent steps, and the execution module is further configured to construct a full-step tree according to a use case model of the at least one use case; the use case model comprises a running sequence of execution steps of the use case, and one node in the full-step tree corresponds to one execution step; the nodes corresponding to the equivalent steps in the full-step tree are replaced by the replacement steps; and path optimization is performed on the full-step tree to obtain the merged path tree set.
23. The apparatus of any one of claims 19-22, wherein, The at least one use case comprises a first use case, and the execution module is specifically configured to run the first use case after the replacement according to execution results corresponding to each execution step in the first use case and a weight, to obtain a total execution result and a weighted average value of the first use case; and the first use case is executed successfully when the total execution result of the first use case is greater than the weighted average value.
24. The apparatus of any one of claims 13-23, wherein, The use case is any one or more of the following: a test use case, a use case composed of patrol steps of system patrol, and a use case composed of operation steps of system operation.
25. A computer program product, characterised in that, The computer program is configured to perform the operation steps of the method in any one of claims 1-12 when the computer program runs on a computer.
26. A cluster of computing devices, characterized in that, The at least one computing device is configured to perform the operation steps of the method in any one of claims 1-12.
27. A computer storage medium, comprising, The computer software instructions are configured to perform the operation steps of the method in any one of claims 1-12 when the computer software instructions run in a controller.
Citation Information
Patent Citations
Method and system for optimizing test suite comprising plurality of test cases
CN106959920A
Test case multiplexing method and device, electronic equipment and computer storage medium
CN115469861A
Test case multiplexing method and system based on spectral clustering
CN118051442A
Automated verification of a test model for a plurality of defined BDD test scenarios
US20220334954A1