Method and apparatus for batch generation of test cases and computing device

By obtaining the test functions of the target software product and its corresponding action factors and data factors, using a combination algorithm to combine the data factors, batch generation of test cases, solving the problems of low efficiency and missed test cases in the existing technology, and achieving efficient and comprehensive testing.

WO2025107595A1PCT designated stage expired Publication Date: 2025-05-30HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2024/099585
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-22
Filing Date
2024-06-17
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The generation efficiency of test cases in the prior art is low and prone to missed testing problems, resulting in incomplete testing.

Method used

By obtaining the test functions of the target software product and its corresponding action factors and data factors, using a combination algorithm to combine the data factors, batch generation of test cases, and avoid manual writing.

Benefits of technology

It significantly improves the generation efficiency of test cases, avoids missed testing problems, and improves the stability of the test system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024099585_30052025_PF_FP_ABST
    Figure CN2024099585_30052025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a method and apparatus for batch generation of test cases, and a computing device. The method comprises: acquiring a function to be tested of a target software product; acquiring an action factor and a data factor corresponding to said function; the action factor is used to describe at least one of the following types of information in a test case: a pre-condition, a test step, and an expected result; the data factor comprises at least one test input parameter corresponding to said function, and multiple values of each test input parameter; combining the plurality of values of the at least one test input parameter, and obtaining multiple data combination results; on the basis of the action factor and the multiple data combination results, generating a plurality of corresponding test cases in batches; and displaying the generated multiple test cases to a user. The described method can not only increase the efficiency of generating test cases, but also avoid the problem of missed testing.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device and computing equipment for batch generating test cases

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on November 20, 2023, with application number 202311554894.4 and application name “A processing framework and method for downshift training”, and the Chinese patent application filed with the State Intellectual Property Office of China on December 22, 2023, with application number 202311790614.X and application name “Method, device and computing device for batch generation of test cases”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of software testing, and more specifically, to a method, apparatus, and computing device for batch generating test cases. Background Art

[0003] A test case is a description of a test task for a specific software product, reflecting the test plan, methods, techniques, and strategies. Its contents include the test objectives, test environment, input data, test steps, expected results, test scripts, etc., which are ultimately documented. A test case mainly contains four parts: the use case title, preconditions, test steps, and expected results. The use case title mainly describes a function that needs to be tested; the preconditions refer to the steps before executing the test case; the test steps mainly describe the operational steps of the test case during execution, which are mainly for testers to understand how the test case operates; the expected results refer to the test results that are expected to be obtained after the test case is executed, and its purpose is to guide testers to observe whether the test has passed.

[0004] With the development of technology, the functions of current products are becoming more and more complex. When testing the functions of products, more and more test functions are involved. How to ensure the completeness of test cases and improve the efficiency of test case generation has become urgent.

[0005] In all existing test case generation schemes, testers write each test case individually based on their personal experience. This process relies on manual effort by testers, which, on the one hand, consumes a significant amount of time and lacks the ability to clearly express the dependencies between test cases, resulting in low test case generation efficiency. Furthermore, testers may miss tests during the test case design process.

[0006] Therefore, how to improve the efficiency of test case generation has become a technical problem that needs to be solved urgently.

[0007] Summary of the Invention

[0008] The present application provides a method, apparatus, and computing device for batch generating test cases. This method can improve the efficiency of test case generation on the one hand, and avoid the problem of missed tests during the test case design process on the other hand.

[0009] In a first aspect, a method for batch generating test cases is provided, the method comprising: obtaining a function to be tested of a target software product; obtaining an action factor and a data factor corresponding to the function to be tested, wherein the action factor is used to describe at least one of the following information in the test case: a precondition, a test step, and an expected result, and the data factor comprises at least one test input parameter corresponding to the function to be tested and multiple values ​​of each test input parameter; combining multiple values ​​of at least one test input parameter to obtain multiple data combination results; batch generating corresponding multiple test cases according to the action factor and the multiple data combination results, the multiple test cases being used to test the function to be tested of the target software product; and displaying the generated multiple test cases to a user.

[0010] In the above technical solution, by batch-generating corresponding test cases based on the action factors and the multiple data combination results, on the one hand, it can avoid the tester (also known as the user) from manually writing test cases one by one for the function to be tested in the target software product, thereby significantly improving the efficiency of test case generation. On the other hand, by combining multiple values ​​of at least one test input parameter to obtain multiple data combination results, it can avoid problems such as missed tests and incomplete tests caused by the tester's experience, thereby improving the stability of the system to be tested.

[0011] In combination with the first aspect, in certain implementations of the first aspect, the action factor and the data factor corresponding to the function to be tested are obtained from a test experience library.

[0012] In the above technical solution, by obtaining action factors and data factors from the test experience library, it is possible to avoid relying on the personal experience of testers, reduce problems such as missed tests and incomplete tests, and improve the stability of the system under test.

[0013] For example, the aforementioned test experience library is typically developed by owners such as test managers, who systematically summarize and extract relevant elements of test design from both forward and reverse perspectives. This creates a common set of test design objects, patterns, assets, definitions, or constraints, ensuring a more comprehensive and accurate test design. Test factors, which are common elements influencing the test process, such as test conditions and values, and test operations, are extracted as action factors and data factors, respectively. This enables data and business stratification, promotes repeatability in the test design process, reduces test design difficulty, and significantly improves work efficiency.

[0014] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: obtaining the user-defined information: the weight of the value of the test input parameter in the multiple data combination results, the weight of the value of the combination of multiple test input parameters in the multiple data combination results, the constraint conditions corresponding to the test input parameter, or the correlation strength between multiple test input parameters; based on at least one of the user-defined information, combining multiple values ​​of at least one test input parameter to obtain the multiple data combination results.

[0015] In the above technical solution, in the process of obtaining the above multiple data combination results, the user's own definition and / or constraints on the data can be combined to make the generated test cases more suitable for the actual test scenario.

[0016] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: obtaining a combination algorithm selected by the user; and combining multiple values ​​of at least one test input parameter according to the combination algorithm to obtain multiple data combination results.

[0017] In combination with the first aspect, in some implementations of the first aspect, the combination algorithm includes at least one of the following: full combination, single selection combination, basic selection combination, or customized N-wise combination.

