Method and device for generating test cases in batches and computing equipment
By obtaining and combining action factors and data factors in software testing, and using a combination algorithm to generate test cases, the problems of low efficiency and missed test cases in the existing technology are solved, and efficient and comprehensive test case generation is achieved.
Patent Information
- Application Number
- CN202311790614.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-20
- Filing Date
- 2023-12-22
- Publication Date
- 2025-05-23
AI Technical Summary
The prior art is inefficient and prone to missed testing problems when generating test cases, resulting in incomplete testing.
By obtaining the test functions, action factors and data factors of the target software product, combining data factors using a combination algorithm, batch generating test cases, and displaying the generated test cases in a mind map.
It significantly improves the generation efficiency of test cases, avoids inefficiency problems written by hand, and reduces the risk of missed testing through combined algorithms, and improves the stability of the test system.
Smart Images

Figure CN120029900A_ABST
Abstract
Description
[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office of China on November 20, 2023, with application number 202311554894.4, and the priority of the Chinese patent application entitled “Method and computing device for batch generation of use cases based on mind mapping”, all contents of which are incorporated by reference in 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, method, technology and strategy. Its contents include test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally form a document. A test case mainly contains four contents: case title, preconditions, test steps and expected results. Among them, the case title mainly describes a function that needs to be tested; the preconditions refer to the pre-steps for executing the test case; the test steps mainly describe the operation steps of the test case when executing, which is mainly to let the tester know how the test case operates; the expected result refers to the test result that the test case wants to get after executing, and its purpose is to guide the tester to observe whether the test passes.
[0004] With the development of science and 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 the relevant test case generation schemes, the testers write them one by one based on their personal experience. The test case generation process relies on the manual operation of the testers. On the one hand, the testers will spend a lot of time in the test case design process, and they cannot clearly express the correlation between the test cases, which makes the test case generation efficiency low. On the other hand, the testers may miss the test in 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. Summary of the invention
[0007] The present application provides a method, apparatus and computing device for batch generating test cases, which can improve the efficiency of test case generation on the one hand, and avoid the problem of missed tests in the test case design process on the other hand.
[0008] 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.
[0009] In the above technical solution, by batch-generating corresponding multiple test cases according to the action factor and the multiple data combination results, on the one hand, it can avoid the tester (also called the user) from manually writing test cases one by one under the function to be tested of 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 experience of the tester, thereby improving the stability of the system to be tested.
[0010] In combination with the first aspect, in certain implementations of the first aspect, an action factor and a data factor corresponding to the function to be tested are obtained from a test experience library.
[0011] 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 to be tested.
[0012] As an example, the above test experience library is usually formed by the owner roles such as test managers from the forward and reverse perspectives, after systematically summarizing and extracting the relevant elements in the test design, to form a set of common test design objects, patterns, assets, definitions or constraints to ensure that the test design is more comprehensive and accurate. Test factors are common factors 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.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the method also 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 strength of association 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.
[0014] 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 also be combined to make the generated test cases more suitable for the actual test scenario.
[0015] 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.
[0016] In combination with the first aspect, in certain 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.
[0017] In combination with the first aspect, in some implementations of the first aspect, the multiple test cases are generated based on a mind map.
[0018] In the above technical solution, test cases are designed through mind mapping, making the test design process of testers more intuitive and convenient, and effectively improving the test design efficiency.
[0019] 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.
[0020] In the 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 display module. The acquisition module is used to acquire the function to be tested of the target software product; the acquisition module is also used to acquire 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: precondition, 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 is used to combine multiple values of at least one test input parameter to obtain multiple data combination results; the generation module is used to batch generate multiple corresponding test cases according to 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.
[0021] In combination with the second aspect, in some implementations of the second aspect, the acquisition module is specifically used to: acquire action factors and data factors corresponding to the function to be tested from a test experience library.
[0022] 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 strength of association 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.
[0023] 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.
[0024] In combination 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.
[0025] In combination with the second aspect, in some implementations of the second aspect, the multiple test cases are generated based on a mind map.
[0026] 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.
[0027] In a third aspect, a computing device is provided, comprising a processor and a memory, and optionally, an input / output interface, wherein the processor is used to control the input / output interface to send and receive information, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the method in the first aspect or any possible implementation of the first aspect is executed.
[0028] Optionally, the processor may be a general-purpose processor, which may be implemented by hardware or software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated in the processor or located outside the processor and exist independently.
[0029] 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.
[0030] 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.
[0031] Optionally, as an implementation manner, 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 manner of the first aspect.
[0032] 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 in 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.
[0033] 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.
[0034] 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.
[0035] 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 in the above-mentioned first aspect and any one of the implementations of the first aspect.
[0036] 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 hard drive.
[0037] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium.
[0038] 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 in the first aspect and any one of the implementations of the first aspect.
[0039] 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 hard drive.
[0040] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of a cloud scenario applied to an embodiment of the present application.
[0042] Figure 2 It is a schematic flowchart of a method for batch generating test cases provided in an embodiment of the present application.
[0043] Figure 3 It is a schematic structural diagram of generating test cases based on a mind map provided in an embodiment of the present application.
[0044] Figure 4 It is a schematic diagram of a specific mind map provided in an embodiment of the present application.
[0045] Figure 5 This is an interface for generating test cases and displayed to users, provided in an embodiment of the present application.
[0046] Figure 6 It is a schematic block diagram of an apparatus 600 for batch generating test cases provided in an embodiment of the present application.
[0047] Figure 7 It is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of the present application.
[0048] Figure 8 It is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of the present application.
[0049] Fig. 9 It is a schematic diagram of the connection between computing devices 1500A and 1500B via a network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0051] The present application will present various aspects, embodiments or features around a system 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 devices, components, modules, etc. discussed in conjunction with the figures. In addition, combinations of these schemes may also be used.
[0052] In addition, in the embodiments of the present application, words such as "exemplary" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.
[0053] In the embodiments of the present application, "corresponding (corresponding, relevant)" and "corresponding (corresponding)" can sometimes be used interchangeably. It should be pointed out that when the distinction between them is not emphasized, the meanings they intend to express are consistent.
[0054] 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 of ordinary skill in the art can 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 also applicable to similar technical problems.
[0055] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0056] In the present application, "at least one" means one or more, and "plurality" 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 items 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.
[0057] 1. Test case
[0058] A test case is a description of a test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document.
[0059] A test case mainly contains four contents: case title, preconditions, test steps and expected results. Among them, the case title mainly describes a function that needs to be tested; the preconditions refer to the pre-steps for executing the test case; the test steps mainly describe the operation steps of the test case when executing, which is mainly to let the tester know how the test case operates; the expected result refers to the test result that the test case wants to get after executing, and its purpose is to guide the tester to observe whether the test passes.
[0060] The role of test cases includes checking whether the software meets customer needs, reflecting the workload of testers and showing the design ideas of test cases. The process of writing test cases usually includes steps such as requirement analysis, extracting test points, designing test cases, and conducting test case reviews. In short, test cases are important documents in the software testing process. They provide guidance for testers to ensure that the quality and performance of software products meet expectations.
[0061] 2. Test function
[0062] A test function can also be called a test function point, which refers to testing a specific function of the software or system to confirm the correctness, stability and availability of the function.
[0063] For example, the testing functions of an APP may include: a) security testing, such as the risk of software permission deductions and privacy leakage risks; b) testing of input validity verification, authentication, authorization, sensitive data storage, data encryption, etc.; c) testing of the user authorization level, data leakage, and illegal authorized access of the App.
[0064] 3. Mind Map
[0065] Mind mapping is a graphical tool for organizing thoughts and expressing ideas. It uses graphics, symbols, colors and other elements to connect information, concepts, ideas, etc. to help people better understand and remember. Mind maps usually start from a central node and then expand into multiple branch nodes, each of which can further expand into more sub-nodes.
[0066] Mind mapping has the following characteristics:
[0067] a) The central node is clear: The mind map is centered on a central node, and all sub-nodes are expanded around this central node.
[0068] 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.
[0069] 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.
[0070] d) Stimulate creativity: Mind mapping can help people think about problems from different perspectives and stimulate people's creativity.
[0071] e) Improve memory: By organizing information into a mind map, it helps people remember and understand the information better.
[0072] Mind maps can be made by hand or using software tools. Hand-drawn mind maps can better express personal thoughts and ideas, while software tools can make and edit mind maps more conveniently and quickly. 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 and improve work and study efficiency.
[0073] With the development of science and 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.
[0074] In the existing test case generation scheme, testers write each test case one by one based on their personal experience. The following problems exist in the process of generating test cases:
[0075] 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.
[0076] 2. Since it relies on manual operations by testers, testers may miss tests during the test case design process.
[0077] 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.
[0078] 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 for generating test cases).
[0079] For the convenience of description, the following Figure 1 , describe the cloud scenario in detail.
[0080] Figure 1 is a schematic block diagram of a cloud scenario applicable to an embodiment of the present application. Figure 1 As shown, the cloud scenario may include: a cloud management platform 110 , the Internet 120 , and a client 130 .
[0081] like Figure 1 As shown, 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 for tenants.
[0082] The cloud management platform 110 may be located in a cloud data center, which may provide an access interface (such as an interface or an application program interface (API)). The tenant may 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 may further pay to select and purchase a virtual machine of specific specifications (processor, memory, disk) on the cloud management platform 110. After the paid purchase is successful, the cloud management platform 110 provides the remote login account and password of the purchased virtual machine, and the client 130 may remotely log in to the virtual machine, install and run the tenant's application in the virtual machine. Therefore, the tenant may create, manage, log in and operate a virtual machine in the cloud data center through the cloud management platform 110. Among them, the virtual machine may also be called a cloud server (elastic compute service, ECS) or an elastic instance (different cloud service providers have different names).
[0083] It should be understood that tenants of cloud services can be individuals, enterprises, schools, hospitals, administrative agencies, etc.
[0084] The functions of the cloud management platform 110 include, but are not limited to, user console, computing management service, network management service, storage management service, authentication service, and image management service. The user console provides an interface or API to interact with tenants, the computing management service is used to manage servers running virtual machines and containers and bare metal servers, the network management service is used to manage network services (such as gateways, firewalls, etc.), 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, and 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 through the Internet 120 to manage the rented cloud services.
[0085] 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.
[0086] Let's combine Figure 2 , a method for generating a test case provided by an embodiment of the present application is described in detail. It should be understood that Figure 2 The examples are only 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 Figure 2 The specific numerical values or specific scenarios shown in the examples. Figure 2 The examples given below are obviously susceptible to various equivalent modifications or changes, and such modifications and changes also fall within the scope of the embodiments of the present application.
[0087] Figure 2 FIG. 1 is a schematic flow chart of a method for batch generating test cases provided by an embodiment of the present application. Figure 2 As shown, the method may include steps 210-240, and steps 210-240 are described in detail below.
[0088] Step 210: Obtain the function to be tested of the target software product.
[0089] 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.
[0090] For example, taking the target software product as a mobile phone, the above-mentioned function to be tested may be testing the camera function of the mobile phone.
[0091] Step 220: Obtain a target action factor and a target data factor corresponding to the function to be tested.
[0092] In the embodiment of the present application, the target action factor and the target data factor corresponding to the function to be tested can be obtained according to the function to be tested of the target software product. The target action factor is used to describe at least one of the following information in the test case: precondition, test steps, expected results, and the target data factor includes at least one test input parameter corresponding to the function to be tested and multiple values of each test input parameter.
[0093] For example, if the function to be tested is the camera function of the test mobile phone, the above 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, scene mode. The above target action factors can be used to describe the preconditions and test steps for testing the camera function of the test mobile phone. For example, the precondition is that the mobile phone provides personalized photography, and the test steps are to take photos according to the pixels as ***, the flash mode as ***, the ISO as ***, the exposure mode as ***, and the scene mode as ***.
[0094] It should be understood that the above “***” refers to the values of various test input parameters.
[0095] There are many ways to implement the above-mentioned acquisition of the function to be tested, which is not specifically limited in the embodiments of the present application. Several possible implementations are introduced below.
[0096] As an example, according to the function to be tested of the target software product, the action factor and data factor 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 the forward and reverse perspectives to systematically summarize and extract the relevant elements in the test design, and form a set of common test design objects, patterns, assets, definitions or constraints 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.
[0097] For example, the above action factors include but are not limited to: factor name, factor number, factor description, applicable products, factor operation, preset conditions, expected results, etc. The above 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.
[0098] For another example, if there are no action factors and data factors corresponding to the test function in the test experience library, a temporary action factor and a temporary data factor may be generated.
[0099] Step 230: Combine multiple values of at least one test input parameter to obtain multiple data combination results.
[0100] 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.
[0101] 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.
[0102] There are many ways to implement the above combination algorithm, which is not specifically limited in the embodiments of the present application. As an example, the combination algorithm may include but is not limited to: full combination, single selection combination, basic selection combination, and customized N-wise combination. The tester can select the corresponding combination algorithm according to the actual test requirements, and combine the values in the acquired data factors based on the selected combination algorithm.
[0103] The following is an explanation of the several combination algorithms listed above.
[0104] All combinations (AC) refer to all combinations of every value of each input.
[0105] Single choice combination (EC) means that every value of each test input appears at least once in the left and right combination results.
[0106] Basic choice combination (BC) refers to creating a new combination based on the basic combination by changing the value of an input.
[0107] Custom N-wise combination refers to the combination method that covers all combinations of any N inputs. When N is equal to an odd number, it is a full combination. For example, when N=2, the generated test data is most efficient, so the pair-wise combination algorithm when N=2 is widely used.
[0108] Optionally, in some embodiments, in order to be more in line with the actual scenario to be tested, the embodiments of the present application also provide the following functions for testers to select, so as to flexibly construct the actual scenario model to be tested. That is, in the process of obtaining the above-mentioned multiple data combination results, the user's own defined information can also be combined to make the generated test case more in line with the actual scenario to be tested.
[0109] 1. Customize the weights of the values in the data factors according to the actual business situation;
[0110] 2. Customize the weights of the combination of multiple data factors based on actual business conditions;
[0111] 3. Custom constraints can be set on data factors based on actual business conditions;
[0112] 4. Customize the correlation strength definition for multiple data factors based on actual business conditions.
[0113] Step 240: Batch generate corresponding multiple test cases according to the action factor and the multiple data combination results, and display the generated multiple test cases to the user.
[0114] In the embodiment of the present application, multiple corresponding test cases can be generated in batches according to the action factor and the multiple data combination results, 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.
[0115] In the above technical solution, testers (also called 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.
[0116] In one implementation, the above-mentioned multiple test cases can be generated based on a mind map. The following takes the generation of test cases based on a mind map as an example to describe in detail the method for generating tests provided in the embodiment of the present application.
[0117] As an example, the test cases generated based on the mind map can be designed according to the four-layer test design model. Figure 3 As shown, 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 selected combination algorithm to obtain the combination factor, and finally generate multiple test cases in batches according to the action factor and the combination factor. The generated test case mainly includes four contents: use case title, precondition, test steps and expected results.
[0118] 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, and supports the recommendation or custom selection of test factors based on product characteristics, making the test design process of testers more intuitive and convenient, and effectively improving the test design efficiency.
[0119] The following test scenario is to test the mobile phone, and the test function is to test the camera function of the mobile phone as an example. Figure 4-Figure 5 , a specific implementation process of generating test cases based on mind mapping is described in detail.
[0120] It should be understood that Figure 4-Figure 5The examples are only 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 Figure 4-Figure 5 The specific numerical values or specific scenarios shown in the examples. Figure 4-Figure 5 The examples given below are obviously susceptible to various equivalent modifications or changes, and such modifications and changes also fall within the scope of the embodiments of the present application.
[0121] For example, suppose the test scenario determined by the tester is to test the mobile phone according to the requirements. In this test scenario, one of the test functions is to test the camera function of the mobile phone. The tester draws the picture by hand or using software tools. Figure 4 The mind map shown is as follows: Figure 4 As shown in the figure, the mind map includes two nodes, one node is the test phone, and the other node is the test phone's camera function, where 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, he can right-click the test phone's camera function to obtain the test factor corresponding to the test function from the test experience library. Figure 5 As shown in the figure, it is assumed that the test factors corresponding to the camera function of the test phone selected by the tester from the test experience library include: exposure mode, flash mode, ISO, camera test, pixel, and scene mode. Among them, the type of the test factor named camera test is action factor, and the types of 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 phone from the test experience library, the 6 test factors can be presented in Figure 4 In the mind map shown, the above 6 test factors are respectively used as 6 sub-nodes of the node for testing the mobile phone camera function.
[0122] It should be understood that the action factor can also be understood as a template of a test case, which includes at least one of the following contents in the test case: preconditions, test steps, expected results, etc. Figure 4 Taking the mind map shown as an example, the action factor is a photo test, which may 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 is ***, the flash mode is ***, the ISO is ***, the exposure mode is ***, and the scene mode is ***. Here, "the pixel is ***, the flash mode is ***, the ISO is ***, the exposure mode is ***, and the scene mode is ***" refers to the values of the above different data factors.
[0123] In the present application embodiment, after obtaining Figure 4After the mind map shown in the figure is drawn, the tester can generate test cases based on the mind map. Specifically, the tester right-clicks the camera function of the test phone and selects Generate Test Case to obtain the following Figure 5 The interface for generating a use case shown in the figure is loaded with 6 test factors corresponding to the camera function of the test mobile phone, and the 6 test factors include action factors and data factors, wherein the action factors include: camera test, and the data factors include: exposure mode, flash mode, ISO, pixel, and scene mode. Among them, the values of the data factor named "exposure mode" include but are not limited to: automatic, manual, shutter priority, and 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, and 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.
[0124] like Figure 5 As shown, the interface for generating use cases provides the following functions for testers: selecting the combination algorithm of data factors, customizing data weights, customizing data constraints, etc. For example, suppose the tester selects five data factors, namely 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 weight of the data factor of exposure mode with a value of "auto" is defined as 5. The tester also customizes the data constraints of the data factors named pixels and ISO. For example, if the value of pixels is 300,000, then the value of ISO is 200.
[0125] 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.
[0126] Table 1 Combination results
[0127]
[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 screened to generate a corresponding number of test cases based on the screened combination results.
[0129] For example, the following takes the first 8 combinations 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 exposure mode set to automatic, flash mode set to automatic, ISO set to automatic, pixels set to 800,000, and scene mode set to automatic;
[0136] Expected result: Success.
[0137] 2. Test case 2 (generated based on the result of combination numbered 2):
[0138] This test case 2 mainly includes the following parts:
[0139] Use case title: Auto_Forced Flash_100_1.3M_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 set to forced flash, the ISO set to 100, the pixels set to 1.3 million, and the scene mode set to portrait;
[0143] Expected result: Success.
[0144] 3. Test case 3 (generated based on the result of combination numbered 3):
[0145] The test case 3 mainly includes the following parts:
[0146] Use Case Title: Auto_Flash Off_1.60_1.30MP_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_300k_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 pixels 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] The 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 photos 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 numbered 6):
[0166] The test case 6 mainly includes the following parts:
[0167] Use case title: Manual_Automatic_100_800k_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 exposure mode set to manual, flash mode set to automatic, ISO set to 100, pixels set to 800,000, and scene mode set to landscape;
[0171] Expected result: Success.
[0172] 7. Test case 7 (generated based on the result of combination numbered 7):
[0173] The test case 7 mainly includes the following parts:
[0174] Use case title: Manual_Forced Flash_1.60_800,000_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 exposure mode set to manual, flash mode set to forced flash, ISO set to 160, pixels set to 800,000, and scene mode set to macro;
[0178] Expected result: Success.
[0179] 8. Test case 8 (generated based on the result of combination numbered 8):
[0180] The test case 8 mainly includes the following parts:
[0181] Use case title: Manual_Forced Flash_200_300k_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 set to forced flash, ISO set to 200, pixels 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] Combination of the above Figures 1 to 5 , describes in detail the method provided by the embodiment of the present application, and will be combined with Figure 6-Figure 9 , describes in detail the embodiment of the device of the present application. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.
[0188] Figure 6600 is a schematic block diagram of a device 600 for batch generating test cases provided in an embodiment of the present application. The device 600 can be implemented by software, hardware, or a combination of both. The device 600 provided in an embodiment of the present application can implement the embodiment of the present application. Figure 2 According to the method flow shown, the device 600 includes: an acquisition module 610, a combination module 620, a generation module 630, and a display module 640. The acquisition module 610 is used to acquire the function to be tested of the target software product; the acquisition module 610 is also used to acquire 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: precondition, 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 multiple corresponding test cases according to 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 used 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 combined values of multiple test input parameters in the multiple data combination results, the constraint conditions corresponding to the test input parameters, or the strength of association 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 also 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, wherein the infrastructure includes at least one cloud data center, and each cloud data center is provided with at least one server.
[0195] The device 600 here can be embodied in the form of a functional module. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0196] For example, a "module" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. Exemplarily, the following takes the acquisition module 610 as an example to introduce the implementation of the acquisition module 610. Similarly, the implementation of other modules, such as the combination module 620, the generation module 630, and the display module 640, can refer to the implementation of the 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. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned 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 (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 a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.
[0198] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0199] The acquisition module 610 is taken as an example of a hardware functional unit, and the acquisition module 610 may include at least one computing device, such as a server, etc. Alternatively, the acquisition module 610 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. The PLD may be 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 the acquisition module 610 can be distributed in the same region or in different regions. The multiple computing devices included in the acquisition module 610 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the acquisition module 610 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0201] Therefore, the modules of each example described in the embodiments of the present 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present 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 function allocation can be completed by different functional modules as needed, that is, the internal structure of the device is 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 the acquisition module 610, the combination module 620, the generation module 630, and the display module 640 respectively implement different steps in the above method to realize all the functions of the above device.
[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, which 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 then the function and structure of the hardware are 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. In addition, optionally, the computer system is a handheld device such as a smart phone, or a terminal device such as a personal computer, and the present application is not particularly limited, as long as the method provided by 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] Combine the following Figure 7 , a computing device provided in an embodiment of the present application is described in detail.
[0206] Figure 7 1 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 or a computer or other device with computing capabilities. Figure 7 The computing device 1500 shown includes at least one processor 1510 and a memory 1520 .
[0207] It should be understood that the present 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 by the present application. Alternatively, the processor 1510 executes the instructions in the memory 1520, so that the computing device 1500 implements the functional modules provided by the present application, thereby implementing the method provided by the present 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, etc. The system bus 1540 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0211] In a possible implementation, the function of the processor 1510 is mainly to interpret the instructions (or codes) of the computer program and process the data in the computer software. The instructions of the computer program and the data in the computer software can be stored in the memory 1520 or the cache 1516.
[0212] Optionally, the processor 1510 may be an integrated circuit chip with signal processing capabilities. As an 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, a discrete hardware component. Among them, 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] Optionally, the processing unit 1512 is also called a core or kernel, which is the most important component of the processor. The processing unit 1512 is manufactured from single crystal silicon using a certain production process, and all calculations, command reception, command storage, and data processing of the processor are performed by the core. The processing units run program instructions independently and use the ability of parallel computing to speed up the running speed of the program. Various processing units have a fixed logical structure. For example, the processing unit includes logical units such as a first-level cache, a second-level cache, an execution unit, an instruction-level unit, and a bus interface.
[0215] In one implementation example, the memory control unit 1514 is used to control data interaction between the memory 1520 and the processing unit 1512. Specifically, the memory control unit 1514 receives a memory access request from the processing unit 1512, and controls access to the memory based on the memory access request. As an example and not a 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 through the system bus. And an arbiter ( Figure 7 ), which is responsible for handling and coordinating competing accesses of multiple processing units 1512.
[0217] In an implementation example, the processing unit 1512 and the memory control unit 1514 are connected to each other through 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, wherein the cache is a buffer for data exchange (called cache). When the processing unit 1512 wants to read data, it will first search for the required data from the cache. If it is found, it will be executed directly. If it is not found, it will be searched from the memory. Since the running speed of the cache is much faster than the memory, the role of the cache is to help the processing unit 1512 run faster.
[0219] The memory 1520 can provide a running space for the processes in the computing device 1500. For example, the computer program (specifically, the code of the program) used to generate the process is stored in the memory 1520. After the computer program is executed by the processor to generate the process, the processor allocates a corresponding storage space for the process in the memory 1520. Furthermore, the above storage space further includes a text segment, an initialized data segment, a bit initialized data segment, a stack segment, a heap segment, etc. The memory 1520 stores the data generated during the running of the process in the storage space corresponding to the above process, such as intermediate data, process data, etc.
[0220] Optionally, the storage is also called memory, and its function is to temporarily store the operation data in the processor 1510 and the data exchanged with the external storage such as the hard disk. As long as the computer is running, the processor 1510 will transfer the data to be calculated to the memory for calculation, and when the calculation is completed, the processing unit 1512 will transmit the result.
[0221] As an example and not limitation, memory 1520 is a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory is a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory is a 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 besides 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 for 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 for implementing 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 Figure 7 All devices shown in .
[0223] The embodiment of 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 smart phone.
[0224] like Figure 8 As shown, 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 in 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 may 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 may store different instructions, which are respectively used to execute part of the functions of the above-mentioned apparatus. That is, the instructions stored in the memory 1520 in different computing devices 1500 may implement the functions of one or more modules in the above-mentioned apparatus.
[0227] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig. 9 A possible implementation is shown. Fig. 9 As shown, two computing devices 1500A and 1500B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.
[0228] It should be understood that Fig. 9 The functionality of the computing device 1500A shown in FIG. 1 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] In this embodiment, a computer program product including instructions is also provided, and 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, the computing device is caused to execute the method provided above, or the computing device is caused to implement the function of the apparatus provided above.
[0230] In this embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions. When the instructions in the computer-readable storage medium are executed on a computing device, the computing device executes 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 of ordinary skill 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 to be beyond the scope of this application.
[0233] Those skilled in the art can 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 the present 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[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 can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks.
[0238] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for batch generating test cases, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is characterized in that The device comprises: An acquisition module, used to acquire the functions to be tested of the target software product; The obtaining module is further configured to obtain an action factor and a data factor corresponding to the function to be tested, where the action factor is used to describe at least one of the following information in a test case: precondition, test step, 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 test input parameter; The combining module is configured to combine multiple values of the at least one test input parameter to obtain multiple data combination results; The generating module is configured to batch generate corresponding multiple test cases according to 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 configured to display the generated multiple test cases to the user.
9. The apparatus according to claim 8, wherein, the obtaining module is specifically configured to: Obtain an action factor and a data factor corresponding to the function to be tested from a test experience library.
10. The apparatus according to claim 8 or 9, wherein, the obtaining module is further configured 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 condition corresponding to the test input parameter, or the correlation strength between multiple test input parameters; the combining module is specifically configured to: Combine multiple values of the at least one test input parameter according to at least one of the user-defined information to obtain the multiple data combination results.
11. The apparatus according to any one of claims 8 to 10, wherein, the obtaining module is further configured to obtain a combination algorithm selected by the user; the combining module is specifically configured to: Combine multiple values of the at least one test input parameter according to the combination algorithm to obtain multiple data combination results.
12. The apparatus according to claim 11, wherein, the combination algorithm includes at least one of the following: full combination, single selection combination, basic selection combination, or user-defined N-wise combination.
13. The apparatus according to any one of claims 8 to 12, wherein, the multiple test cases are generated in a mind map manner.
14. The apparatus according to any one of claims 8 to 13, wherein, the apparatus is applied to a cloud management platform, and the cloud management platform is used to manage the infrastructure providing cloud services, and the infrastructure includes at least one cloud data center, and each cloud data center is provided with at least one server.
15. A cluster of computing devices, wherein, includes at least one computing device, and each computing device includes 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 cluster of computing devices executes the method according to any one of claims 1 to 7.
16. A computer program product containing instructions, It is 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, It is 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
Cited By
Test case generation method, electronic equipment, medium and product
CN121547113A
Method and apparatus for batch generation of test cases and computing device
EP4797101A1
Method and apparatus for batch generation of test cases and computing device
WO2025107595A1