System testing method, device, computer equipment and computer readable storage medium
By conducting correlation analysis and grouping of system test cases, building a negatively correlated target test case collection, and generating test scripts, the efficiency and accuracy problems caused by test case correlation are solved, and the efficiency and accuracy of system tests are improved.
Patent Information
- Application Number
- CN202210731819.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-25
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-06-25
AI Technical Summary
In existing system testing methods, the correlation between test cases leads to low testing efficiency and accuracy.
By obtaining the system's test cases collection, determining the correlation between test cases, and grouping them into a negatively correlated intermediate test cases collection, building a target test case collection, and generating a test script for the target test case for system testing.
Reduces mutual interference between target test cases and improves the efficiency and accuracy of system testing.
Smart Images

Figure CN115080409B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a system testing method, apparatus, computer equipment, and computer-readable storage medium. Background Art
[0002] The rapid development of information technology has led to the increasing scale and speed of software system updates, and the possibility of introducing errors during the development process has also increased. To minimize errors in software products, researchers and developers have proposed many software system quality assurance methods. However, to date, system testing remains the most important and effective method for ensuring software quality and reliability, and plays an irreplaceable and important role in ensuring and improving the quality of software products.
[0003] Currently, during system testing, a test case is typically created for each system fault, and each test case requires a separate test script to execute the system test. However, when a system has a large number of faults, the number of test cases required to execute the system test also increases, which in turn increases the number of test scripts to be created. At the same time, faults occasionally have correlations, and the test cases corresponding to these faults are also inevitably correlated. Consequently, when multiple related test cases are executed simultaneously, they inevitably interfere with each other, significantly reducing the efficiency and accuracy of system testing. Summary of the Invention
[0004] The embodiments of the present invention provide a system testing method, apparatus, computer equipment, and computer-readable storage medium, which aim to solve the technical problem of low system testing efficiency and accuracy in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a system testing method, which includes:
[0006] Obtaining a test case set for a system; wherein the test case set includes a plurality of test cases for the system;
[0007] Determining the correlation between the test cases in the test case set;
[0008] Grouping the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation;
[0009] Constructing a plurality of target test case sets based on the intermediate test case set; wherein each target test case set includes a plurality of target test cases, and any two target test cases do not belong to the same intermediate test case set;
[0010] Generate a test script for each target test case in the target test case set, and test the system according to the test script.
[0011] In a second aspect, an embodiment of the present invention provides a system testing device, comprising:
[0012] A first acquisition unit is configured to acquire a test case set of a system; wherein the test case set includes a plurality of test cases of the system;
[0013] A first determining unit, configured to determine the correlation between the test cases in the test case set;
[0014] A first grouping unit is configured to group the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation;
[0015] A construction unit, configured to construct a plurality of target test case sets based on the intermediate test case set; wherein each target test case set includes a plurality of target test cases, and any two target test cases do not belong to the same intermediate test case set;
[0016] A generating unit is used to generate a test script for each target test case in the target test case set, and test the system according to the test script.
[0017] In a third aspect, an embodiment of the present invention further provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the system testing method as described in the first aspect above when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the system testing method described in the first aspect above.
[0019] An embodiment of the present invention provides a system testing method, apparatus, computer equipment and computer-readable storage medium. The method obtains a test case set of the system and determines the correlation between each test case in the test case set. At the same time, each test case is grouped according to the correlation to obtain multiple intermediate test case sets. The intermediate test cases between any two intermediate test case sets have a negative correlation. Finally, a target test case set is constructed through the intermediate test case set to ensure that there is no correlation between each target test case in the target test case set. Therefore, when testing the system, a test script for each target test case can be generated to perform system testing. At the same time, the corresponding test script can be executed simultaneously for the target test cases in the same target test case set to perform system testing, thereby reducing mutual interference between the target test cases and improving the efficiency and accuracy of system testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 An application scenario diagram of the system testing method provided by an embodiment of the present invention;
[0022] Figure 2 A flowchart of a system testing method provided by an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of a flow chart of a system testing method provided by an embodiment of the present invention;
[0024] Figure 4 Another schematic diagram of a flow chart of a system testing method provided by an embodiment of the present invention;
[0025] Figure 5 Another schematic diagram of a flow chart of a system testing method provided by an embodiment of the present invention;
[0026] Figure 6 Another schematic diagram of a flow chart of a system testing method provided by an embodiment of the present invention;
[0027] Figure 7 Another schematic diagram of a flow chart of a system testing method provided by an embodiment of the present invention;
[0028] Figure 8 A schematic block diagram of a system testing device provided in an embodiment of the present invention;
[0029] Figure 9A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0031] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of 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 terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and 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" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0034] See also Figure 1 The system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0035] Users can use terminal devices 101, 102, 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be installed with various communication client applications, such as web browser applications, search applications, instant messaging tools, etc.
[0036] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0037] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0038] It should be noted that the system testing method provided in the embodiment of the present application is generally executed by a server, and accordingly, the system testing device is generally configured in the server.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0040] See also Figure 2 , Figure 2 A specific implementation of the system testing method is shown.
[0041] It should be noted that the method of the present invention is not limited to the method of Figure 2 The process sequence shown is limited to the following steps:
[0042] like Figure 2 As shown, the method includes the following steps S110 to S150.
[0043] S110 , obtaining a test case set for the system; wherein the test case set includes a plurality of test cases for the system.
[0044] Specifically, the test case set is a set of test cases required to test the system. The test case set can be composed of test cases of multiple test types for the system, or can be composed of test cases of one test type for the system. The test cases in the test case set can be associated or not associated with each other.
[0045] In other inventive embodiments, Figure 3 As shown, step S110 includes sub-steps S111, S112 and S113.
[0046] S111, receiving a test request of the system;
[0047] S112. Determine a test type of the system according to the test request;
[0048] S113. Acquire the test case set according to the test type.
[0049] In this embodiment, the test request is an instruction requesting that the system be tested accordingly. After receiving the test request, the server parses the test request to determine the test type of the system and, based on the test type, obtains the set of test cases required to test the system. System test types typically include functional testing, stress testing, performance testing, unit testing, regression testing, and security testing. Specifically, functional testing verifies that the system operates according to preset requirements; stress testing verifies that the system operates normally under normal data volume and overload conditions; performance testing verifies the system's performance indicators under different loads; unit testing verifies that individual subroutines or code segments with independent functions within a program are tested; regression testing verifies that after modifying old code, new errors have not been introduced or errors have been caused in other code. Regression testing typically begins with the second round of system testing to verify that problems discovered in the first round have been fixed; and security testing verifies that security measures are complete and can protect the system from unauthorized intrusion.
[0050] S120: Determine the correlation between the test cases in the test case set.
[0051] Specifically, the correlation refers to whether there is data information related to two or more test cases in the system, that is, the correlation is used to measure the degree of association between two or more test cases in the system. The correlation not only includes whether there is data information of the same elements between the test cases, but also whether there is data information that affects each other between the test cases.
[0052] It is understood that the correlation can be determined directly or indirectly through each test case. The correlation includes positive correlation and negative correlation. A positive correlation indicates that there is a correlation between the test cases, while a negative correlation indicates that there is no correlation between the test cases.
[0053] In other inventive embodiments, Figure 4 As shown, step S120 includes sub-steps S121 and S122.
[0054] S121, determining a functional module corresponding to each test case in the test case set;
[0055] S122: Determine the correlation between the test cases in the test case set according to the functional modules.
[0056] In this embodiment, the functional module is a unit module for the system to perform a certain function. Each test case corresponds to a functional module. The functional modules corresponding to the test cases can be the same functional module or different functional modules. When the functional modules corresponding to the test cases are different functional modules, there will inevitably be no association between the test cases. In this case, the correlation between the test cases can be directly determined to be a negative correlation. When the functional modules corresponding to the test cases are the same functional module, there may or may not be an association between the test cases. Specifically, when the functional modules corresponding to the test cases are the same functional module, during the process of executing the test scripts of the test cases to test their functional modules, if the parameter passing methods of the functional modules are different, it indicates that there is no association between the test cases; if the parameter passing methods of the functional modules are the same, it indicates that there is an association between the test cases.
[0057] In other inventive embodiments, Figure 5 As shown, step S121 includes sub-steps S1211 and S1212.
[0058] S1211. Obtaining a failure factor of each test case in the test case set;
[0059] S1212. Determine a functional module corresponding to each test case in the test case set according to the failure factor.
[0060] Specifically, each test case corresponds to a fault, and each fault corresponds to a fault factor. The fault factor is used to characterize the elements of a fault in the system. The fault is the name of an obstruction in a functional module in the system. Therefore, by obtaining the fault factor of each test case, the functional module corresponding to the fault of the fault factor can be determined, and then the functional module of each test case can be determined.
[0061] In other inventive embodiments, Figure 6 As shown, step S122 includes sub-steps S1221 and S1222.
[0062] S1221. Obtain the parameter transfer mode of the functional module corresponding to each test case in the test case set;
[0063] S1222: Determine the correlation between the test cases in the test case set according to the parameter transfer method.
[0064] In this embodiment, the parameter transfer method is a method in which the functional module transmits corresponding parameters during operation. The parameter transfer method includes four parameter transfer methods, namely, QueryString method, path parameter transfer method, Form method, and Json format string transfer. The same functional module may adopt different methods for parameter transmission during operation. When adopting different methods for parameter transmission, different failures may occur, which may lead to the need for different test cases to execute the test. Therefore, after determining whether each test case is the same functional module, it is also necessary to determine the respective parameter transmission methods in the same functional module to determine whether there is a correlation between the test cases.
[0065] Among them, parameter passing refers to the process in which actual parameters pass parameter values to corresponding formal parameters during program execution, and implement data processing and return in the function. Specifically, formal parameters refer to the variable names and array names that appear in the formal parameter list of Sub and Function procedures. Before being called, formal parameters do not allocate memory for the variable names and array names in the formal parameter list of Sub and Function procedures. The role of formal parameters is to explain the type and form of independent variables and their role in the process. Formal parameters can be legal variable names other than fixed-length string variables, or array names with parentheses. Actual parameters refer to the parameter values passed from the calling procedure to the called procedure during the call of Sub and Function. Actual parameters can be variable names, array names, constants or expressions. During the parameter passing process, formal parameters and actual parameters are combined by position. The corresponding variable names in the formal parameter list and the actual parameter list do not have to be the same, but the data types, number of parameters and positions of the formal parameters and actual parameters must correspond one to one.
[0066] S130. Group the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation.
[0067] In this embodiment, the correlation includes positive correlation and negative correlation. A positive correlation indicates that there is a correlation between the test cases, while a negative correlation indicates that there is no correlation between the test cases. During the grouping process, the test cases with positive correlation are grouped together to form an intermediate test case set. For example, if there are five test cases in a test case set, if all five test cases are negatively correlated, the five test cases need to be grouped together into five intermediate test case sets; if all five test cases are positively correlated, the five test cases need to be grouped together into one intermediate test case set.
[0068] In other inventive embodiments, Figure 7As shown, step S130 includes sub-steps S131 and S132.
[0069] S131, determining the business scenario of each test case in the test case set;
[0070] S132: If the business scenarios of the test cases are the same, group the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets.
[0071] In this embodiment, before grouping the test cases in the test case set, it is also necessary to determine whether the test cases are test cases for the same business scenario of the system, so as to ensure that the target test cases in the target test case set are test cases for the same business scenario of the system, thereby reducing the burden of system testing and improving the efficiency of system testing when the target test cases in the target test case set are used to test the system at the same time.
[0072] S140. Construct a plurality of target test case sets based on the intermediate test case set; wherein each target test case set includes a plurality of target test cases, and any two target test cases do not belong to the same intermediate test case set.
[0073] Specifically, each target test case in the target test case set is derived from each intermediate test case set, and no two target test cases belong to the same intermediate test case set. This ensures that there is no correlation between the target test cases in the target test case set. Consequently, when the system is tested simultaneously using target test cases in a target test case set, there is no need to worry about interference between the target test cases, thereby greatly improving the efficiency and accuracy of system testing. The target test case set constructed from the intermediate test case set can be a target test case set or multiple target test case sets. When multiple target test case sets are constructed from the intermediate test case set, the number of target test cases in each target test case set can be the same or different, and the target test cases in each target test case set are not correlated. The number of target test case sets and the number of target test cases in the target test case set in this application can be selected based on actual conditions and are not specifically limited in this embodiment. Furthermore, this embodiment preferably obtains any one of the intermediate test cases in each intermediate test case set to construct a target test case set.
[0074] S150: Generate a test script for each target test case in the target test case set, and test the system according to the test script.
[0075] Specifically, the test scripts for each target test case can be generated according to each target test case. Each test script can be executed at the same time to test the system, or can be executed at different time periods to test the system. The specific implementation can be based on actual conditions, and this embodiment does not make specific limitations.
[0076] In the system testing method provided by the embodiment of the present invention, a test case set of the system is obtained; wherein the test case set includes multiple test cases of the system; the correlation between each test case in the test case set is determined; each test case in the test case set is grouped according to the correlation to obtain multiple intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation; a plurality of target test case sets are constructed based on the intermediate test case sets; wherein each target test case set includes multiple target test cases, and any two target test cases do not belong to the same intermediate test case set; a test script for each target test case in the target test case set is generated, and the system is tested according to the test script. The system testing method provided by the embodiment of the present invention can generate a test script for each target test case to perform system testing when testing the system, and can simultaneously execute corresponding test scripts for target test cases in the same target test case set to perform system testing, thereby reducing mutual interference between target test cases and improving system testing efficiency and accuracy.
[0077] An embodiment of the present invention further provides a system testing device, which is used to execute any embodiment of the aforementioned system testing method.
[0078] Specifically, see Figure 8 , Figure 8 It is a schematic block diagram of a system testing device provided by an embodiment of the present invention.
[0079] like Figure 8 As shown, the system testing device includes: a first obtaining unit 110, a first determining unit 120, a first grouping unit 130, a constructing unit 140 and a generating unit 150.
[0080] The first acquisition unit 110 is configured to acquire a test case set for a system; wherein the test case set includes a plurality of test cases for the system.
[0081] In other embodiments of the invention, the first acquiring unit 110 includes: a receiving unit, a second determining unit, and a second acquiring unit.
[0082] The receiving unit is configured to receive a test request for the system; the second determining unit is configured to determine a test type for the system according to the test request; and the second acquiring unit is configured to acquire the test case set according to the test type.
[0083] The first determining unit 120 is configured to determine the correlation between the test cases in the test case set.
[0084] In other embodiments of the invention, the first determining unit 120 includes: a third determining unit and a fourth determining unit.
[0085] The third determining unit is used to determine the functional module corresponding to each test case in the test case set; the fourth determining unit is used to determine the correlation between each test case in the test case set according to the functional module.
[0086] In other embodiments of the invention, the third determining unit includes: a third acquiring unit and a fifth determining unit.
[0087] The third acquisition unit is used to obtain the failure factor of each test case in the test case set; the fifth determination unit is used to determine the functional module corresponding to each test case in the test case set according to the failure factor.
[0088] In other embodiments of the invention, the fourth determining unit includes: a fourth acquiring unit and a sixth determining unit.
[0089] The fourth acquisition unit is used to obtain the parameter transfer method of the functional module corresponding to each test case in the test case set; the sixth determination unit is used to determine the correlation between each test case in the test case set according to the parameter transfer method.
[0090] The first grouping unit 130 is configured to group the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation.
[0091] In other embodiments of the invention, the first grouping unit 130 includes: a seventh determining unit and a second grouping unit.
[0092] The seventh determination unit is used to determine the business scenario of each test case in the test case set; the second grouping unit is used to group each test case in the test case set according to the correlation if the business scenarios of each test case are the same, to obtain multiple intermediate test case sets.
[0093] The construction unit 140 is configured to construct a plurality of target test case sets based on the intermediate test case set; wherein each target test case set includes a plurality of target test cases, and any two target test cases do not belong to the same intermediate test case set.
[0094] In other embodiments of the invention, the construction unit 140 includes: a fifth acquisition unit.
[0095] The fifth acquiring unit is configured to respectively acquire any one of the intermediate test cases in each of the intermediate test case sets to construct a target test case set.
[0096] The generating unit 150 is configured to generate a test script for each target test case in the target test case set, and test the system according to the test script.
[0097] The system testing device provided by an embodiment of the present invention is used to execute the above-mentioned acquisition of a test case set for the system; wherein, the test case set includes multiple test cases for the system; determine the correlation between each test case in the test case set; group each test case in the test case set according to the correlation to obtain multiple intermediate test case sets; wherein, the intermediate test cases between any two intermediate test case sets have a negative correlation; construct several target test case sets based on the intermediate test case sets; wherein, each target test case set includes multiple target test cases, and any two target test cases do not belong to the same intermediate test case set; generate a test script for each target test case in the target test case set, and test the system according to the test script.
[0098] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned system testing device 100 and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and brevity of description, it will not be repeated here.
[0099] The system testing device can be implemented in the form of a computer program. Figure 9 Runs on the computer equipment shown.
[0100] See also Figure 9 , Figure 9 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal, wherein the terminal may be an electronic device with communication functions such as a smartphone, tablet computer, laptop computer, desktop computer, personal digital assistant, and wearable device.
[0101] See Figure 9 The computer device 500 includes a processor 502 , a memory, and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0102] 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 system testing method.
[0103] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
[0104] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503 . When the computer program 5032 is executed by the processor 502 , the processor 502 can execute a system testing method.
[0105] The network interface 505 is used to communicate with other devices through the network. Figure 9 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0106] The processor 502 is configured to execute a computer program 5032 stored in a memory to implement the following steps: obtaining a test case set for a system; wherein the test case set includes multiple test cases for the system; determining the correlation between the test cases in the test case set; grouping the test cases in the test case set according to the correlation to obtain multiple intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation; constructing a plurality of target test case sets based on the intermediate test case sets; wherein each target test case set includes multiple target test cases, and any two target test cases do not belong to the same intermediate test case set; generating a test script for each target test case in the target test case set, and testing the system according to the test script.
[0107] In one embodiment, the processor 502 implements the following steps in obtaining the test case set of the system: receiving a test request of the system; determining a test type of the system according to the test request; and obtaining the test case set according to the test type.
[0108] In one embodiment, the processor 502 implements the following steps in implementing the determination of the correlation between each test case in the test case set: determining the functional module corresponding to each test case in the test case set; and determining the correlation between each test case in the test case set based on the functional module.
[0109] In one embodiment, the processor 502 implements the following steps in determining the functional module corresponding to each test case in the test case set: obtaining the failure factor of each test case in the test case set; and determining the functional module corresponding to each test case in the test case set based on the failure factor.
[0110] In one embodiment, the processor 502 implements the following steps in implementing the determination of the correlation between each test case in the test case set based on the functional module: obtaining the parameter passing method of the functional module corresponding to each test case in the test case set; and determining the correlation between each test case in the test case set based on the parameter passing method.
[0111] In one embodiment, the processor 502 implements the grouping of each test case in the test case set according to the correlation to obtain multiple intermediate test case sets by specifically implementing the following steps: determining the business scenario of each test case in the test case set; if the business scenarios of each test case are the same, grouping each test case in the test case set according to the correlation to obtain multiple intermediate test case sets.
[0112] In one embodiment, the processor 502 implements the following steps when constructing several target test case sets based on the intermediate test case sets: obtaining any one of the intermediate test case sets in each of the intermediate test case sets to construct one of the target test case sets.
[0113] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may 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 gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0114] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing the relevant hardware through a computer program. The computer program includes program instructions, which can be stored in a storage medium that is computer-readable. The program instructions are executed by at least one processor in the computer system to implement the steps in the method of the above-described embodiment.
[0115] Therefore, the present invention also 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. When the program instructions are executed by a processor, the processor executes the following steps: obtaining a test case set for the system; wherein the test case set includes multiple test cases for the system; determining the correlation between each of the test cases in the test case set; grouping each of the test cases in the test case set according to the correlation to obtain multiple intermediate test case sets; wherein the intermediate test cases between any two of the intermediate test case sets have a negative correlation; constructing several target test case sets based on the intermediate test case sets; wherein each of the target test case sets includes multiple target test cases, and any two of the target test cases do not belong to the same intermediate test case set; generating a test script for each of the target test cases in the target test case set, and testing the system according to the test script.
[0116] In one embodiment, the processor implements the acquisition of the test case set of the system when executing the program instructions, specifically implementing the following steps: receiving a test request of the system; determining the test type of the system according to the test request; and acquiring the test case set according to the test type.
[0117] In one embodiment, the processor implements the determination of the correlation between each test case in the test case set when executing the program instructions, and specifically implements the following steps: determining the functional module corresponding to each test case in the test case set; and determining the correlation between each test case in the test case set based on the functional module.
[0118] In one embodiment, the processor implements the determination of the functional module corresponding to each test case in the test case set when executing the program instructions, and specifically implements the following steps: obtaining the failure factor of each test case in the test case set; and determining the functional module corresponding to each test case in the test case set based on the failure factor.
[0119] In one embodiment, the processor executes the program instructions to implement the determination of the correlation between each test case in the test case set based on the functional module, and specifically implements the following steps: obtaining the parameter passing method of the functional module corresponding to each test case in the test case set; determining the correlation between each test case in the test case set based on the parameter passing method.
[0120] In one embodiment, the processor executes the program instructions to group the test cases in the test case set according to the correlation to obtain multiple intermediate test case sets, and specifically implements the following steps: determining the business scenario of each test case in the test case set; if the business scenarios of each test case are the same, grouping the test cases in the test case set according to the correlation to obtain multiple intermediate test case sets.
[0121] In one embodiment, the processor executes the program instructions to implement the construction of several target test case sets based on the intermediate test case sets, specifically implementing the following steps: respectively obtaining any one of the intermediate test case sets in each of the intermediate test case sets to construct one of the target test case sets.
[0122] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.
[0123] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. 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 invention.
[0124] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0125] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted as needed. The units in the devices of the embodiments of the present invention may be combined, divided, or deleted as needed. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0126] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present invention.
[0127] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A system testing method, characterized in that: include: Obtaining a test case set for a system; wherein the test case set includes a plurality of test cases for the system; Determining the correlation between the test cases in the test case set; Grouping the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation; Constructing a plurality of target test case sets based on the intermediate test case set; wherein each target test case set includes a plurality of target test cases, and any two target test cases do not belong to the same intermediate test case set; Generating a test script for each target test case in the target test case set, and testing the system according to the test script; Determining the correlation between the test cases in the test case set includes: Obtaining a failure factor for each of the test cases in the test case set, wherein each test case corresponds to a failure, each failure corresponds to a failure factor, and the failure factor is used to characterize an element of a failure in the system, where the failure is the name of a malfunction of a functional module in the system; Determine, according to the failure factor, a functional module corresponding to each test case in the test case set; Determine the correlation between the test cases in the test case set according to the functional module; Determining the correlation between the test cases in the test case set according to the functional modules includes: When the functional modules corresponding to the test cases are the same functional module, obtaining the parameter transfer mode of the functional modules corresponding to the test cases in the test case set; Determine the correlation between the test cases in the test case set according to the parameter transfer method; When the functional modules corresponding to the test cases are different functional modules, it is determined that the correlation between the test cases is a negative correlation.
2. The system testing method according to claim 1, characterized in that: The acquisition system test case set includes: receiving a test request for the system; determining a test type of the system according to the test request; The test case set is obtained according to the test type.
3. The system testing method according to claim 1, characterized in that: The test cases in the test case set are grouped according to the correlation to obtain a plurality of intermediate test case sets, including: Determining a business scenario for each test case in the test case set; If the business scenarios of the test cases are the same, the test cases in the test case set are grouped according to the correlation to obtain a plurality of intermediate test case sets.
4. The system testing method according to claim 1, wherein: The step of constructing a plurality of target test case sets based on the intermediate test case sets includes: Any one of the intermediate test cases in each of the intermediate test case sets is obtained respectively to construct a target test case set.
5. A system testing device, characterized in that: include: A first acquisition unit is configured to acquire a test case set of a system; wherein the test case set includes a plurality of test cases of the system; A first determining unit, configured to determine the correlation between the test cases in the test case set; A first grouping unit is configured to group the test cases in the test case set according to the correlation to obtain a plurality of intermediate test case sets; wherein the intermediate test cases between any two intermediate test case sets have a negative correlation; A construction unit, configured to construct a plurality of target test case sets based on the intermediate test case set; wherein each target test case set includes a plurality of target test cases, and any two target test cases do not belong to the same intermediate test case set; a generating unit, configured to generate a test script for each target test case in the target test case set, and test the system according to the test script; The first determining unit includes: a third determining unit, configured to obtain a failure factor of each of the test cases in the test case set, wherein each test case corresponds to a failure, each failure corresponds to a failure factor, the failure factor is used to characterize an element of a failure in the system, and the failure is the name of a failure of a functional module in the system; determining the functional module corresponding to each of the test cases in the test case set according to the failure factor; and a fourth determining unit, configured to determine the correlation between the test cases in the test case set according to the functional modules; The fourth determining unit includes: a fourth obtaining unit for obtaining a parameter transfer mode of the functional module corresponding to each test case in the test case set when the functional module corresponding to each test case is the same functional module; a sixth determining unit for determining the correlation between each test case in the test case set based on the parameter transfer mode; The fourth determining unit is further configured to determine that the correlation between the test cases is a negative correlation when the functional modules corresponding to the test cases are different functional modules.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the system testing method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the system testing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Test case processing method and device and electronic equipment
CN113535570A
Automatic test method and system for power cloud test management platform
CN114090442A