[0018] In combination with the first aspect, in some implementations of the first aspect, the multiple test cases are generated based on a mind map.

[0019] In the above technical solution, test cases are designed through mind mapping, making the test design process more intuitive and convenient for testers, and effectively improving the test design efficiency.

[0020] In combination with the first aspect, in certain implementations of the first aspect, the method is applied to a cloud management platform, which is used to manage an infrastructure for providing cloud services, wherein the infrastructure includes at least one cloud data center, and each cloud data center is provided with at least one server.

[0021] In a second aspect, a device for batch generating test cases is provided, the device comprising: an acquisition module, a combination module, a generation module, and a presentation module. The acquisition module is used to acquire a function to be tested of a target software product; the acquisition module is further used to acquire an action factor and a data factor corresponding to the function to be tested, wherein the action factor is used to describe at least one of the following information in the test case: preconditions, test steps, and expected results; the data factor includes at least one test input parameter corresponding to the function to be tested and multiple values ​​for each test input parameter; the combination module is used to combine multiple values ​​of the at least one test input parameter to obtain multiple data combination results; the generation module is used to batch generate multiple corresponding test cases based on the action factor and the multiple data combination results, wherein the multiple test cases are used to test the function to be tested of the target software product; and the presentation module is used to present the generated multiple test cases to a user.

[0022] In combination with the second aspect, in some implementations of the second aspect, the acquisition module is specifically used to: acquire the action factor and the data factor corresponding to the function to be tested from a test experience library.

[0023] In combination with the second aspect, in certain implementations of the second aspect, the acquisition module is also used to obtain the user-defined information: the weight of the value of the test input parameter in the multiple data combination results, the weight of the value of the combination of multiple test input parameters in the multiple data combination results, the constraint conditions corresponding to the test input parameter, or the correlation strength between multiple test input parameters; the combination module is specifically used to: combine multiple values ​​of at least one test input parameter according to at least one of the user-defined information to obtain the multiple data combination results.

[0024] In combination with the second aspect, in certain implementations of the second aspect, the acquisition module is also used to obtain the combination algorithm selected by the user; the combination module is specifically used to: combine multiple values ​​of at least one test input parameter according to the combination algorithm to obtain multiple data combination results.

[0025] In conjunction with the second aspect, in certain implementations of the second aspect, the combination algorithm includes at least one of the following: full combination, single selection combination, basic selection combination, or customized N-wise combination.

[0026] In combination with the second aspect, in some implementations of the second aspect, the multiple test cases are generated based on a mind map.

[0027] In combination with the second aspect, in certain implementations of the second aspect, the device is applied to a cloud management platform, which is used to manage an infrastructure for providing cloud services, wherein the infrastructure includes at least one cloud data center, and each cloud data center is provided with at least one server.

[0028] In a third aspect, a computing device is provided, comprising a processor and a memory, and optionally, an input / output interface. The processor is configured to control the input / output interface to send and receive information, the memory is configured to store a computer program, and the processor is configured to retrieve and execute the computer program from the memory, so as to perform the method of the first aspect or any possible implementation of the first aspect.

[0029] Optionally, the processor may be a general-purpose processor, which may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated into the processor or located independently of the processor.

[0030] In a fourth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.

[0031] In a fifth aspect, a chip is provided, which obtains instructions and executes the instructions to implement the method in the above-mentioned first aspect and any implementation manner of the first aspect.

[0032] Optionally, as an implementation, the chip includes a processor and a data interface, and the processor reads instructions stored in the memory through the data interface to execute the method in the above-mentioned first aspect and any implementation of the first aspect.

[0033] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored on the memory. When the instructions are executed, the processor is used to execute the method in the first aspect and any one of the implementation methods of the first aspect.

[0034] In a sixth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device, the computing device executes the method in the first aspect and any one of the implementations of the first aspect.

[0035] In a seventh aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect and any one of the implementations of the first aspect.

[0036] In an eighth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method as described in the first aspect and any one of the implementations of the first aspect.

[0037] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and a hard drive.

[0038] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium.

[0039] In a ninth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to the first aspect and any one of the implementations of the first aspect.

[0040] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and a hard drive.

[0041] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] FIG1 is a schematic diagram of a cloud scenario applied to an embodiment of the present application.

[0043] FIG2 is a schematic flowchart of a method for batch generating test cases provided in an embodiment of the present application.

[0044] FIG3 is a schematic structural diagram of a mind map-based test case generation method provided in an embodiment of the present application.

[0045] FIG4 is a schematic diagram of a specific mind map provided in an embodiment of the present application.

[0046] FIG5 is an interface for generating test cases presented to a user, provided in an embodiment of the present application.

[0047] FIG6 is a schematic block diagram of an apparatus 600 for batch generating test cases provided in an embodiment of the present application.

[0048] FIG7 is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of the present application.

[0049] FIG8 is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of the present application.

[0050] FIG9 is a schematic diagram of a network connection between computing devices 1500A and 1500B provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The technical solution in this application will be described below with reference to the accompanying drawings.

[0052] This application will present various aspects, embodiments, or features around systems including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.

[0053] Additionally, in the embodiments of this application, words such as "exemplary" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.

[0054] In the embodiments of the present application, “corresponding” and “relevant” may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are consistent.

[0055] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0056] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0057] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0058] 1. Test case

[0059] A test case is a description of the testing task for a specific software product, reflecting the test plan, methods, techniques, and strategies. It includes test objectives, test environment, input data, test steps, expected results, test scripts, and other content, ultimately forming a document.

[0060] A test case consists of four main components: a title, preconditions, test steps, and expected results. The title primarily describes the functionality to be tested; preconditions refer to the steps required to execute the test case; test steps describe the steps to be taken during test execution, primarily to help testers understand how the test case operates; and expected results refer to the desired outcome after executing the test case, guiding testers in determining whether the test has passed.

[0061] Test cases verify whether the software meets customer requirements, reflect the tester's workload, and demonstrate the design process of the test case. The process of writing a test case typically includes steps such as requirements analysis, test point extraction, test case design, and test case review. In short, test cases are important documents in the software testing process, providing guidance to testers and ensuring that the quality and performance of the software product meet expectations.

