Test case set processing method, processing device, system and readable storage medium
By obtaining and processing test parameters from a preset format file, target test case parameters that match the framework under test are generated, solving the problem that test case sets cannot be directly connected and achieving efficient automated testing.
Patent Information
- Application Number
- CN202211142511.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-09-20
AI Technical Summary
In existing technologies, test case sets generated using the Pairwise algorithm cannot be directly integrated with the testing framework, resulting in low efficiency in automated testing.
By obtaining multiple test parameters from a preset format file, a preset test parameter list is generated. After processing using a pairwise algorithm, parameterization is performed to determine the target test case parameters that match the data type of the framework under test, thus achieving direct connection between the test cases and the framework under test.
It enables direct connection between test cases and the framework under test, improving the comprehensiveness and coverage of test cases, reducing bug escape rate, and improving the efficiency of automated testing.
Smart Images

Figure CN115408295B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing, and more specifically, to a test case set processing method, a test case set processing device, a test case set processing system, and a readable storage medium. Background Technology
[0002] In existing technologies, multiple test cases are required for automated testing. The Pairwise algorithm can generate cost-effective test case sets. However, when using the test case sets generated by the pairwise algorithm for automated testing, a technical problem arises where the test cases cannot be directly integrated with the testing framework. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0004] Therefore, the first aspect of the present invention is to propose a test case set processing method.
[0005] A second aspect of the present invention is to provide a test case set processing device.
[0006] The third aspect of this invention is to propose a test case set processing system.
[0007] A fourth aspect of the present invention is to provide a readable storage medium.
[0008] In view of this, according to one aspect of the present invention, a test case set processing method is proposed, comprising: obtaining multiple first test parameters and multiple second test parameters from a preset format file, and generating a preset test parameter list based on the multiple first test parameters and multiple second test parameters; performing pairwise algorithm processing on the multiple preset test parameters in the preset test parameter list to obtain a first test case set; performing parameterization processing on the multiple first test case parameters in the first test case set; determining multiple target test case parameters corresponding to the test framework from the multiple parameterized first test case parameters according to the test framework and the data type processed by the test framework; performing integration processing on the multiple target test case parameters and the test framework, and testing the test product based on the integrated test framework.
[0009] The test case set processing method provided by this invention first obtains multiple first test parameters and multiple second test parameters from a preset format file. Specifically, the preset format file is used to store test parameters. The first test parameters can be test parameters with normal values, and the second test parameters can be test parameters with abnormal values. These two types of test parameters are put together to generate a preset test parameter list. Then, the multiple preset test parameters in this list are processed by a pairwise algorithm to generate a first test case set. The multiple first test cases in the first test case set include multiple first test parameters and multiple second test parameters.
[0010] Subsequently, the parameters of multiple first test cases in the first test case set are parameterized, that is, the description of the parameter value itself is transformed into a specific parameter value. Then, the framework to be tested and the data type processed by the framework to be tested are determined. After the data type processed by the framework to be tested is determined, multiple target test case parameters with the same data type processed by the framework to be tested can be selected from the multiple parameterized first test case parameters. The multiple target test case parameters are then integrated with the framework to be tested, so that the framework to be tested has a test case set corresponding to the data type it processes. In this way, the framework to be tested can test the product to be tested placed in the framework. The target test case parameters are generated through the data type processed by the framework to be tested, realizing the direct connection between the test cases and the framework to be tested.
[0011] The test case set processing method of this invention obtains multiple first test parameters and multiple second test parameters from a preset format file, enabling the preset format file to save test parameters when no test parameters are invoked. Simultaneously, by using multiple first test parameters and multiple second test parameters as preset test parameters, it achieves full coverage of test scenarios, reduces the bug (fault, referring to test error) escape rate, and improves the comprehensiveness of generated test cases. By parameterizing multiple first test case parameters, the first test case parameters are described more intuitively, facilitating subsequent processing. By determining multiple target test case parameters corresponding to the framework under test based on the data type processed by the framework under test, it achieves direct connection between test cases and the framework under test. Therefore, the test case set processing method of this application not only achieves coverage of different test scenarios but also achieves direct connection between test cases and the framework under test.
[0012] The test case set processing method of the present invention may also have the following technical features:
[0013] In the above technical solution, before parameterizing the multiple first test case parameters in the first test case set, the test case set processing method further includes: configuring multiple first rules for the multiple first test case parameters in the first test case set, wherein the multiple first rules are used to mark the multiple first test case parameters used for parameterization processing.
[0014] In this technical solution, before parameterizing multiple first test case parameters, a first rule must be configured for each parameter. This means configuring a unified specification for each first test case parameter that needs parameterization. This allows for easier determination of the corresponding first test case parameters based on the first rule when parameterization is required, avoiding the need to determine each parameter individually, reducing the time spent on parameter determination, and improving work efficiency. Specifically, the first rule configured for each first test case parameter is the same.
[0015] In any of the above technical solutions, parameterization processing of multiple first test case parameters in the first test case set specifically includes: obtaining the parameter types of multiple first test case parameters marked by multiple first rules to obtain multiple first parameter types; generating multiple first feature parameter values according to the multiple first parameter types, with each first parameter type corresponding to multiple first feature parameter values; and marking the multiple first test case parameters using the multiple first feature parameter values.
[0016] In this technical solution, the specific process of parameterization is as follows: The parameter type of each first test case parameter marked with a first rule is obtained. Specifically, the parameter type is the data type of the data defined by the parameter, thus obtaining multiple first parameter types. Multiple first feature parameter values are generated based on these multiple first parameter types; that is, parameter values corresponding to the data types of the first parameters are generated, i.e., first feature parameter values. Subsequently, the corresponding first test case parameters are marked using these first feature parameter values. By marking the first test case parameters with first feature parameter values, a description of the first test case parameters is provided, making the first test case parameters clearer and facilitating subsequent processing of first test case parameters with specific characteristics.
[0017] Specifically, the parameter value can generate multiple first feature parameter values based on the first parameter type. In other words, the first feature parameter value only needs to conform to the data type corresponding to the first parameter. Each first parameter can include multiple first feature parameter values, thus ensuring the randomness of the parameter value.
[0018] Furthermore, the first feature parameter value can be generated according to the test environment of the framework under test. In other words, the generated first feature parameter value can also meet the needs of the test environment of the framework under test, thus ensuring the strong correlation between the first feature parameter value and the test task in the framework under test.
[0019] In any of the above technical solutions, based on the framework to be tested and the data types processed by the framework to be tested, multiple target test case parameters corresponding to the framework to be tested are determined from the multiple first test case parameters after parameterization. Specifically, this includes: determining the target parameter type of the framework to be tested based on the data types that the framework to be tested can process; determining multiple first test case parameters that conform to the target parameter type based on the multiple first feature parameter values when they conform to the target parameter type; and determining multiple target test case parameters corresponding to the framework to be tested based on the multiple first test case parameters that conform to the target parameter type.
[0020] In this technical solution, after parameterizing multiple first test case parameters, the target parameters of the framework under test are obtained. Specifically, the target parameter type of the framework under test is first determined based on the data types that the framework under test can process. That is, the target parameter type is determined by the data types required by the framework under test when executing test tasks. Then, it is determined whether multiple first feature parameter values conform to the target parameter type. When a first feature parameter value conforms to the target parameter type, it is determined that this first feature parameter value can be tested by the framework under test. After each first feature parameter value is determined, multiple first test case parameters that conform to the target parameter type are obtained. Then, multiple first test case parameters are determined based on the previously determined multiple first feature parameter values that conform to the target parameter type. That is, the target test case parameters corresponding to the data types processed by the framework under test.
[0021] In any of the above technical solutions, a pairwise algorithm is performed on multiple preset test parameters in the preset test parameter list to obtain a first test case set. Specifically, this includes: combining any two preset test parameters from the multiple preset test parameters to generate a preset test case set; and filtering multiple preset test cases in the preset test case set to obtain the first test case set.
[0022] In this technical solution, any two of the preset test parameters are first selected and combined to obtain multiple preset test cases. Since each pair of preset test parameters can be freely combined, the comprehensiveness of the resulting preset test cases is ensured, and the coverage of the preset test cases for the test scenarios is improved. However, when combining each pair of preset test parameters, some preset test cases may contain completely identical test cases. Therefore, multiple preset test cases need to be filtered out, that is, test cases containing duplicate test cases are filtered out. This ensures the integrity of the test cases while reducing redundancy, thereby reducing resource consumption and test case set generation time.
[0023] In any of the above technical solutions, before obtaining multiple first test parameters and multiple second test parameters from a preset format file, the test case set processing method further includes: saving multiple test parameters to a preset format file; the preset format file determines multiple first test parameters and multiple second test parameters based on multiple parameter values of the multiple test parameters.
[0024] In this technical solution, before calling multiple first test parameters and multiple second test parameters, the multiple test parameters are first saved to a preset format file. The preset format file can further divide the multiple test parameters into multiple first test parameters and multiple second test parameters according to their parameter values. By saving multiple test parameters to the preset format file, the storage and maintenance of multiple test parameters are realized, avoiding the need to configure test parameters when test cases are needed, thus ensuring the timeliness of test case generation. At the same time, the preset format file divides multiple test parameters into multiple first test parameters and multiple second test parameters, making it easier for users to view and supplement the corresponding test parameters as needed, thereby improving the accuracy of test case generation from test parameters.
[0025] In any of the above technical solutions, the integration processing of multiple target test case parameters with the framework under test specifically includes: generating a target test case set based on multiple target test case parameters; determining multiple names for multiple target test cases in the target test case set; adding multiple names to the corresponding multiple target test cases, where each target test case name includes multiple target test cases; and integrating the target test case set after adding multiple names with the framework under test. In this technical solution, after determining multiple target test case parameters, a target test case set is generated. Subsequently, each target test case in the target test case set is given a corresponding test case name. Since each test case is a combination of corresponding test parameters, the test case name makes it easier to distinguish different test cases. Furthermore, since the framework under test will test the product under test in the framework after integration with the target test case set and generate a test report for the product under test based on the test results, adding the names of multiple target test cases to the corresponding multiple target test cases allows the target test cases to be better displayed in the test report, thereby better demonstrating the product performance of the product under test, making it easier for users to understand, and thus improving the practicality of the target test case set and enabling better integration with the framework under test.
[0026] According to a second aspect of the present invention, a test case set processing apparatus is provided, comprising: an acquisition unit for acquiring a plurality of first test parameters and a plurality of second test parameters from a preset format file; a processing unit for generating a preset test parameter list based on the plurality of first test parameters and the plurality of second test parameters; the processing unit is further configured to: perform pairwise algorithm processing on the plurality of preset test parameters in the preset test parameter list to obtain a first test case set; perform parameterization processing on the plurality of first test case parameters in the first test case set; determine a plurality of target test case parameters corresponding to the test framework from the plurality of parameterized first test case parameters based on the test framework and the data type processed by the test framework; perform integration processing on the plurality of target test case parameters and the test framework, and test the test product based on the integrated test framework.
[0027] The test case set processing device provided by the present invention firstly obtains multiple first test parameters and multiple second test parameters from a preset format file. Specifically, the preset format file is used to store test parameters. The first test parameters can be test parameters with normal values, and the second test parameters can be test parameters with abnormal values. These two types of test parameters are put together to generate a preset test parameter list. Subsequently, the processing unit performs pairwise processing on the multiple preset test parameters in this list to generate a first test case set. The multiple first test cases in the first test case set include multiple first test parameters and multiple second test parameters.
[0028] Subsequently, the processing unit parameterizes multiple first test case parameters in the first test case set, that is, transforms the parameter's description of the parameter value into a definite parameter value. Then, it determines the framework to be tested and the data type processed by the framework to be tested. After determining the data type processed by the framework to be tested, the processing unit can identify multiple target test case parameters from the multiple parameterized first test case parameters that are the same as the data type processed by the framework to be tested, and integrate these multiple target test case parameters with the framework to be tested. This results in the framework to be tested having a test case set corresponding to the data type it processes. In this way, the framework to be tested can test the product placed within the framework, generating target test case parameters through the data type processed by the framework to be tested, thus realizing the direct connection between the test cases and the framework to be tested.
[0029] The test case set processing device of the present invention acquires multiple first test parameters and multiple second test parameters from a preset format file through an acquisition unit. This enables the preset format file to save test parameters when no test parameters are invoked. Simultaneously, by using multiple first and second test parameters as preset test parameters, it achieves full coverage of test scenarios, reduces bug escape rates, and improves the comprehensiveness of generated test cases. The processing unit parameterizes the multiple first test case parameters, providing a more intuitive description of the first test case parameters and facilitating subsequent processing. The processing unit determines multiple target test case parameters corresponding to the framework under test based on the data type processed by the framework under test, achieving direct connection between test cases and the framework under test. Therefore, the test case set processing device of this application not only achieves coverage of different test scenarios but also realizes direct connection between test cases and the framework under test.
[0030] According to a third aspect of the present invention, a test case set processing system is proposed, comprising a memory storing a program; and a processor that, when executing the program, implements a test case set processing method as described in any of the above technical solutions.
[0031] The test case set processing system provided by this invention includes a memory and a processor. The memory stores programs; the processor is connected to the memory and executes the programs, implementing the test case set processing method as described in any of the above-described technical solutions when executing the programs. Therefore, it possesses all the beneficial effects of the test case set processing method as described in any of the above-described technical solutions.
[0032] According to a fourth aspect of the present invention, a readable storage medium is provided on which a program is stored, which, when executed by a processor, implements a test case set processing method as described in any of the above technical solutions.
[0033] The readable storage medium provided by the present invention is used to store a program that, when executed by a processor, implements the test case set processing method of any of the above-described technical solutions. Therefore, it has all the beneficial effects of the test case set processing method of any of the above-described technical solutions.
[0034] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0035] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0036] Figure 1 One of the flowcharts of the test case set processing method according to an embodiment of the present invention is shown;
[0037] Figure 2 The second flowchart of the test case set processing method according to an embodiment of the present invention is shown;
[0038] Figure 3 The third flowchart of the test case set processing method according to an embodiment of the present invention is shown;
[0039] Figure 4 The fourth flowchart illustrates the test case set processing method according to an embodiment of the present invention.
[0040] Figure 5 The fifth flowchart illustrates the test case set processing method according to an embodiment of the present invention.
[0041] Figure 6 The sixth flowchart illustrates the test case set processing method according to an embodiment of the present invention;
[0042] Figure 7 The seventh flowchart illustrates the test case set processing method according to an embodiment of the present invention;
[0043] Figure 8 A structural block diagram of the test case set processing device according to an embodiment of the present invention is shown;
[0044] Figure 9 A schematic diagram illustrating the working principle of the test case set processing device according to an embodiment of the present invention is shown. Detailed Implementation
[0045] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0046] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0047] The following reference Figures 1 to 9 This invention describes a test case set processing method, a test case set processing apparatus, a test case set processing system, and a readable storage medium according to some embodiments of the present invention.
[0048] Example 1:
[0049] A first aspect of the present invention provides a method for processing test case sets. Figure 1 One of the flowcharts for a test case set processing method according to an embodiment of this application is shown, such as... Figure 1As shown, the test case set processing methods include:
[0050] Step 102: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0051] Step 104: Perform pairwise algorithm processing on multiple preset test parameters in the preset test parameter list to obtain the first test case set;
[0052] Step 106: Parameterize the parameters of multiple first test cases in the first test case set;
[0053] Step 108: Based on the framework to be tested and the data types processed by the framework to be tested, determine the multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization.
[0054] Step 110: Integrate the parameters of multiple target test cases with the framework to be tested, and test the product to be tested according to the integrated framework.
[0055] In this embodiment of the application, multiple first test parameters and multiple second test parameters are first obtained from a preset format file. Specifically, the preset format file is used to store test parameters. The first test parameters can be test parameters with normal values, and the second test parameters can be test parameters with abnormal values. These two types of test parameters are put together to generate a preset test parameter list.
[0056] After generating the list of preset test parameters, the multiple preset test parameters in this list are processed by a pairwise algorithm. The pairwise algorithm is an algorithm for generating a set of test cases. The multiple preset test parameters generate a first set of test cases according to the pairwise algorithm. The multiple first test cases in the first set of test cases include multiple first test parameters and multiple second test parameters.
[0057] In this embodiment of the application, after obtaining the first test case set, the parameters of multiple first test cases in the first test case set are parameterized, that is, the description of the parameter value itself is transformed into a definite parameter value, and then the framework to be tested and the data type processed by the framework to be tested are determined.
[0058] Once the data type processed by the framework to be tested is determined, multiple target test case parameters that are the same as the data type processed by the framework to be tested can be selected from the multiple parameterized first test case parameters.
[0059] After determining multiple target test case parameters, these parameters are integrated with the framework under test, resulting in a set of test cases corresponding to the data types processed by the framework. This allows the framework to test products placed within it, generating target test case parameters based on the data types processed by the framework, thus achieving direct connection between test cases and the framework.
[0060] The test case set processing method of the present invention achieves the saving of test parameters in the preset format file when no test parameters are called by obtaining multiple first test parameters and multiple second test parameters from the preset format file.
[0061] Secondly, by using multiple first test parameters and multiple second test parameters as preset test parameters, full coverage of the test scenario is achieved, the bug escape rate is reduced, and the comprehensiveness of the generated test cases is improved. By parameterizing multiple first test case parameters, the first test case parameters are described more intuitively, making it easier to obtain the parameters later.
[0062] By determining the parameters of multiple target test cases corresponding to the framework under test by processing the data type of the framework under test, the test cases and the framework under test are directly connected. Thus, the test case set processing method of this application not only achieves coverage of different test scenarios, but also achieves direct connection between test cases and the framework under test.
[0063] For example, the default format file is a YAML (YAML is not a Markup Language) file. Test parameters can be saved through the YAML file, and test parameters in the YAML file can be obtained by reading the parameter list in the YAML file.
[0064] Example 2
[0065] An embodiment of the present invention provides a test case set processing method, such as... Figure 2 As shown, the test case set processing methods include:
[0066] Step 202: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0067] Step 204: Perform pairwise algorithm processing on multiple preset test parameters in the preset test parameter list to obtain the first test case set;
[0068] Step 206: Configure multiple first rules for multiple first test case parameters in the first test case set;
[0069] Step 208: Parameterize the parameters of multiple first test cases in the first test case set;
[0070] Step 210: Based on the framework to be tested and the data types processed by the framework to be tested, determine the multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization.
[0071] Step 212: Integrate the parameters of multiple target test cases with the framework to be tested, and test the product to be tested according to the integrated framework.
[0072] Among them, multiple first rules are used to mark multiple first test case parameters used for parameterization processing.
[0073] In this embodiment, before parameterizing multiple first test case parameters, a first rule must be configured for each parameter. This means configuring a unified specification for each first test case parameter that needs parameterization. This allows for easier determination of the corresponding first test case parameters based on the first rule when parameterization is required, avoiding the need to determine each parameter individually, reducing the time spent on parameter determination, and improving work efficiency. Specifically, the first rule configured for each first test case parameter is the same.
[0074] For example, the combination of the first rule and the parameter can be set as "${params}" or "{{params}}", where the corresponding first test case parameter can be set at "params(parameter)", that is, "$" and "{}" are the first rule.
[0075] Example 3
[0076] An embodiment of the present invention provides a test case set processing method, such as... Figure 3 As shown, the test case set processing methods include:
[0077] Step 302: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0078] Step 304: Perform pairwise algorithm processing on multiple preset test parameters in the preset test parameter list to obtain the first test case set;
[0079] Step 306: Configure multiple first rules for multiple first test case parameters in the first test case set;
[0080] Step 308: Obtain the parameter types of multiple first test case parameters marked by multiple first rules, and obtain multiple first parameter types;
[0081] Step 310: Generate multiple first feature parameter values based on multiple first parameter types;
[0082] Step 312: Use multiple first feature parameter values to label multiple first test case parameters;
[0083] Step 314: Based on the framework to be tested and the data types processed by the framework to be tested, determine the multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization.
[0084] Step 316: Integrate the parameters of multiple target test cases with the framework to be tested, and test the product to be tested according to the integrated framework.
[0085] Each first parameter type corresponds to multiple first feature parameter values.
[0086] In this embodiment, the specific process of parameterization is as follows: obtain the parameter type of each first test case parameter marked with the first rule.
[0087] Specifically, the parameter type is the data type of the data defined by the parameter, thus obtaining multiple first parameter types. Multiple first feature parameter values are generated based on the multiple first parameter types, that is, the parameter value of the corresponding data type is generated based on the data type of the first parameter, i.e., the first feature parameter value. Then, the first feature parameter value is used to mark the corresponding first test case parameter.
[0088] By labeling the first test case parameter with the first feature parameter value, it is equivalent to describing the first test case parameter, which more clearly shows the first test case parameter and facilitates the subsequent processing of the first test case parameter with specific characteristics.
[0089] Specifically, the parameter value can generate multiple first feature parameter values based on the first parameter type. In other words, the first feature parameter value only needs to conform to the data type corresponding to the first parameter. Each first parameter can include multiple first feature parameter values, thus ensuring the randomness of the parameter value.
[0090] Furthermore, the first feature parameter value can be generated according to the test environment of the framework under test. In other words, the generated first feature parameter value can also meet the needs of the test environment of the framework under test, thereby ensuring the strong correlation between the first feature parameter value and the test task in the framework under test.
[0091] For example, when the first parameter type is "12-character string containing alphanumeric characters", the first feature parameter value can be any string with a length of 12 characters that contains alphanumeric characters; when the test environment of the framework to be tested is related to the user ID (identity number), the first feature parameter value can be any user's user ID.
[0092] Example 4
[0093] An embodiment of the present invention provides a test case set processing method, such as... Figure 4 As shown, the test case set processing methods include:
[0094] Step 402: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0095] Step 404: Perform pairwise algorithm processing on multiple preset test parameters in the preset test parameter list to obtain the first test case set;
[0096] Step 406: Configure multiple first rules for multiple first test case parameters in the first test case set;
[0097] Step 408: Obtain the parameter types of multiple first test case parameters marked by multiple first rules, and obtain multiple first parameter types;
[0098] Step 410: Generate multiple first feature parameter values based on multiple first parameter types;
[0099] Step 412: Use multiple first feature parameter values to label multiple first test case parameters;
[0100] Step 414: Determine the target parameter type of the framework under test based on the data types that the framework under test can handle;
[0101] Step 416: When multiple first feature parameter values conform to the target parameter type, determine multiple first test case parameters that conform to the target parameter type based on the multiple first feature parameter values;
[0102] Step 418: Determine multiple target test case parameters corresponding to the framework to be tested based on multiple first test case parameters that conform to the target parameter type;
[0103] Step 420: Integrate the parameters of multiple target test cases with the framework to be tested, and test the product to be tested according to the integrated framework.
[0104] In this embodiment, after parameterizing the parameters of multiple first test cases, the target parameters of the test framework are obtained.
[0105] Specifically, the target parameter type of the framework under test is first determined based on the data types that the framework under test can handle. That is, the target parameter type is determined by the data types required by the framework under test to execute the test task. Then, it is determined whether multiple first feature parameter values conform to the target parameter type. When a first feature parameter value conforms to the target parameter type, it is determined that this first feature parameter value can be tested by the framework under test.
[0106] In this embodiment, after each first feature parameter value is determined, multiple first test case parameters that conform to the target parameter type are obtained. Then, multiple first test case parameters are determined based on the previously determined multiple first feature parameter values that conform to the target parameter type, which are the target test case parameters corresponding to the data types processed by the framework to be tested.
[0107] Example 5
[0108] An embodiment of the present invention provides a test case set processing method, such as... Figure 5 As shown, the test case set processing methods include:
[0109] Step 502: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0110] Step 504: Combine any two preset test parameters from the multiple preset test parameters to generate a preset test case set;
[0111] Step 506: Filter multiple preset test cases in the preset test case set to obtain the first test case set;
[0112] Step 508: Parameterize the parameters of multiple first test cases in the first test case set;
[0113] Step 510: Based on the framework to be tested and the data types processed by the framework to be tested, determine the multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization.
[0114] Step 512: Integrate the parameters of multiple target test cases with the framework to be tested, and test the product to be tested according to the integrated framework.
[0115] In this embodiment, any two of the multiple preset test parameters are first selected and combined to obtain multiple preset test cases. Since each pair of preset test parameters can be freely combined, the comprehensiveness of the obtained preset test cases is guaranteed, and the coverage of the preset test cases for the test scenario is improved.
[0116] Furthermore, since some preset test cases may be completely identical when combining every two preset test parameters, it is necessary to filter multiple preset test cases, that is, to filter out test cases containing duplicate test cases. This ensures the integrity of test cases while reducing redundancy, thereby reducing resource consumption and test case set generation time.
[0117] Example 6
[0118] An embodiment of the present invention provides a test case set processing method, such as... Figure 6 As shown, the test case set processing methods include:
[0119] Step 602: Save multiple test parameters to a preset format file;
[0120] Step 604: The preset format file determines multiple first test parameters and multiple second test parameters based on the multiple parameter values of multiple test parameters;
[0121] Step 606: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0122] Step 608: Perform pairwise algorithm processing on multiple preset test parameters in the preset test parameter list to obtain the first test case set;
[0123] Step 610: Parameterize the parameters of multiple first test cases in the first test case set;
[0124] Step 612: Based on the framework to be tested and the data types processed by the framework to be tested, determine the multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization.
[0125] Step 614: Integrate the parameters of multiple target test cases with the framework to be tested, and test the product to be tested according to the integrated framework.
[0126] In this embodiment, before calling the multiple first test parameters and the multiple second test parameters, the multiple test parameters are first saved to a preset format file. The preset format file can also divide the multiple test parameters into multiple first test parameters and multiple second test parameters according to their own parameter values.
[0127] By saving multiple test parameters to a preset format file, the system enables the storage and maintenance of these parameters, avoiding the need to configure them when test cases are required. This ensures the timeliness of test case generation. Furthermore, the preset format file divides the multiple test parameters into multiple first test parameters and multiple second test parameters, making it easier for users to view and supplement the corresponding test parameters as needed, thereby improving the accuracy of test case generation.
[0128] For example, the preset format file distinguishes between the first test parameter and the second test parameter by using the fields "normal" and "abnormal". Furthermore, among the multiple second test parameters, the preset format file describes each second test parameter separately using the kev-value method. Specifically, the description for blank values is {"blank value":"}.
[0129] Example 7
[0130] An embodiment of the present invention provides a test case set processing method, such as... Figure 7 As shown, the test case set processing methods include:
[0131] Step 702: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters;
[0132] Step 704: Perform pairwise algorithm processing on multiple preset test parameters in the preset test parameter list to obtain the first test case set;
[0133] Step 706: Parameterize the parameters of multiple first test cases in the first test case set;
[0134] Step 708: Based on the framework to be tested and the data types processed by the framework to be tested, determine the multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization.
[0135] Step 710: Generate a target test case set based on multiple target test case parameters;
[0136] Step 712: Determine multiple names for multiple target test cases in the target test case set;
[0137] Step 714: Add multiple names to the corresponding multiple target test cases, and the name of each target test case includes multiple target test cases;
[0138] Step 716: Integrate the target test case set with the added names with the framework to be tested.
[0139] Step 718: Test the product to be tested according to the integrated test framework.
[0140] In this embodiment, after determining multiple target test case parameters, a target test case set is generated. Then, a corresponding test case name is added to each target test case in the target test case set. Since each test case is a combination of corresponding test parameters, it is easier to distinguish different test cases by the test case name.
[0141] Furthermore, since the test framework will test the product under test in the test framework after integration with the target test case set, and generate a test report for the product under test based on the test results, adding the names of multiple target test cases to the corresponding multiple target test cases can make the target test cases better displayed in the test report, thereby better demonstrating the product performance of the product under test, making it easier for users to understand, thus improving the usability of the target test case set and enabling better integration with the test framework.
[0142] Example 8
[0143] A second aspect of the present invention provides a test case set processing apparatus 800. Figure 8 A structural block diagram of a test case set processing apparatus 800 according to an embodiment of this application is shown, as follows: Figure 8 As shown, the test case set processing device 800 includes: an acquisition unit 802, used to acquire multiple first test parameters and multiple second test parameters from a preset format file; a processing unit 804, used to generate a preset test parameter list based on the multiple first test parameters and multiple second test parameters; the processing unit 804 is further used to: perform pairwise algorithm processing on the multiple preset test parameters in the preset test parameter list to obtain a first test case set; perform parameterization processing on the multiple first test case parameters in the first test case set; determine multiple target test case parameters corresponding to the test framework from the multiple first test case parameters after parameterization processing, based on the test framework and the data type processed by the test framework; perform integration processing on the multiple target test case parameters and the test framework, and test the test product based on the integrated test framework.
[0144] The test case set processing device 800 provided by the present invention firstly obtains multiple first test parameters and multiple second test parameters from a preset format file. Specifically, the preset format file is used to store test parameters. The first test parameters can be test parameters with normal values, and the second test parameters can be test parameters with abnormal values. The two types of test parameters are put together to generate a preset test parameter list.
[0145] Subsequently, the processing unit 804 performs pairwise processing on the multiple preset test parameters in this list to generate a first test case set, wherein the multiple first test cases in the first test case set include multiple first test parameters and multiple second test parameters.
[0146] After obtaining multiple first test parameters and multiple second test parameters, the processing unit 804 performs parameterization processing on the multiple first test case parameters in the first test case set, that is, transforms the description of the parameter value itself into a definite parameter value, and then determines the framework to be tested and the data type processed by the framework to be tested.
[0147] Once the data type processed by the framework under test is determined, the processing unit 804 can identify multiple target test case parameters that are the same as the data type processed by the framework under test from the multiple first test case parameters after parameterization. The processing unit then integrates the multiple target test case parameters with the framework under test, thereby creating a test case set in the framework under test that corresponds to the data type it processes. In this way, the framework under test can test the products placed within the framework. By generating target test case parameters based on the data type processed by the framework under test, the direct connection between the test cases and the framework under test is achieved.
[0148] The test case set processing device 800 of the present invention obtains multiple first test parameters and multiple second test parameters from a preset format file through the acquisition unit 802, thereby realizing the saving of test parameters in the preset format file when test parameters are not invoked.
[0149] Meanwhile, the test case set processing device 800 uses multiple first test parameters and multiple second test parameters as preset test parameters, achieving full coverage of the test scenario, reducing the bug escape rate, and improving the comprehensiveness of the generated test cases. The processing unit 804 performs parameterization processing on multiple first test case parameters, providing a more intuitive description of the first test case parameters and facilitating subsequent parameter acquisition.
[0150] The processing unit 804 determines multiple target test case parameters corresponding to the test framework by processing the data type of the test framework, thereby realizing the direct connection between the test cases and the test framework. As a result, the test case set processing device 800 of this application not only achieves coverage of different test scenarios, but also realizes the direct connection between the test cases and the test framework.
[0151] Example 9
[0152] A second aspect of the present invention provides another test case set processing apparatus. Figure 9A schematic diagram of a test case set processing apparatus according to an embodiment of this application is shown, such as... Figure 9 As shown, the test case set processing device includes a data storage unit, a test case generation unit, and a testing unit. The test case generation unit includes a pairwise algorithm module, a parameter processing module, and a data type test case generation module; the testing unit includes a test framework.
[0153] Specifically, the data storage unit stores multiple test parameters of two types: normal test parameter values and abnormal test parameter values; the pairwise algorithm module is used to generate test case sets from multiple test parameters; the parameter processing module is used to format the parameters of each test case in the test case set; the data type test case generation module is used to generate test case sets of corresponding data types according to the data types required by the test framework; the test unit is used to integrate the test framework and the test case sets, and to test the product to be tested according to the integrated test framework.
[0154] Furthermore, Figure 9 The process of processing test case sets through a test case set processing device was also disclosed. Specifically, when the product to be tested needs to be tested through a test framework, the test case generation module sends multiple normal values and abnormal values of test parameters stored in the data storage module to the parameter processing module. The pairwise algorithm module first processes the multiple input test parameters using a pairwise algorithm to obtain multiple test case sets.
[0155] Subsequently, the parameter processing module formats the parameters of each test case in multiple test case sets. That is, it generates parameter values of the corresponding type according to the data type of the parameters of each test case, and uses these parameter values to mark the test parameters, thereby making the characteristics of the test parameters of each test case more obvious.
[0156] After parameterizing the test case parameters, the test case generation module first obtains the data types required by the test framework during testing, and then determines the test parameter types required by the test framework based on the obtained data types. The test case generation module then saves the test parameter types required by the test framework.
[0157] Once the test parameter types required by the test framework are determined, the test case generation module will filter the previously parameterized test parameters. Specifically, it will compare the parameter value of each parameterized test parameter with the test parameter types required by the test framework. When the parameter value of a test parameter matches the test parameter types required by the test framework, the test case generation module will select this parameter.
[0158] After the screening is completed, the selected test parameters are used as test case parameters to test the test framework. The test framework is then integrated with the selected test parameters, resulting in a test parameter set consisting of multiple test parameters. Finally, the test framework with the test parameter set is used to test the product under test, and the test case set processing device finishes processing the test case set.
[0159] Furthermore, the test case generation module can generate test case sets of various data types to meet the testing needs of various testing frameworks; the data types required for testing the product under test are consistent with the data types processed by the testing framework; after the testing framework completes the testing of the product under test, it will generate a test report for the product under test based on the test results to demonstrate the product performance of the product under test.
[0160] The test case set processing device in this embodiment generates different test case sets according to the needs of the test framework through the test case generation module, realizing seamless integration between each test case set and the corresponding test framework. Secondly, the data storage module can save the normal and abnormal values of test parameters, thereby ensuring the test situation in multiple test scenarios. By generating test case sets through pairwise algorithms, the integrity of multiple test parameters is guaranteed, the coverage of test cases is improved, and the bug escape rate is reduced.
[0161] Furthermore, by parameterizing the test parameters in multiple test parameter sets, on the one hand, since each test parameter type can have multiple specific parameter values, and the parameter processing module generates multiple parameter values, the randomness of the parameter values is increased. On the other hand, for test cases composed of multiple highly correlated parameters, the parameter values after parameterization also have strong correlation. Therefore, when multiple parameter values all conform to the parameter types of the test framework, the related parameters can form more test cases, thereby improving the coverage of the test scenario. Simultaneously, automatically generating test case sets improves work efficiency and reduces working time compared to manually adding test cases.
[0162] In summary, the test case set processing device provided in this embodiment not only ensures the coverage of test cases to test scenarios, but also achieves seamless integration with the test framework, thereby improving the test quality and efficiency of the test framework.
[0163] Example 10
[0164] Another embodiment of the present invention provides a test case set processing system, which includes a memory storing a program; and a processor that executes the program to implement the test case set processing method as described in any of the above embodiments.
[0165] The test case set processing system provided in this application includes a memory and a processor. The memory stores programs; the processor is connected to the memory and executes the programs, implementing the test case set processing method as described in any of the above embodiments when the processor executes the programs. Therefore, it possesses all the beneficial effects of the test case set processing method as described in any of the above technical solutions, which will not be elaborated further here.
[0166] Example 11
[0167] Another embodiment of the present invention provides a readable storage medium on which a program is stored, and when the program is executed by a processor, it implements the test case set processing method as described in any of the above technical solutions.
[0168] The readable storage medium provided in this application embodiment is used to store a program that implements the test case set processing method of any of the above technical solutions when executed by a processor. Therefore, it has all the beneficial effects of the test case set processing method of any of the above technical solutions, which will not be repeated here.
[0169] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance, unless otherwise expressly specified and limited. The terms "connection," "installation," and "fixing," etc., should be interpreted broadly. For example, "connection" can mean a fixed connection, a detachable connection, or an integral connection; it can mean a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0170] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0171] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for processing test case sets, characterized in that, include: Obtain multiple first test parameters and multiple second test parameters from a preset format file, and generate a preset test parameter list based on the multiple first test parameters and the multiple second test parameters; The first test case set is obtained by performing a pairwise algorithm on multiple preset test parameters in the preset test parameter list. Parameterize the parameters of multiple first test cases in the first test case set; Based on the framework to be tested and the data type processed by the framework to be tested, determine multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization. The parameters of the multiple target test cases are integrated with the framework to be tested, and the product to be tested is tested according to the integrated framework to be tested. Before the parameterization processing of multiple first test case parameters in the first test case set, the test case set processing method further includes: Configure multiple first rules for multiple first test case parameters in the first test case set, the multiple first rules being used to mark the multiple first test case parameters used for parameterization processing; The first rule configured for each of the first test cases is the same.
2. The test case set processing method according to claim 1, characterized in that, The parameterization processing of multiple first test case parameters in the first test case set specifically includes: Obtain the parameter types of the multiple first test case parameters marked by the multiple first rules, and obtain multiple first parameter types; Multiple first feature parameter values are generated based on the multiple first parameter types, with each first parameter type corresponding to multiple first feature parameter values; The multiple first test case parameters are labeled with multiple first feature parameter values.
3. The test case set processing method according to claim 2, characterized in that, The step of determining multiple target test case parameters corresponding to the framework under test from the multiple first test case parameters after parameterization, based on the framework under test and the data type processed by the framework under test, specifically includes: The target parameter type of the framework under test is determined based on the data types that the framework under test can process. When the multiple first feature parameter values conform to the target parameter type, the multiple first test case parameters that conform to the target parameter type are determined based on the multiple first feature parameter values. Based on the plurality of first test case parameters that conform to the target parameter type, a plurality of target test case parameters corresponding to the framework to be tested are determined.
4. The test case set processing method according to any one of claims 1 to 3, characterized in that, The step of performing a pairwise algorithm on multiple preset test parameters in the preset test parameter list to obtain a first test case set specifically includes: Combine any two preset test parameters from the plurality of preset test parameters to generate a preset test case set; The first test case set is obtained by filtering multiple preset test cases in the preset test case set.
5. A test case set processing device, characterized in that, include: The acquisition unit is used to acquire multiple first test parameters and multiple second test parameters from a preset format file; The processing unit is configured to generate a preset test parameter list based on the plurality of first test parameters and the plurality of second test parameters; The processing unit is also used for: The first test case set is obtained by performing a pairwise algorithm on multiple preset test parameters in the preset test parameter list. Parameterize the parameters of multiple first test cases in the first test case set; Based on the framework to be tested and the data type processed by the framework to be tested, determine multiple target test case parameters corresponding to the framework to be tested from the multiple first test case parameters after parameterization. The parameters of the multiple target test cases are integrated with the framework to be tested, and the product to be tested is tested according to the integrated framework to be tested. The processing unit is also used for: Configure multiple first rules for multiple first test case parameters in the first test case set, the multiple first rules being used to mark the multiple first test case parameters used for parameterization processing; The first rule configured for each of the first test cases is the same.
6. A test case set processing system, characterized in that, include: A memory, wherein the memory stores a program; A processor that, when executing the program, implements the test case set processing method as described in any one of claims 1 to 4.
7. A readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the test case set processing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for achieving data parameterization
CN106681921A
Test case automatic generation method and device, terminal and storage medium
CN110334009A
Test case generation method and device, computer equipment and storage medium
CN112527630A
