Test case generation method and device, computer device and readable storage medium
By identifying and filtering the correlations between system failure factors, independent test cases are generated, resolving the problem of test case execution conflicts and improving the accuracy and efficiency of system testing.
Patent Information
- Application Number
- CN202210731817.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-25
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-06-25
AI Technical Summary
In existing technologies, some fault combinations can create new faults that conflict with other faults, leading to execution conflicts in the generated test cases and affecting the accuracy and efficiency of system testing.
By acquiring multiple original fault factors, determining their corresponding functional modules and parameter transmission methods, identifying correlations, combining them into intermediate fault factors, filtering them, and generating test cases for the target fault factors.
This avoids execution conflicts between test cases, ensures the independence of test cases, reduces the burden of system testing, and improves the accuracy and efficiency of testing.
Smart Images

Figure CN115185832B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of test cases, and in particular to a test case generation method and device, a computer device, and a readable storage medium. BACKGROUND
[0002] System testing is a process of verifying whether the software system outcome is completed according to the specified requirements, and is also a process of checking the difference between the expected result and the actual result, and is a process of identifying the correctness, completeness and quality of the computer software in the development process. Among them, creating test cases is a key link in system testing, and the quality of test cases directly affects the testing efficiency and coverage of the system.
[0003] At present, when testing a system, multiple faults of the system are usually combined to form new faults to improve the diversity of fault types, and corresponding test cases are set for the new faults, thereby improving the comprehensiveness of the test cases of the system and the accuracy of the testing process. However, some new faults formed by fault combination will conflict with other faults, resulting in execution conflicts of the generated test cases, thereby greatly causing testing burden and affecting the accuracy of system testing. SUMMARY
[0004] The embodiments of the present application provide a test case generation method and device, a computer device, and a readable storage medium, aiming at solving the technical problem that in the prior art, some new faults formed by fault combination will conflict with other faults, resulting in execution conflicts of the generated test cases.
[0005] In a first aspect, the embodiments of the present application provide a test case generation method, which includes:
[0006] obtaining a plurality of original fault factors;
[0007] determining the correlation between each of the original fault factors according to the function modules corresponding to each of the original fault factors;
[0008] combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors;
[0009] screening the plurality of intermediate fault factors to obtain a plurality of target fault factors;
[0010] generating test cases for each of the target fault factors.
[0011] In a second aspect, the embodiments of the present application provide a test case generation device, which includes:
[0012] a first obtaining unit configured to obtain a plurality of original fault factors;
[0013] The first determining unit is configured to determine the correlation between the original fault factors according to the functional modules corresponding to the original fault factors.
[0014] The first combining unit is configured to combine the original fault factors according to the correlation to obtain intermediate fault factors.
[0015] The first screening unit is configured to screen the intermediate fault factors to obtain target fault factors.
[0016] The generating unit is configured to generate test cases of the target fault factors.
[0017] In a third aspect, an embodiment of the present application further provides a computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the test case generation method according to the first aspect when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program causes a processor to execute the test case generation method according to the first aspect when the processor executes the computer program.
[0019] The embodiments of the present application provide a test case generation method, device, computer device and readable storage medium. After a plurality of original fault factors are obtained, the correlation between the original fault factors is determined according to the functional modules corresponding to the original fault factors, the original fault factors are combined according to the correlation to obtain intermediate fault factors, the intermediate fault factors are screened to obtain target fault factors, and then the test cases of the target fault factors are generated, so that the execution conflicts between the test cases in the system test process are avoided, the independence between the test cases is ensured, the burden of the system test is reduced, and the accuracy and efficiency of the system test are improved. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0021] Figure 1 The application scenario diagram of the test case generation method provided by the embodiments of the present application is shown in the figure.
[0022] Figure 2A flowchart of a test case generation method provided by an embodiment of the present application is shown in FIG. 1.
[0023] Figure 3 A flowchart of a test case generation method provided by an embodiment of the present application is shown in FIG. 1.
[0024] Figure 4 A flowchart of a test case generation method provided by an embodiment of the present application is shown in FIG. 1.
[0025] Figure 5 A flowchart of a test case generation method provided by an embodiment of the present application is shown in FIG. 1.
[0026] Figure 6 A flowchart of a test case generation method provided by an embodiment of the present application is shown in FIG. 1.
[0027] Figure 7 A flowchart of a test case generation method provided by an embodiment of the present application is shown in FIG. 1.
[0028] Figure 8 A schematic block diagram of a test case generation device provided by an embodiment of the present application is shown in FIG. 1.
[0029] Figure 9 A schematic block diagram of a computer device provided by an embodiment of the present application is shown in FIG. 1. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.
[0031] It should be understood that the terms "comprise" and "include" as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0032] It should also be understood that the terms used in the present application specification are only for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0033] It should be further understood that the term "and / or" as used herein in the specification and in the claims, unless otherwise specified, is used to
[0034] Referring to Figure 1 , the system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0035] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as web browser applications, search applications, instant messaging tools, etc.
[0036] The terminal devices 101, 102, 103 can be various electronic devices with display screens and support for web browsing, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers, etc.
[0037] The server 105 can be a server that provides various services, such as a background server that provides support for pages displayed on the terminal devices 101, 102, 103.
[0038] It should be noted that the method for generating test cases provided by the embodiments of the present application is generally executed by a server, and accordingly, the test case generation device is generally configured in the server.
[0039] It should be understood that Figure 1 the number of terminal devices, networks, and servers in
[0040] Referring to Figure 2 , Figure 2 a specific implementation of the method for generating test cases is shown.
[0041] It should be noted that the method of the present application is not limited to the flow order shown in Figure 2 , and the method includes the following steps:
[0042] As shown in Figure 2 , the method includes the following steps S110-S150.
[0043] S110, a plurality of original fault factors are obtained.
[0044] Specifically, the original fault factor is an element of a basic fault of the system, one fault of the system corresponds to one fault factor, each fault is configured with a test case, that is, one fault factor is provided with a corresponding test case, so that the test case corresponding to the fault factor can be generated to test the system, wherein the test case of each original fault factor in the embodiment is generated through the corresponding original fault factor.
[0045] S120, determine the correlation between the original fault factors according to the functional modules corresponding to the original fault factors.
[0046] Specifically, the correlation is data information indicating whether there is an association between two or more original fault factors in the system, that is, the correlation is used to measure the degree of association between two or more original fault factors in the system, and the correlation not only includes data information indicating whether there is the same element between the original fault factors, but also includes data information indicating whether there is mutual influence between the original fault factors. It can be understood that the correlation can be directly determined through the original fault factors, or indirectly determined through the original fault factors. The correlation includes positive correlation and negative correlation, the positive correlation indicates that there is an association between the original fault factors, and the negative correlation indicates that there is no association between the original fault factors.
[0047] In the embodiment, each functional module in the system can have one or more faults, the faults of the functional module each time can be the same or different, and the multiple original fault factors can be in the same functional module or in different functional modules. When the multiple original fault factors are in the same functional module, if each original fault is generated when the functional module performs parameter transmission in the same mode, when the test case of each original fault factor is used to test the system, the generated test case will inevitably cause execution conflict, thereby causing the burden of system testing. Therefore, whether the same parameter transmission mode is used in the process of executing the corresponding function of the functional module corresponding to each original fault factor is used to determine the correlation between the original fault factors, so as to ensure the independence of each original fault factor in the same functional module, thereby reducing the burden of system testing and improving the accuracy and efficiency of system testing.
[0048] In other embodiments of the application, as shown in Figure 3 The step S120 includes steps S121 and S122.
[0049] S121, determine the parameter transmission mode in the running process of the functional module corresponding to each original fault factor;
[0050] S122, determine the correlation between each of the original fault factors according to the parameter passing mode.
[0051] Specifically, if the functional modules corresponding to each original fault factor use the same parameter passing mode in the process of executing the corresponding function, it can be determined that each original fault has a positive correlation, that is, there is an association between each original fault factor; if the functional modules corresponding to each original fault factor do not use the same parameter passing mode in the process of executing the corresponding function, it can be determined that each original fault has a negative correlation, that is, there is no association between each original fault factor.
[0052] Among them, parameter passing refers to the process of passing parameter values to the corresponding formal parameters by actual parameters in the program running process, and realizing data processing and returning in the function. Formal parameters refer to variable names and array names appearing in the Sub and Function process parameter table. Formal parameters have not been allocated memory to the variable names and array names in the Sub and Function process parameter table before being called. The role of formal parameters is to describe the type and form of independent variables and their role in the process. Formal parameters can be legal variable names except fixed-length string variables, and can also be array names with parentheses. Actual parameters refer to parameter values passed from the calling process to the called process in the process of calling Sub and Function. Actual parameters can be variable names, array names, constants or expressions. In the process of parameter passing, formal parameters and actual parameters are combined by position. The corresponding variable names in the formal parameter table and the actual parameter table can not be the same, but the data type, parameter number and position of the formal parameter and the actual parameter must be one-to-one correspondence. Parameter passing mode includes QueryString mode, path passing parameter mode, Form form mode, and passing Json format string, etc. four parameter passing modes.
[0053] S130, combine each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors.
[0054] Specifically, whether there is a correlation between the original fault factors in the same functional module is determined by determining whether the same parameter passing mode is used in the process of executing the corresponding function by the functional module corresponding to each original fault factor, and then the original fault factors are combined. If each original fault factor is in the same module, and each original fault is caused when the functional module performs parameter passing in the same mode, it can be determined that there is a correlation between each original fault factor, and at this time the original fault factors can be combined to form an intermediate fault factor; if each original fault factor is in the same module, and each original fault is caused when the functional module performs parameter passing in different modes, there is no correlation between the original faults, and at this time the original faults that do not have a correlation do not need to be combined to form an intermediate fault factor.
[0055] In other embodiments of the application, as shown in Figure 4 Before step S130, steps S210 and S220 are further included.
[0056] S210, classifying each original fault factor to obtain classification information of each original fault factor;
[0057] S220, determining the priority of the test case of each original fault factor according to the classification information.
[0058] In this embodiment, each original fault factor can be classified according to the corresponding business scenario, or can be classified according to whether it is a core fault factor, or can be classified as a core fault factor and a non-core fault factor on the basis of the business scenario corresponding to each original fault factor. By classifying each original fault factor, the priority of the test case of each original fault factor is determined, and then when testing the system, the system can be tested according to the priority of the test case of each original fault factor, reducing the congestion when the test case executes the system test, and improving the efficiency of the system test.
[0059] In other embodiments of the application, as shown in Figure 5 Step S130 includes sub-steps S131 and S132.
[0060] S131, if the business scenarios of each original fault factor having the correlation are different, determining the priority of the test case of each original fault factor;
[0061] S132, if the business scenarios of each original fault factor having the correlation are the same, combining each original fault factor having the correlation to obtain the intermediate fault factor.
[0062] In the embodiment, the correlation between the original fault factors is positive correlation, i.e., the original fault factors are associated. After the original fault factors are associated, it is further determined whether the original fault factors belong to the same business scenario. When the original fault factors belong to the same business scenario, the original fault factors can be directly combined to obtain intermediate fault factors. When the original fault factors do not belong to the same business scenario, it is further determined whether the test cases of the original fault factors are set with priorities, so as to further avoid the congestion phenomenon of the test cases of the original fault factors in the system test process, and improve the efficiency of the system test.
[0063] In other embodiments of the application, as shown in Figure 6 S1311 and S1312.
[0064] S1311, obtaining the priorities of the business scenarios of the original fault factors;
[0065] S1312, if the priorities of the business scenarios of the original fault factors are the same, determining the priorities of the test cases of the original fault factors.
[0066] In the embodiment, the priority of the business scenario of each original fault factor is a parameter of the priority level of the business scenario in the system. The business scenarios of the original fault factors can have the same priority or different priorities. When the priorities of the business scenarios of the original fault factors are the same, the priorities of the test cases of the original fault factors are further set to avoid the congestion phenomenon of the test cases of the original fault factors in the system test process, and improve the efficiency of the system test. When the priorities of the business scenarios of the original fault factors are different, the original fault factors can be directly combined to obtain intermediate fault factors.
[0067] In other embodiments of the application, before S1312, there is further a step of: if the priorities of the business scenarios of the original fault factors are different, combining the original fault factors to obtain the intermediate fault factors.
[0068] Specifically, when the priorities of the business scenarios of the original fault factors are different, the original fault factors can be directly combined to obtain intermediate fault factors, so as to further avoid the execution conflict phenomenon between the test cases in the system test process, ensure the independence between the test cases, reduce the burden of the system test, and improve the accuracy and efficiency of the system test.
[0069] S140, screening the intermediate fault factors to obtain target fault factors.
[0070] Specifically, the combination between each original fault factor is not limited to combining two original fault factors, but also includes combining more than two original fault factors, and the original fault factors are not all uncombined fault factors. Therefore, the intermediate fault factors generated after combination need to be screened to select the required fault factors, i.e. target fault factors, from the intermediate fault factors.
[0071] In other embodiments, as shown in FIG. 1C, step S140 includes sub-steps S141 and S142. Figure 7
[0072] S141, obtaining a set of original fault factors;
[0073] S142, screening the intermediate fault factors according to the set of original fault factors to obtain a plurality of target fault factors.
[0074] In this embodiment, the set of original fault factors is the set of all original fault factors of the test system. The similarity between all intermediate fault factors and all original fault factors in the set of original fault factors is calculated to determine whether the intermediate fault factors exist in the set of original fault factors, and then the intermediate fault factors that are repeated in the set of original fault factors are removed, so as to screen the target fault factors. At the same time, the screened target fault factors can also be combined into the set of original fault factors, or the screened target fault factors can be set in a separate set.
[0075] S150, generating test cases for each target fault factor.
[0076] Specifically, after obtaining the target fault factors, test cases for each target fault factor can be directly generated based on the target fault factors, and corresponding test scripts can be generated based on the test cases to perform corresponding tests on the system. Each fault factor is independent and unrelated to each other, so as to avoid execution conflicts between test cases in the system test process, ensure the independence between test cases, reduce the burden of system test, and improve the accuracy and efficiency of system test.
[0077] In the test case generation method provided in the embodiment of the present application, a plurality of original fault factors are obtained, the correlation between each of the original fault factors is determined according to the functional modules corresponding to each of the original fault factors, each of the original fault factors is combined according to the correlation to obtain a plurality of intermediate fault factors, the plurality of intermediate fault factors are screened to obtain a plurality of target fault factors, and test cases of each of the target fault factors are generated. The test case generation method provided in the embodiment of the present application, after a plurality of original fault factors are obtained to obtain test cases of each of the original fault factors, the correlation between each of the original fault factors is determined according to the functional modules corresponding to each of the original fault factors, each of the original fault factors is combined according to the correlation to obtain a plurality of intermediate fault factors, each of the intermediate fault factors is screened to obtain a target fault factor, and test cases of each of the target fault factors are generated, so that the execution conflict between each of the test cases in the system test process is avoided, the independence between each of the test cases is ensured, the burden of the system test is reduced, and the accuracy and test efficiency of the system test are improved.
[0078] The embodiment of the present application also provides a test case generation device, which is used to execute any one of the aforementioned test case generation methods.
[0079] Specifically, refer to Figure 8 , Figure 8 FIG. 1 is a schematic block diagram of a test case generation device provided in the embodiment of the present application.
[0080] As Figure 8 shown, the test case generation device comprises a first obtaining unit 110, a first determining unit 120, a first combining unit 130, a first screening unit 140 and a generating unit 150.
[0081] The first obtaining unit 110 is used to obtain a plurality of original fault factors.
[0082] The first determining unit 120 is used to determine the correlation between each of the original fault factors according to the functional modules corresponding to each of the original fault factors.
[0083] In other embodiments of the present application, the first determining unit 120 comprises a second determining unit and a third determining unit.
[0084] The second determining unit is used to determine the parameter transmission mode in the running process of the functional modules corresponding to each of the original fault factors, and the third determining unit is used to determine the correlation between each of the original fault factors according to the parameter transmission mode.
[0085] The first combining unit 130 is used to combine each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors.
[0086] In other embodiments of the present application, the test case generation apparatus further comprises a classification unit and a fourth determination unit.
[0087] The classification unit is configured to classify each of the original fault factors to obtain classification information of each of the original fault factors.
[0088] The fourth determination unit is configured to determine the priority of the test case of each of the original fault factors according to the classification information.
[0089] In other embodiments of the present application, the first combination unit 130 comprises a fifth determination unit and a second combination unit.
[0090] The fifth determination unit is configured to determine the priority of the test case of each of the original fault factors if the business scenarios of each of the original fault factors with the correlation are different. The second combination unit is configured to combine each of the original fault factors with the correlation if the business scenarios of each of the original fault factors with the correlation are the same to obtain the intermediate fault factor.
[0091] In other embodiments of the present application, the fifth determination unit comprises a second acquisition unit and a sixth determination unit.
[0092] The second acquisition unit is configured to acquire the priority of the business scenario of each of the original fault factors. The sixth determination unit is configured to determine the priority of the test case of each of the original fault factors if the priority of the business scenario of each of the original fault factors is the same.
[0093] In other embodiments of the present application, the fifth determination unit further comprises a third combination unit.
[0094] The third combination unit is configured to combine each of the original fault factors to obtain the intermediate fault factor if the priority of the business scenario of each of the original fault factors is different.
[0095] The first screening unit 140 is configured to screen the plurality of intermediate fault factors to obtain a plurality of target fault factors.
[0096] In other embodiments of the present application, the first screening unit 140 comprises a third acquisition unit and a second screening unit.
[0097] The third acquisition unit is configured to acquire an original fault factor set. The second screening unit is configured to screen the intermediate fault factors according to the original fault factor set to obtain a plurality of target fault factors.
[0098] The generation unit 150 is configured to generate a test case of each of the target fault factors.
[0099] The test case generation device provided by the embodiment of the present application is used to perform the above-mentioned obtaining a plurality of original fault factors; determining the correlation between each of the original fault factors according to the functional modules corresponding to each of the original fault factors; combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors; screening the plurality of intermediate fault factors to obtain a plurality of target fault factors; and generating a test case for each of the target fault factors.
[0100] It should be noted that the specific implementation process of the system test device 100 and each unit can be clearly understood by those skilled in the art, and can be referred to the corresponding description in the foregoing method embodiments. For the convenience and brevity of description, it will not be repeated here.
[0101] The system test device can be implemented in the form of a computer program, which can run on a computer device as shown in the figure. Figure 9
[0102] Please refer to Figure 9 , Figure 9 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a terminal, wherein the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, and an electronic device with a communication function.
[0103] Referring to Figure 9 , the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, wherein the memory can include a non-volatile storage medium 503 and an internal memory 504.
[0104] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which when executed, can cause the processor 502 to perform a test case generation method.
[0105] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
[0106] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, which when executed by the processor 502, can cause the processor 502 to perform a test case generation method.
[0107] The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that Figure 9 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. Specifically, the computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] The processor 502 is configured to run the computer program 5032 stored in the memory to perform the following steps: obtaining a plurality of original fault factors; determining the correlation between the original fault factors according to the functional modules corresponding to the original fault factors; combining the original fault factors according to the correlation to obtain a plurality of intermediate fault factors; screening the intermediate fault factors to obtain a plurality of target fault factors; and generating test cases for the target fault factors.
[0109] In an embodiment, before the processor 502 implements the step of determining the correlation between the original fault factors according to the functional modules corresponding to the original fault factors, the processor 502 specifically implements the following steps: determining the parameter passing mode in the running process of the functional modules corresponding to the original fault factors; and determining the correlation between the original fault factors according to the parameter passing mode.
[0110] In an embodiment, before the processor 502 implements the step of combining the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, the processor 502 specifically implements the following steps: classifying the original fault factors to obtain classification information of the original fault factors; and determining the priority of the test cases for the original fault factors according to the classification information.
[0111] In an embodiment, before the processor 502 implements the step of combining the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, the processor 502 specifically implements the following steps: if the business scenarios of the original fault factors having the correlation are different, determining the priority of the test cases for the original fault factors; and if the business scenarios of the original fault factors having the correlation are the same, combining the original fault factors having the correlation to obtain the intermediate fault factors.
[0112] In an embodiment, before the processor 502 implements the step of determining the priority of the test cases for the original fault factors, the processor 502 specifically implements the following steps: obtaining the priority of the business scenarios of the original fault factors; and if the priorities of the business scenarios of the original fault factors are the same, determining the priority of the test cases for the original fault factors.
[0113] In an embodiment, the processor 502, before determining the priority of the test case of each of the original fault factors, implements the following steps if the priorities of the business scenarios of each of the original fault factors are not the same: combining each of the original fault factors to obtain the intermediate fault factors.
[0114] In an embodiment, the processor 502, when implementing the filtering of the intermediate fault factors to obtain the target fault factors, implements the following steps: obtaining the original fault factor set; filtering the intermediate fault factors according to the original fault factor set to obtain the target fault factors.
[0115] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and the processor 502 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0116] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the above-mentioned embodiments.
[0117] Therefore, the present application further provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions are executed by a processor to make the processor execute the following steps: obtaining a plurality of original fault factors; determining the correlation between each of the original fault factors according to the corresponding functional modules of each of the original fault factors; combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors; filtering the plurality of intermediate fault factors to obtain a plurality of target fault factors; and generating a test case of each of the target fault factors.
[0118] In an embodiment, the processor, in executing the program instructions, implements the determining the correlation between each of the original fault factors according to the functional module corresponding to each of the original fault factors, specifically implements the following steps: determining the parameter transmission mode in the running process of the functional module corresponding to each of the original fault factors; and determining the correlation between each of the original fault factors according to the parameter transmission mode.
[0119] In an embodiment, the processor, in executing the program instructions, implements the combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, before the combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, specifically implements the following steps: classifying each of the original fault factors to obtain classification information of each of the original fault factors; and determining the priority of the test case of each of the original fault factors according to the classification information.
[0120] In an embodiment, the processor, in executing the program instructions, implements the combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, before the combining each of the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, specifically implements the following steps: if the business scenarios of each of the original fault factors with the correlation are different, determining the priority of the test case of each of the original fault factors; and if the business scenarios of each of the original fault factors with the correlation are same, combining each of the original fault factors with the correlation to obtain the intermediate fault factors.
[0121] In an embodiment, the processor, in executing the program instructions, implements the determining the priority of the test case of each of the original fault factors, specifically implements the following steps: obtaining the priority of the business scenario of each of the original fault factors; and if the priority of the business scenario of each of the original fault factors is same, determining the priority of the test case of each of the original fault factors.
[0122] In an embodiment, the processor, in executing the program instructions, implements the determining the priority of the test case of each of the original fault factors if the priority of the business scenario of each of the original fault factors is same, before the determining the priority of the test case of each of the original fault factors if the priority of the business scenario of each of the original fault factors is same, specifically implements the following steps: if the priority of the business scenario of each of the original fault factors is different, combining each of the original fault factors to obtain the intermediate fault factors.
[0123] In an embodiment, the processor, in executing the program instructions, implements the screening the plurality of intermediate fault factors to obtain a plurality of target fault factors, specifically implements the following steps: obtaining an original fault factor set; and screening the intermediate fault factors according to the original fault factor set to obtain a plurality of target fault factors.
[0124] The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various computer readable storage media that can store program codes.
[0125] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in a general manner. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0126] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of each unit is only a logical functional division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0127] The steps in the method embodiments of the present application can be adjusted, combined and deleted in sequence according to actual needs. The units in the device embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0128] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0129] The above description 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 can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for generating test cases, characterized in that, include: Obtain multiple original fault factors; The correlation between the original fault factors is determined based on the functional modules corresponding to each original fault factor. Based on the correlation, the original fault factors are combined to obtain several intermediate fault factors; By filtering the aforementioned intermediate fault factors, several target fault factors are obtained; Generate test cases for each of the target failure factors; The step of combining the original fault factors according to the correlation to obtain several intermediate fault factors includes: If the business scenarios of the original fault factors that have the aforementioned correlation are different, the priority of the test cases for each original fault factor shall be determined. The process of determining the priority of test cases for each of the original fault factors includes: Prioritize the business scenarios for each of the original fault factors; If the business scenarios of each of the original fault factors have the same priority, determine the priority of the test cases for each of the original fault factors. Before determining the priority of test cases for each of the original fault factors if the business scenarios of each original fault factor have the same priority, the method further includes: If the priorities of the business scenarios of the original fault factors are not the same, the original fault factors are combined to obtain the intermediate fault factor.
2. The test case generation method according to claim 1, characterized in that, The step of determining the correlation between the original fault factors based on the functional modules corresponding to each original fault factor includes: Determine the parameter transmission method during the operation of the functional modules corresponding to each of the original fault factors; The correlation between each of the original fault factors is determined based on the parameter transmission method.
3. The test case generation method according to claim 1, characterized in that, Before combining the original fault factors according to the correlation to obtain a plurality of intermediate fault factors, the method further includes: The original fault factors are classified to obtain the classification information of each original fault factor; The priority of test cases for each of the original fault factors is determined based on the classification information.
4. The test case generation method according to claim 1, characterized in that, The step of combining the original fault factors according to the correlation to obtain a plurality of intermediate fault factors further includes: If the original fault factors that are related have the same business scenario, the original fault factors that are related will be combined to obtain the intermediate fault factor.
5. The test case generation method according to claim 1, characterized in that, The process of filtering the intermediate fault factors to obtain several target fault factors includes: Obtain the original set of fault factors; Based on the original set of fault factors, the intermediate fault factors are filtered to obtain several target fault factors.
6. A test case generation device, characterized in that, include: The first acquisition unit is used to acquire multiple original fault factors; The first determining unit is used to determine the correlation between the original fault factors according to the functional modules corresponding to each original fault factor. The first combination unit is used to combine the original fault factors according to the correlation to obtain a number of intermediate fault factors. The first screening unit is used to screen the plurality of intermediate fault factors to obtain a plurality of target fault factors. A generation unit is used to generate test cases for each of the target fault factors; The first combining unit includes a fifth determining unit, which is used to determine the priority of test cases for each original fault factor if the business scenarios of each original fault factor with the correlation are different. The fifth determining unit includes a second acquiring unit, a sixth determining unit, and a third combining unit. The second acquiring unit is used to acquire the priority of the business scenario of each original fault factor. The sixth determining unit is used to determine the priority of the test cases of each original fault factor if the priorities of the business scenarios of each original fault factor are the same. The third combination unit is used to combine the original fault factors to obtain the intermediate fault factor if the priorities of the business scenarios of the original fault factors are not the same.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the test case generation method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the test case generation method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Test script generation method, device, storage medium and electronic equipment
CN112905480A
Data processing method and device and electronic equipment
CN113626242A