[0062] 2. Test function

[0063] Test function can also be called test function point, which refers to testing a specific function of software or system to confirm the correctness, stability and availability of the function.

[0064] For example, the testing functions of an APP may include: a) security testing, such as the risk of software permission deduction and privacy leakage; b) testing of input validity verification, authentication, authorization, sensitive data storage, data encryption, etc.; c) testing of the user authorization level, data leakage, and unauthorized access of the App.

[0065] 3. Mind Map

[0066] A mind map is a graphical tool for organizing and expressing thoughts. It uses graphics, symbols, colors, and other elements to connect information, concepts, and ideas, helping people better understand and remember them. A mind map typically begins with a central node and then expands into multiple branches, each of which can further expand into more sub-nodes.

[0067] Mind maps have the following characteristics:

[0068] a) The central node is clear: The mind map takes a central node as the core, and all sub-nodes are expanded around this central node.

[0069] b) Clear hierarchy: Each node and sub-node in the mind map is arranged according to its importance, with important nodes in front and sub-nodes in the back, making the thinking process more organized.

[0070] c) Graphical presentation: Mind maps use graphics, symbols, colors and other elements to connect information, concepts, ideas, etc., making the thinking process more intuitive and easy to understand.

[0071] d) Stimulate creativity: Mind mapping can help people think about problems from different perspectives and stimulate people's creativity.

[0072] e) Improve memory: By organizing information into a mind map, it helps people remember and understand the information better.

[0073] Mind maps can be created by hand or using software tools. Hand-drawn mind maps can better express personal thoughts and ideas, while software tools make creating and editing mind maps more convenient and quick. Common mind mapping software includes MindManager, XMind, MindNode, etc. In short, mind mapping is a very useful thinking tool that can help people better organize and express their thoughts, improving work and study efficiency.

[0074] With the development of technology, the functions of current products are becoming more and more complex. When testing the functions of products, more and more test functions are involved. How to ensure the completeness of test cases and improve the efficiency of test case generation has become urgent.

[0075] In existing test case generation schemes, testers write each test case one by one based on their personal experience. This test case generation process has the following problems:

[0076] 1. It needs to rely on manual operation of testers. Testers will invest a lot of time in the design process of test cases, and cannot clearly express the correlation between test cases, which makes the test case generation efficiency low.

[0077] 2. Since it relies on manual operations by testers, testers may miss tests during the test case design process.

[0078] In view of this, an embodiment of the present application provides a method for batch generating test cases, which can not only improve the efficiency of test case generation, but also avoid the problem of missed tests in the test case design process.

[0079] In one possible implementation, the method provided in the embodiment of the present application can be applied to a cloud scenario as a product related to test cases in the cloud scenario, and sold to users in the form of a cloud service (a cloud service that generates test cases).

[0080] For the convenience of description, the cloud scenario is described in detail below with reference to FIG1 .

[0081] FIG1 is a schematic block diagram of a cloud scenario applicable to an embodiment of the present application. As shown in FIG1 , the cloud scenario may include: a cloud management platform 110 , the Internet 120 , and a client 130 .

[0082] As shown in Figure 1, the cloud management platform 110 is used to manage the infrastructure that provides multiple cloud services. The infrastructure includes multiple cloud data centers, each of which includes multiple servers, each of which includes cloud service resources to provide corresponding cloud services to tenants.

[0083] The cloud management platform 110 can be located in a cloud data center, which can provide an access interface (such as an interface or an application program interface (API)). The tenant can operate the client 130 to remotely access the access interface to register a cloud account and password on the cloud management platform 110, and log in to the cloud management platform 110. After the cloud management platform 110 successfully authenticates the cloud account and password, the tenant can further pay to select and purchase a virtual machine with specific specifications (processor, memory, disk) on the cloud management platform 110. After the payment is successful, the cloud management platform 110 provides the remote login account and password of the purchased virtual machine, and the client 130 can remotely log in to the virtual machine, install and run the tenant's application in the virtual machine. Therefore, the tenant can create, manage, log in and operate virtual machines in the cloud data center through the cloud management platform 110. Among them, the virtual machine can also be called a cloud server (elastic compute service, ECS) or an elastic instance (different cloud service providers have different names).

[0084] It should be understood that tenants of cloud services can be individuals, enterprises, schools, hospitals, administrative agencies, etc.

[0085] The functions of the cloud management platform 110 include, but are not limited to, a user console, computing management services, network management services, storage management services, authentication services, and image management services. The user console provides an interface or API for interacting with tenants. The computing management service is used to manage servers running virtual machines and containers, as well as bare metal servers. The network management service is used to manage network services (such as gateways and firewalls). The storage management service is used to manage storage services (such as data bucket services). The authentication service is used to manage tenant accounts and passwords. The image management service is used to manage virtual machine images. Tenants can use the client 130 to log in to the cloud management platform 110 via the Internet 120 to manage the rented cloud services.

[0086] In an embodiment of the present application, the tenant can also log in to the cloud management platform 110 through the client 130 and pay for the service of generating test cases on the cloud management platform 110. After the payment is successfully purchased, the cloud management platform 110 generates test cases for the tenant by executing the method provided in the embodiment of the present application on the server of the cloud data center based on the service purchased by the user.

[0087] Below, in conjunction with Figure 2, a method for generating test cases provided by an embodiment of the present application is described in detail. It should be understood that the example of Figure 2 is only to help those skilled in the art understand the embodiment of the present application, rather than to limit the application embodiment to the specific numerical values ​​or specific scenarios illustrated in Figure 2. Those skilled in the art can obviously make various equivalent modifications or changes based on the following examples given in Figure 2, and such modifications and changes also fall within the scope of the embodiment of the present application.

[0088] Figure 2 is a schematic flow chart of a method for batch generating test cases provided by an embodiment of the present application. As shown in Figure 2, the method may include steps 210-240, which are described in detail below.

[0089] Step 210: Obtain the function to be tested of the target software product.

[0090] As an example, when designing a test task for a target software product, a tester (who may also be called a user) may determine one or more corresponding functions to be tested according to the target software product.

[0091] For example, taking the target software product as a mobile phone, the function to be tested may be testing the camera function of the mobile phone.

[0092] Step 220: Obtain a target action factor and a target data factor corresponding to the function to be tested.

[0093] In an embodiment of the present application, a target action factor and a target data factor corresponding to the function to be tested of a target software product can be obtained. The target action factor is used to describe at least one of the following information in a test case: preconditions, test steps, and expected results. The target data factor includes at least one test input parameter corresponding to the function to be tested and multiple values ​​for each test input parameter.

[0094] For example, if the function to be tested is the camera function of a mobile phone, the target data factors may include, but are not limited to, the following test input parameters (also called variables) and the values ​​of each test input parameter: exposure mode, flash mode, ISO, pixels, and scene mode. The target action factors can be used to describe the preconditions and test steps for testing the camera function of the mobile phone. For example, the precondition is that the mobile phone provides personalized photography, and the test steps are to take photos with pixels set to ***, flash mode to ***, ISO to ***, exposure mode to ***, and scene mode to ***.

[0095] It should be understood that the above “***” refers to the values ​​of various test input parameters.

[0096] There are many ways to implement the above-mentioned acquisition of the function to be tested, which are not specifically limited in the present embodiment. Several possible implementations are described below.

[0097] As an example, based on the function to be tested of the target software product, the action factors and data factors corresponding to the function to be tested can be selected from the test experience library. In this implementation method, the test experience library needs to be built in advance. Specifically, the test experience library is usually formed by the owner role such as the test manager from a forward and reverse perspective. After systematically summarizing and extracting the relevant elements in the test design, a common test design object, pattern, asset, definition or constraint set is formed to ensure that the test design is more comprehensive and accurate. Test factors are common elements that affect the test process, such as test conditions and values, test operations, etc., which are extracted as action factors and data factors respectively to achieve data and business stratification, promote the repeatability of the test design process, reduce the difficulty of test design, and greatly improve work efficiency.

[0098] For example, the above-mentioned action factors include but are not limited to: factor name, factor number, factor description, applicable products, factor operation, pre-conditions, expected results, etc. The above-mentioned data factors include but are not limited to: factor name, factor number, factor description, applicable products, variable name, data valid value, data invalid value, etc.

[0099] For another example, if the test experience library does not have an action factor and a data factor corresponding to the test function, a temporary action factor and a temporary data factor may be generated.

[0100] Step 230: Combine multiple values ​​of at least one test input parameter to obtain multiple data combination results.

[0101] In an embodiment of the present application, multiple values ​​of at least one test input parameter may be combined to obtain multiple data combination results.

[0102] In a possible implementation, the combination algorithm selected by the user may be obtained, and multiple values ​​of at least one test input parameter may be combined according to the combination algorithm selected by the user to obtain multiple data combination results.

[0103] There are many ways to implement the above-mentioned combination algorithm, which is not specifically limited in the embodiments of this application. As examples, the combination algorithm may include, but is not limited to: full combination, single selection combination, basic selection combination, and customized N-wise combination. Testers can select the corresponding combination algorithm based on actual testing requirements and combine the values ​​of the acquired data factors based on the selected combination algorithm.

[0104] The following is an explanation of the several combination algorithms listed above.

[0105] All combinations (AC) refer to all combinations of every value of each input.

[0106] Single choice combination (EC) means that every value of each test input appears at least once in the left and right combination results.

[0107] Basic choice (BC) refers to creating a new combination based on the basic combination by changing the value of an input.

[0108] Custom N-wise combinations cover all possible combinations of any N inputs. This applies when N is an odd number. For example, when N = 2, test data generation is most efficient. Therefore, pair-wise combination algorithms for N = 2 are widely used.

[0109] Optionally, in some embodiments, to better align with the actual scenario to be tested, the present application also provides the following functions for testers to select, thereby flexibly constructing a model of the actual scenario to be tested. That is, in the process of obtaining the above-mentioned multiple data combination results, user-defined information can also be combined to make the generated test case more consistent with the actual scenario to be tested.

[0110] 1. Customize the weights of the values ​​in the data factors according to the actual business situation;

[0111] 2. Customize weights for combinations of multiple data factors based on actual business conditions;

[0112] 3. Customize constraints on data factors based on actual business conditions;

[0113] 4. Customize the correlation strength definition for multiple data factors based on actual business conditions.

[0114] Step 240: Generate multiple corresponding test cases in batches according to the action factor and the multiple data combination results, and display the generated multiple test cases to the user.

[0115] In the embodiment of the present application, multiple test cases corresponding to the action factors and the multiple data combination results can be generated in batches, and the generated multiple test cases can be displayed to the user, so that the user can test the functions to be tested of the target software product according to the generated multiple test cases.

[0116] In the above technical solution, testers (also known as users) can quickly generate test cases in batches based on a combination of action factors and data factors, avoiding repeated manual writing of test cases for the test functions of software products, thereby significantly improving the efficiency of test case generation.

[0117] In one implementation, the multiple test cases can be generated based on a mind map. The following describes in detail the method for generating a test case provided by the embodiment of the present application, taking the generation of a test case based on a mind map as an example.

[0118] As an example, the design of the scheme can be carried out according to the four-layer test design model based on the test case generated by the mind map.Specifically, as shown in Figure 3, the tester can first determine the test scenario according to the demand, and determine the test function according to the test scenario (for example, the target software product), and then select the corresponding action factor and data factor from the test experience library according to the test function.The tester can also select the combination algorithm provided by the embodiment of the present application according to the actual test demand, and combine the data factor based on the combination algorithm selected to obtain the combination factor, and finally generate multiple test cases in batches according to the action factor and the combination factor.The test case generated mainly includes four contents: use case title, precondition, test steps and expected results.

[0119] In the above technical solution, through the designed mind map, it supports the rapid construction of a four-layer test design model based on requirements and characteristics: requirements-》test scenarios-》test function points-》test cases. It supports the recommendation or custom selection of test factors based on product characteristics, making the test design process for testers more intuitive and convenient, and effectively improving the test design efficiency.

[0120] The following takes the test scenario of testing a mobile phone and the test function of testing the camera function of the mobile phone as an example, and combines Figures 4 and 5 to describe in detail a specific implementation process of generating test cases based on mind maps.

[0121] It should be understood that the examples in Figures 4 and 5 are merely intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated in Figures 4 and 5. Those skilled in the art can obviously make various equivalent modifications or variations based on the following examples given in Figures 4 and 5, and such modifications and variations also fall within the scope of the embodiments of the present application.

[0122] For example, suppose the tester determines the test scenario based on requirements to be testing a mobile phone. In this test phone scenario, one of the test functions is testing the phone's camera function. The tester draws the mind map shown in Figure 4 by hand or using a software tool. As shown in Figure 4, the mind map includes two nodes: one node is the test phone, and the other node is the test phone's camera function. The node for the test phone's camera function is a child node of the test phone node. After the tester determines that the test function is the test phone's camera function, they can right-click the test phone's camera function to obtain the test factors corresponding to this test function from the test experience library. As shown in Figure 5, suppose the test factors corresponding to the test phone's camera function selected by the tester from the test experience library include: exposure mode, flash mode, ISO, camera test, pixels, and scene mode. Among them, the test factor named "photo test" is an action factor, and the remaining test factors are data factors. After the test experience library selects the above 6 test factors corresponding to the camera function of the test mobile phone from the test experience library, the 6 test factors can be presented in the mind map shown in Figure 4, and the above 6 test factors serve as 6 sub-nodes of the test mobile phone camera function node.

[0123] It should be understood that the action factor can also be understood as a template for a test case, which includes at least one of the following contents in the test case: preconditions, test steps, expected results, etc. As an example, taking the mind map shown in Figure 4 as an example, the action factor is a photo test, and the action factor can include the preconditions and test steps in the test case template, wherein the precondition is that the mobile phone provides personalized photo taking, and the test steps are to take photos with the mobile phone according to the pixel value of ***, the flash mode of ***, the ISO value of ***, the exposure mode of ***, and the scene mode of ***. Here, "pixel value of ***, flash mode of ***, ISO value of ***, exposure mode of ***, and scene mode of ***" are the values ​​of the different data factors mentioned above.

[0124] In an embodiment of the present application, after obtaining the mind map shown in FIG4, the tester can generate a test case based on the mind map. Specifically, the tester right-clicks the camera function of the test phone and selects "Generate a test case" to obtain the interface for generating a test case as shown in FIG5. The interface is loaded with 6 test factors corresponding to the camera function of the test phone. The 6 test factors include action factors and data factors. The action factors include: photo test, and the data factors include: exposure mode, flash mode, ISO, pixels, and scene mode. The values ​​of the data factor named "exposure mode" include but are not limited to: automatic, manual, shutter priority, aperture priority; the values ​​of the data factor named "flash mode" include but are not limited to: automatic, forced flash, and flash off; the values ​​of the data factor named "ISO" include but are not limited to: automatic, 100, 160, 200; the values ​​of the data factor named "pixel" include but are not limited to: 300,000, 800,000, and 1.3 million; the values ​​of the data factor named "scene mode" include but are not limited to: automatic, portrait, landscape, and macro.

[0125] As shown in Figure 5, the interface for generating use cases provides testers with the following functions: selecting a combination algorithm for data factors, customizing data weights, customizing data constraints, etc. For example, suppose the tester selects five data factors: exposure mode, flash mode, ISO, pixels, and scene mode, and selects the pairwise combination algorithm to combine these five data factors. The tester also customizes the weight of the data factor named exposure mode. For example, the tester defines that the weight of the data factor with the value of "auto" for exposure mode is 5. The tester also customizes the data constraints of the data factors named pixels and ISO. For example, the tester defines that if the pixel value is 300,000, then the ISO value is 200.

[0126] For example, by clicking the “Combination Preview” button on the interface for generating a use case, the tester can obtain the combination results shown in Table 1.

[0127] Table 1 Combination results

[0128] In an embodiment of the present application, 18 test cases can be generated in batches according to the 18 combination results in Table 1, or the 18 combination results can be filtered to generate a corresponding number of test cases based on the filtered combination results.

[0129] For example, the following takes the first 8 combinations mentioned above as an example to introduce the corresponding 8 test cases generated.

[0130] 1. Test case 1 (generated based on the result of combination numbered 1):

[0131] This test case 1 mainly includes the following parts:

[0132] Use case title: automatic_automatic_automatic_800,000_automatic;

[0133] Design description: Test the camera function of the mobile phone;

[0134] Prerequisite: The mobile phone provides personalized photo taking function;

[0135] Test steps: Take photos with the exposure mode set to automatic, the flash mode set to automatic, the ISO set to automatic, the pixel setting to 800,000, and the scene mode set to automatic;

[0136] Expected result: Success.

[0137] 2. Test case 2 (generated based on the result of combination number 2):

[0138] This test case 2 mainly includes the following parts:

[0139] Use case title: Auto_Forced Flash_1000000_1.300000_Portrait;

[0140] Design description: Test the camera function of the mobile phone;

[0141] Prerequisite: The mobile phone provides personalized photo taking function;

[0142] Test steps: Take photos with the exposure mode set to automatic, the flash mode to forced flash, the ISO to 100, the pixels to 1.3 million, and the scene mode to portrait;

[0143] Expected result: Success.

[0144] 3. Test case 3 (generated based on the result of combination number 3):

[0145] This test case 3 mainly includes the following parts:

[0146] Use case title: Auto_Flash Off_1.6M_1.3M_Landscape;

[0147] Design description: Test the camera function of the mobile phone;

[0148] Prerequisite: The mobile phone provides personalized photo taking function;

[0149] Test steps: Take photos with the exposure mode set to automatic, the flash mode set to off, the ISO set to 160, the pixels set to 1.3 million, and the scene mode set to landscape;

[0150] Expected result: Success.

[0151] 4. Test case 4 (generated based on the result of combination numbered 4):

[0152] This test case 4 mainly includes the following parts:

[0153] Use case title: Auto_Off Flash_200_300,000_Macro;

[0154] Design description: Test the camera function of the mobile phone;

[0155] Prerequisite: The mobile phone provides personalized photo taking function;

[0156] Test steps: Take photos with the exposure mode set to automatic, the flash mode set to off, the ISO set to 200, the pixel set to 300,000, and the scene mode set to macro;

[0157] Expected result: Success.

[0158] 5. Test case 5 (generated based on the result of combination numbered 5):

[0159] This test case 5 mainly includes the following parts:

[0160] Use case title: Manual_Flash Off_Auto_1.3MP_Portrait;

[0161] Design description: Test the camera function of the mobile phone;

[0162] Prerequisite: The mobile phone provides personalized photo taking function;

[0163] Test steps: Take a photo with exposure mode set to manual, flash mode set to off, ISO set to automatic, pixel set to 1.3 million, and scene mode set to portrait;

[0164] Expected result: Success.

[0165] 6. Test case 6 (generated based on the result of combination number 6):

[0166] This test case 6 mainly includes the following parts:

[0167] Use case title: manual_automatic_100_800,000_landscape;

[0168] Design description: Test the camera function of the mobile phone;

[0169] Prerequisite: The mobile phone provides personalized photo taking function;

[0170] Test steps: Take photos with the exposure mode set to manual, the flash mode to automatic, the ISO to 100, the pixel size to 800,000, and the scene mode to landscape.

[0171] Expected result: Success.

[0172] 7. Test case 7 (generated based on the result of combination number 7):

[0173] This test case 7 mainly includes the following parts:

[0174] Use case title: Manual_Forced Flash_1.6MP_800,000MP_Macro;

[0175] Design description: Test the camera function of the mobile phone;

[0176] Prerequisite: The mobile phone provides personalized photo taking function;

[0177] Test steps: Take photos with the exposure mode set to manual, the flash mode to forced flash, the ISO to 160, the pixel to 800,000, and the scene mode to macro;

[0178] Expected result: Success.

[0179] 8. Test case 8 (generated based on the result of combination numbered 8):

[0180] This test case 8 mainly includes the following parts:

[0181] Use case title: Manual_Forced Flash_200_300,000_Auto;

[0182] Design description: Test the camera function of the mobile phone;

[0183] Prerequisite: The mobile phone provides personalized photo taking function;

[0184] Test steps: Take photos with exposure mode set to manual, flash mode to forced flash, ISO set to 200, pixel set to 300,000, and scene mode set to automatic;

[0185] Expected result: Success.

[0186] In the above technical solution, testers can quickly generate test cases in batches based on action factors and data factors referenced from the test experience library, avoiding repeated manual writing of test cases under test points, significantly improving the efficiency of test case generation, and the generated test cases have a unified structure, clear and intuitive.

[0187] The above describes in detail the method provided by the embodiment of the present application in conjunction with Figures 1 to 5. The following describes in detail the embodiment of the device of the present application in conjunction with Figures 6 to 9. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment. Therefore, for parts not described in detail, reference can be made to the above method embodiment.

[0188] Figure 6 is a schematic block diagram of an apparatus 600 for batch generating test cases, provided in an embodiment of the present application. The apparatus 600 can be implemented using software, hardware, or a combination of both. The apparatus 600 provided in an embodiment of the present application can implement the method flow shown in Figure 2 of the embodiment of the present application. The apparatus 600 includes: an acquisition module 610, a combination module 620, a generation module 630, and a presentation module 640. Among them, the acquisition module 610 is used to obtain the function to be tested of the target software product; the acquisition module 610 is also used to obtain the action factor and data factor corresponding to the function to be tested, wherein the action factor is used to describe at least one of the following information in the test case: preconditions, test steps, expected results, and the data factor includes at least one test input parameter corresponding to the function to be tested and multiple values ​​of each test input parameter; the combination module 630 is used to combine multiple values ​​of at least one test input parameter to obtain multiple data combination results; the generation module 640 is used to batch generate corresponding multiple test cases based on the action factor and the multiple data combination results, and the multiple test cases are used to test the function to be tested of the target software product; the display module is used to display the generated multiple test cases to the user.

[0189] Optionally, the acquisition module 610 is specifically configured to: acquire the action factor and the data factor corresponding to the function to be tested from the test experience library.

[0190] Optionally, the acquisition module 610 is also used to obtain the user-defined information: the weight of the value of the test input parameter in the multiple data combination results, the weight of the value of the combination of multiple test input parameters in the multiple data combination results, the constraint conditions corresponding to the test input parameter, or the correlation strength between multiple test input parameters; the combination module 620 is specifically used to: combine multiple values ​​of at least one test input parameter according to at least one of the user-defined information to obtain the multiple data combination results.

[0191] Optionally, the acquisition module 610 is further used to obtain the combination algorithm selected by the user; the combination module 620 is specifically used to: combine multiple values ​​of at least one test input parameter according to the combination algorithm to obtain multiple data combination results.

[0192] Optionally, the combination algorithm includes at least one of the following: full combination, single selection combination, basic selection combination, or customized N-wise combination.

[0193] Optionally, the multiple test cases are generated based on a mind map.

[0194] Optionally, the device 600 is applied to a cloud management platform, which is used to manage an infrastructure for providing cloud services. The infrastructure includes at least one cloud data center, and each cloud data center is provided with at least one server.

[0195] The apparatus 600 herein may be embodied in the form of a functional module. The term "module" herein may be implemented in the form of software and / or hardware, and is not specifically limited thereto.

[0196] For example, a "module" can be a software program, hardware circuit, or a combination of the two that implements the aforementioned functions. For example, the implementation of acquisition module 610 will be described below, using acquisition module 610 as an example. Similarly, the implementation of other modules, such as combination module 620, generation module 630, and presentation module 640, can refer to the implementation of acquisition module 610.

[0197] The acquisition module 610 is taken as an example of a software functional unit, and the acquisition module 610 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the acquisition module 610 may 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 may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Generally, a region may include multiple AZs.

[0198] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0199] As an example of a hardware functional unit, acquisition module 610 may include at least one computing device, such as a server. Alternatively, acquisition module 610 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0200] The multiple computing devices included in acquisition module 610 can be distributed in the same region or in different regions. The multiple computing devices included in acquisition module 610 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in acquisition module 610 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0201] Therefore, the modules of each example described in the embodiments of this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0202] It should be noted that: when the device provided in the above embodiment executes the above method, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. For example, the acquisition module 610 can be used to execute any step in the above method, the combination module 620 can be used to execute any step in the above method, the generation module 630 can be used to execute any step in the above method, and the display module 640 can be used to execute any step in the above method. The steps that the acquisition module 610, the combination module 620, the generation module 630, and the display module 640 are responsible for implementing can be specified as needed, and all the functions of the above device can be realized by respectively implementing different steps in the above method through the acquisition module 610, the combination module 620, the generation module 630, and the display module 640.

[0203] In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments above and will not be repeated here.

[0204] The method provided in the embodiment of the present application can be performed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a processing unit, a memory and a memory control unit, and the function and structure of the hardware are subsequently described in detail. The operating system is any one or more computer operating systems that implement business processing through a process, for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system or a Windows operating system. The application layer includes applications such as a browser, an address book, a word processing software, and an instant messaging software. Furthermore, optionally, the computer system is a handheld device such as a smart phone, or a terminal device such as a personal computer, and this application is not particularly limited, as long as the method provided in the embodiment of the present application can be used. The execution subject of the method provided in the embodiment of the present application can be a computing device, or a functional module in a computing device that can call a program and execute a program.

[0205] 7 , a computing device provided in an embodiment of the present application is described in detail below.

[0206] FIG7 is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of the present application. The computing device 1500 may be a server, a computer, or other device with computing capabilities. The computing device 1500 shown in FIG7 includes: at least one processor 1510 and a memory 1520.

[0207] It should be understood that this application does not limit the number of processors and memories in the computing device 1500.

[0208] The processor 1510 executes the instructions in the memory 1520 so that the computing device 1500 implements the method provided in this application. Alternatively, the processor 1510 executes the instructions in the memory 1520 so that the computing device 1500 implements the functional modules provided in this application, thereby implementing the method provided in this application.

[0209] Optionally, the computing device 1500 further includes a communication interface 1530. The communication interface 1530 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1500 and other devices or a communication network.

[0210] Optionally, the computing device 1500 further includes a system bus 1540, wherein the processor 1510, the memory 1520, and the communication interface 1530 are respectively connected to the system bus 1540. The processor 1510 can access the memory 1520 through the system bus 1540. For example, the processor 1510 can read and write data or execute code in the memory 1520 through the system bus 1540. The system bus 1540 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus. The system bus 1540 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in FIG7, but this does not mean that there is only one bus or one type of bus.

[0211] In one possible implementation, the processor 1510 is primarily responsible for interpreting computer program instructions (or codes) and processing data in the computer software. The computer program instructions and the data in the computer software may be stored in the memory 1520 or the cache 1516.

[0212] Optionally, the processor 1510 may be an integrated circuit chip having signal processing capabilities. By way of example and not limitation, the processor 1510 is a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor is a microprocessor, etc. For example, the processor 1510 is a central processing unit (CPU).

[0213] Optionally, each processor 1510 includes at least one processing unit 1512 and a memory control unit 1514 .

[0214] Processing unit 1512, also known as a core, is the most important component of a processor. Processing unit 1512 is manufactured from single-crystal silicon using a specific production process. All processor calculations, command reception, command storage, and data processing are performed by the core. Each processing unit independently executes program instructions, leveraging parallel computing capabilities to accelerate program execution. Each processing unit has a fixed logical structure. For example, a processing unit includes logical units such as a level 1 cache, a level 2 cache, an execution unit, an instruction-level unit, and a bus interface.

[0215] In one implementation example, the memory control unit 1514 is configured to control data exchange between the memory 1520 and the processing unit 1512. Specifically, the memory control unit 1514 receives memory access requests from the processing unit 1512 and controls access to the memory based on the memory access requests. By way of example and not limitation, the memory control unit is a device such as a memory management unit (MMU).

[0216] In one implementation example, each memory control unit 1514 addresses the memory 1520 via the system bus. An arbiter (not shown in FIG. 7 ) is configured in the system bus to handle and coordinate competing accesses by multiple processing units 1512 .

[0217] In an implementation example, the processing unit 1512 and the memory control unit 1514 are connected to each other via connection lines inside the chip, such as address lines, so as to achieve communication between the processing unit 1512 and the memory control unit 1514.

[0218] Optionally, each processor 1510 also includes a cache 1516, which is a buffer for data exchange (called a cache). When a processing unit 1512 needs to read data, it first searches the cache for the required data. If the data is found, it executes the request directly; if not, it searches the memory. Because the cache runs much faster than the memory, the cache helps the processing unit 1512 run faster.

[0219] Memory 1520 can provide runtime space for processes in computing device 1500. For example, memory 1520 stores computer programs (specifically, program code) used to generate processes. After the computer program is executed by the processor to generate a process, the processor allocates corresponding storage space for the process in memory 1520. Furthermore, the aforementioned storage space further includes a text segment, an initialized data segment, a bit-initialized data segment, a stack segment, a heap segment, and the like. Memory 1520 stores data generated during the execution of the process, such as intermediate data or process data, in the storage space corresponding to the aforementioned process.

[0220] Optionally, the memory is also called the internal memory. Its function is to temporarily store the data processed by the processor 1510 and the data exchanged with external storage such as a hard disk. As long as the computer is running, the processor 1510 will load the data to be calculated into the internal memory for calculation. When the calculation is completed, the processing unit 1512 will transmit the result.

[0221] By way of example and not limitation, memory 1520 is a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Non-volatile memory is read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory is random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory 1520 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0222] The structure of the computing device 1500 listed above is only an example, and the present application is not limited thereto. The computing device 1500 of the embodiment of the present application includes various hardware in the computer system in the prior art. For example, the computing device 1500 also includes other memories in addition to the memory 1520, such as disk storage, etc. Those skilled in the art should understand that the computing device 1500 may also include other devices necessary to achieve normal operation. At the same time, according to specific needs, those skilled in the art should understand that the above-mentioned computing device 1500 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the above-mentioned computing device 1500 may also include only the devices necessary to implement the embodiment of the present application, and does not necessarily include all the devices shown in Figure 7.

[0223] The present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0224] As shown in Figure 8, the computing device cluster includes at least one computing device 1500. The memory 1520 in one or more computing devices 1500 in the computing device cluster may store the same instructions for executing the above method.

[0225] In some possible implementations, the memory 1520 of one or more computing devices 1500 in the computing device cluster may also store some instructions for executing the above method. In other words, the combination of one or more computing devices 1500 can jointly execute the instructions of the above method.

[0226] It should be noted that the memory 1520 in different computing devices 1500 in the computing device cluster can store different instructions, each for performing part of the functions of the above-mentioned apparatus. In other words, the instructions stored in the memory 1520 in different computing devices 1500 can implement the functions of one or more modules in the above-mentioned apparatus.

[0227] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. The network can be a wide area network (WAN), a local area network (LAN), or the like. FIG9 illustrates one possible implementation. As shown in FIG9 , two computing devices 1500A and 1500B are connected via a network. Specifically, each computing device is connected to the network via a communication interface within the computing device.

[0228] It should be understood that the functionality of the computing device 1500A shown in FIG9 may also be implemented by multiple computing devices 1500. Similarly, the functionality of the computing device 1500B may also be implemented by multiple computing devices 1500.

[0229] This embodiment also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on a computing device, it causes the computing device to perform the method provided above, or causes the computing device to implement the functions of the apparatus provided above.

[0230] This embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of storing data on a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that, when executed on a computing device, cause the computing device to perform the method provided above.

[0231] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0232] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0233] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0234] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0235] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0236] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0237] If the functions are implemented 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 solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling 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 method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0238] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for batch generating test cases, characterized in that: The method comprises: Obtain the functions to be tested of the target software product; Acquire an action factor and a data factor corresponding to the function to be tested, wherein the action factor is used to describe at least one of the following information in the test case: preconditions, test steps, and expected results, and the data factor includes at least one test input parameter corresponding to the function to be tested and multiple values ​​of each of the test input parameters; Combining multiple values ​​of the at least one test input parameter to obtain multiple data combination results; Batch generate a plurality of corresponding test cases according to the action factors and the plurality of data combination results, wherein the plurality of test cases are used to test the function to be tested of the target software product; The generated multiple test cases are displayed to the user.

2. The method according to claim 1, characterized in that The obtaining of the action factor and the data factor corresponding to the function to be tested includes: The action factor and the data factor corresponding to the function to be tested are obtained from the test experience library.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining the user-defined information: the weight of the value of the test input parameter in the multiple data combination results, the weight of the combination of the values ​​of multiple test input parameters in the multiple data combination results, the constraint conditions corresponding to the test input parameter, or the correlation strength between multiple test input parameters; The combining of multiple values ​​of the at least one test input parameter to obtain multiple data combination results includes: According to at least one of the user-defined information, multiple values ​​of the at least one test input parameter are combined to obtain the multiple data combination results.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Obtaining the combination algorithm selected by the user; The combining of multiple values ​​of the at least one test input parameter to obtain multiple data combination results includes: According to the combination algorithm, multiple values ​​of the at least one test input parameter are combined to obtain multiple data combination results.

5. The method according to claim 4, characterized in that The combination algorithm includes at least one of the following: full combination, single selection combination, basic selection combination, or customized N-wise combination.

6. The method according to any one of claims 1 to 5, characterized in that The multiple test cases are generated based on a mind map.

7. The method according to any one of claims 1 to 6, characterized in that The method is applied to a cloud management platform, which is used to manage an infrastructure for providing cloud services. The infrastructure includes at least one cloud data center, and each of the cloud data centers is provided with at least one server.

8. A device for batch generating test cases, characterized in that: The device comprises: An acquisition module, used to acquire the functions to be tested of the target software product; The acquisition module is further used to acquire an action factor and a data factor corresponding to the function to be tested, wherein the action factor is used to describe at least one of the following information in the test case: a precondition, a test step, and an expected result, and the data factor includes at least one test input parameter corresponding to the function to be tested and multiple values ​​of each of the test input parameters; A combination module, used for combining multiple values ​​of the at least one test input parameter to obtain multiple data combination results; A generating module, used for batch generating a plurality of corresponding test cases according to the action factors and the plurality of data combination results, wherein the plurality of test cases are used for testing the function to be tested of the target software product; The display module is used to display the generated multiple test cases to the user.

9. The device according to claim 8, characterized in that The acquisition module is specifically used for: The action factor and the data factor corresponding to the function to be tested are obtained from the test experience library.

10. The device according to claim 8 or 9, characterized in that The acquisition module is further used to acquire the user-defined information: the weight of the value of the test input parameter in the multiple data combination results, the weight of the combination of the values ​​of multiple test input parameters in the multiple data combination results, the constraint conditions corresponding to the test input parameter, or the correlation strength between multiple test input parameters; The combined module is specifically used for: According to at least one of the user-defined information, multiple values ​​of the at least one test input parameter are combined to obtain the multiple data combination results.

11. The device according to any one of claims 8 to 10, characterized in that The acquisition module is further used to acquire the combination algorithm selected by the user; The combined module is specifically used for: According to the combination algorithm, multiple values ​​of the at least one test input parameter are combined to obtain multiple data combination results.

12. The device according to claim 11, characterized in that The combination algorithm includes at least one of the following: full combination, single selection combination, basic selection combination, or customized N-wise combination.

13. The device according to any one of claims 8 to 12, characterized in that The multiple test cases are generated based on a mind map.

14. The device according to any one of claims 8 to 13, characterized in that The device is applied to a cloud management platform, which is used to manage an infrastructure for providing cloud services. The infrastructure includes at least one cloud data center, and each of the cloud data centers is provided with at least one server.

15. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.

16. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 7.

17. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for generating test cases in batches and computing equipment

    CN120029900A

  • Interface test case generation method, apparatus, computer device, and storage medium

    CN109388561A

  • Method and device for generating a combined test case, storage medium and computer equipment

    CN109902002A

  • Method For Test Case Generation

    US20090094486A1

  • Simulation-based interface testing automation system and method for robot software components

    US20110307860A1

Cited By

  • Server item testing method and electronic equipment

    CN120448208A

  • Test case generation method and device, electronic equipment, medium and product

    CN121029630A

  • Document generation method and device, electronic equipment and medium

    CN121543556A