A test case generation method, device, electronic device and storage medium
By editing the test case pattern by generating methods, adding and combining test parameters, the problem of inefficiency in manual configuration parameters in automated tests is solved, and more efficient test case configuration is achieved.
Patent Information
- Application Number
- CN202411329547.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-09-24
AI Technical Summary
In automated testing, it is very laborious to manually fill in different parameters for the same test case, resulting in inefficient test case configuration.
Through the generation method, edit the test case pattern based on user needs, add multiple test parameters, and generate target test cases through cross-combination, sequence combination or custom combination to avoid duplicate configuration.
Improves the efficiency of test case configuration, saves configuration time, and reduces multiple configurations of the same test case.
Smart Images

Figure CN118838851B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automated testing of semiconductor devices, and in particular to a test case generation method, device, electronic device and storage medium. Background Art
[0002] When using automated testing software for testing, a series of automated test scripts and test samples will be executed. These test samples are decomposed, abstracted, and written by test engineers from the actual test process. A set of test processes often contains multiple test cases. In order to ensure the reusability of the script, the voltage and current output by the test instrument will be made into input parameters. During the implementation process, the device under test has the requirement to use different parameters to execute the same test case multiple times to obtain the real physical characteristics of the device under test. However, in the face of such a demand, although different parameters can be manually filled in for the same test case, there is a close relationship between the number of parameters and the range of values, which has caused an explosive increase in the workload of manual filling, causing great trouble to the work of test engineers. Therefore, how to improve the efficiency of test case configuration has become a technical issue that cannot be underestimated. Summary of the invention
[0003] In view of this, the purpose of the present application is to provide a test case generation method, device, electronic device and storage medium, which can configure and arrange the parameters in the test case when configuring the test case, instead of repeatedly configuring the same test case for the purpose of configuring the parameters, thereby avoiding configuring the same test case multiple times to adapt to different parameters, improving testing efficiency and saving test case configuration time.
[0004] The present invention provides a method for generating a test case, which comprises:
[0005] Based on user requirements, the current test case mode of the basic test case is edited to determine the target test case mode; wherein the test case mode includes a general test case mode, a scanning test case mode and a shmoo test case mode;
[0006] For the target test case mode being the scanning test case mode, multiple test parameters are added in the target test case mode based on the user needs, a target permutation and combination mode of the test parameters is screened out from multiple permutation and combination modes, and multiple test parameters are traversed and combined based on the target permutation and combination mode to generate a target test case; wherein the permutation and combination modes include cross combination, sequence combination and custom combination;
[0007] The general test script is called to test the target test case to generate a test result.
[0008] In a possible implementation manner, when the target permutation and combination mode is the cross combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes:
[0009] The parameter value list of each test parameter is regarded as a test parameter set, and Cartesian product processing is performed on each test parameter set to determine the test parameter combination result;
[0010] The target test case is generated based on the test parameter combination result and the basic test case.
[0011] In a possible implementation manner, when the target permutation and combination mode is the sequence combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes:
[0012] The parameter value list of each test parameter is taken as an ordered parameter list, and the parameter values in each ordered parameter list are extracted in turn to construct a test parameter combination result; wherein the length of the shortest ordered parameter list is the number of items in the test parameter combination result;
[0013] The target test case is generated based on the test parameter combination result and the basic test case.
[0014] In a possible implementation manner, when the target permutation and combination mode is the custom combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes:
[0015] Performing traversal combinations on any two of the parameter value lists of the test parameters in the parameter value lists of the multiple test parameters based on the cross combination or the sequence combination to generate a test parameter combination result;
[0016] The test parameter combination result and the parameter value list of the next test parameter are traversed and combined based on the cross combination or the sequence combination to generate the next test parameter combination result, until the parameter value lists of multiple test parameters are involved in completing the traversal combination, and the target test parameter combination result corresponding to the last traversal combination is determined;
[0017] The target test case is generated based on the target test parameter combination result and the basic test case.
[0018] In a possible implementation manner, after taking the parameter value list of each test parameter as a test parameter set and performing Cartesian product processing on each test parameter set to determine a new test parameter set, the test case generation method further includes:
[0019] Eliminating test parameters from the test parameter combination result based on the set filtering information to obtain the test parameter combination result after elimination;
[0020] The target test case is generated based on the test parameter combination result after elimination and the basic test case.
[0021] In a possible implementation manner, after editing the current test case pattern of the basic test case based on the user requirements and determining the target test case pattern, the test case generation method further includes:
[0022] For the target test case mode being the general test case mode, multiple test parameters are added in the test case mode based on the user requirements, and the target test case is generated based on the multiple test parameters and the basic test case.
[0023] In a possible implementation manner, after editing the current test case pattern of the basic test case based on the user requirements and determining the target test case pattern, the test case generation method further includes:
[0024] For the target test case mode being the shmoo test case mode, a parameter value list of two test parameters under the test case mode is tested and executed to determine boundary values of the two test parameters that can be accepted by the device under test;
[0025] The target test case is generated based on the boundary values of the two test parameters and the basic test case.
[0026] The present application also provides a test case generation device, the test case generation device comprising:
[0027] A test case mode selection module is used to edit the current test case mode of the basic test case based on user needs and determine the target test case mode; wherein the test case mode includes a general test case mode, a scanning test case mode and a shmoo test case mode;
[0028] A first processing module is used for adding multiple test parameters in the target test case mode based on the user's needs when the target test case mode is the scanning test case mode, screening out a target permutation and combination mode of the test parameters from multiple permutation and combination modes, traversing and combining multiple test parameters based on the target permutation and combination mode, and generating a target test case; wherein the permutation and combination mode includes a cross combination, a sequence combination, and a custom combination;
[0029] The test result generation module is used to call the general test script to test the target test case and generate test results.
[0030] An embodiment of the present application also provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the test case generation method as described above are performed.
[0031] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the test case generation method as described above are executed.
[0032] A test case generation method, device, electronic device and storage medium provided by an embodiment of the present application, the test case generation method includes: editing the current test case mode of the basic test case based on user needs to determine the target test case mode; wherein the test case mode includes a general test case mode, a scanning test case mode and a shmoo test case mode; for the target test case mode being the scanning test case mode, adding multiple test parameters in the target test case mode based on the user needs, screening out the target permutation and combination mode of the test parameters from multiple permutation and combination modes, traversing and combining multiple test parameters based on the target permutation and combination mode, and generating a target test case; wherein the permutation and combination mode includes a cross combination, a sequence combination and a custom combination; calling a general test script to test the target test case and generate a test result. When configuring the test case, the parameters in the test case can be configured and permuted and combined, rather than repeatedly configuring the same test case for the purpose of configuring the parameters, avoiding configuring the same test case multiple times to adapt to different parameters, improving the test efficiency and saving the test case configuration time.
[0033] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A flowchart of a test case generation method provided in an embodiment of the present application;
[0036] Figure 2 One of the structural schematic diagrams of a test case generation method device provided in an embodiment of the present application;
[0037] Figure 3 A second structural diagram of a test case generation method device provided in an embodiment of the present application;
[0038] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0040] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied to the field of automated testing technology for semiconductor devices.
[0041] According to research, when using automated test software for testing, a series of automated test scripts and test samples will be executed. These test samples are decomposed, abstracted, and written by test engineers from the actual test process. A set of test processes often contains multiple test cases. In order to ensure the reusability of the script, the voltage and current output by the test instrument will be made into input parameters. During the implementation process, the device under test has the requirement to execute the same test case multiple times with different parameters to obtain the real physical characteristics of the device under test. However, in the face of such a demand, although different parameters can be manually filled in for the same test case, there is a close relationship between the number of parameters and the range of values, which has caused an explosive increase in the workload of manual filling, causing great trouble to the work of test engineers. Therefore, how to improve the efficiency of test case configuration has become a technical issue that cannot be underestimated.
[0042] Based on this, an embodiment of the present application provides a test case generation method, which can configure and arrange the parameters in the test case when configuring the test case, instead of repeatedly configuring the same test case for the purpose of configuring the parameters. This avoids configuring the same test case multiple times to adapt to different parameters, improves testing efficiency and saves test case configuration time.
[0043] See also Figure 1 , Figure 1 A flow chart of a test case generation method provided in an embodiment of the present application. Figure 1 As shown in , the test case generation method provided by the embodiment of the present application includes:
[0044] S101: Edit the current test case pattern of the basic test case based on user requirements to determine a target test case pattern; wherein the test case pattern includes a general test case pattern, a scanning test case pattern and a shmoo test case pattern.
[0045] In this step, the current test case pattern of the basic test case is edited according to user requirements to determine the target test case pattern.
[0046] Here, according to the actual test situation, the test case modes are divided into three types (general test case mode, scanning test case mode and shmoo test case mode). When using, the test engineer can choose the appropriate test case mode according to different test requirements.
[0047] Among them, the basic test cases are test cases that have been generated before, and the tests between the basic test cases can be changed directly to avoid rebuilding the test case framework.
[0048] S102: When the target test case mode is the scanning test case mode, multiple test parameters are added in the target test case mode based on the user needs, a target permutation and combination method of the test parameters is screened out from multiple permutations and combinations, and multiple test parameters are traversed and combined based on the target permutation and combination method to generate a target test case.
[0049] In this step, for the target test case mode being a scanning test case mode, multiple test parameters are added in the target test case mode according to user requirements, a target permutation and combination of the test parameters is screened out from multiple permutations and combinations, and multiple test parameters are traversed and combined according to the target permutation and combination to generate a target test case.
[0050] Among them, the permutation and combination methods include cross combination, sequence combination and custom combination. Cross combination (Combine_All): Each test parameter has a value list of each test parameter, and each value list is regarded as a set. Assuming that there are n test parameters, n sets can be obtained. Take the Cartesian product of n sets, and the new set obtained is the combination result of Combine_All. Sequence combination (Permutate_All): The value lists of each parameter are ordered lists. The i-th item of each list is extracted as the i-th item of the combination result. When the subscript i is at the end of a list for the first time, the test parameter combination result is obtained. Custom combination (Custom): Each test parameter has its own value list, and supports the combination of the first two rules (Combine_All, Permutate_All) for any two value lists. The obtained combination result can be used as a new value list and combined with other parameters according to the first two rules (Combine_All, Permutate_All).
[0051] Here, the test parameters of the scan test case mode can be multi-valued, that is, you can customize the value list, or you can specify the start value, end value, and step value for the value type parameter to automatically generate a value list. For example, a test method has three input parameters representing the input voltage of three pins, and the value of each input parameter is in a different range (or a custom value list), and the three test parameters are combined under different values.
[0052] In a possible implementation manner, when the target permutation and combination mode is the cross combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes:
[0053] A: Take the parameter value list of each test parameter as a test parameter set, perform Cartesian product processing on each test parameter set, and determine the test parameter combination result.
[0054] Here, the parameter value list of each test parameter is taken as a test parameter set, and Cartesian product processing is performed on each test parameter set to determine the test parameter combination result.
[0055] B: Generate the target test case based on the test parameter combination result and the basic test case.
[0056] Here, target test cases are generated according to the test parameter combination results and the basic test cases.
[0057] In a possible implementation manner, when the target permutation and combination mode is the sequence combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes:
[0058] (1): Take the parameter value list of each test parameter as an ordered parameter list, extract the parameter values in each ordered parameter list in turn, and construct the test parameter combination result; among which, the length of the shortest ordered parameter list is the number of items in the test parameter combination result.
[0059] Here, the parameter value list of each test parameter is taken as an ordered parameter list, and the parameter values in each ordered parameter list are extracted in turn to construct the test parameter combination result.
[0060] For example, there are three parameter value lists {a,b,c,d,e,f,g}, {x,y,z}, {j,k}. In this permutation and combination mode, the test parameter combination result is {(a,x,j),(b,y,k)}. Because the length of the shortest parameter value list is 2, the test parameter combination result is only two.
[0061] (2): Based on the test parameter combination result and the basic test case, generate the target test case.
[0062] Here, target test cases are generated according to the test parameter combination results and the basic test cases.
[0063] In a possible implementation manner, when the target permutation and combination mode is the custom combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes:
[0064] a: traverse and combine any two of the parameter value lists of the test parameters in the parameter value lists of the multiple test parameters based on the cross combination or the sequence combination to generate a test parameter combination result.
[0065] Here, any two parameter value lists of the test parameters in the parameter value lists of the multiple test parameters are traversed and combined according to the cross combination or the sequence combination to generate a test parameter combination result.
[0066] b: The test parameter combination result and the parameter value list of the next test parameter are traversed and combined based on the cross combination or the sequence combination to generate the next test parameter combination result, until the parameter value lists of multiple test parameters are involved in completing the traversal combination, and the target test parameter combination result corresponding to the last traversal combination is determined.
[0067] Here, the test parameter combination results and the parameter value list of the next test parameter are traversed and combined according to the cross combination or sequence combination to generate the next test parameter combination result, until the parameter value lists of multiple test parameters are involved in completing the traversal combination, and the target test parameter combination result corresponding to the last traversal combination is determined.
[0068] c: Generate the target test case based on the target test parameter combination result and the basic test case.
[0069] Here, a target test case is generated according to the target test parameter combination result and the basic test case.
[0070] Here, each test parameter has its own parameter value list, and supports combining any two parameter value lists with the first two rules (Combine_All, Permutate_All). The obtained test parameter combination result is used as input to combine with the next parameter value list with the first two rules (Combine_All, Permutate_All). For example, if the parameter value list is Var1, Var2, Var3, then Combine_All or Permutate_All is performed on Var1 and Var2 to obtain the test parameter combination result (Var1, Var2), and Combine_All or Permutate_All is performed on (Var1, Var2) and Var3 to obtain the target test parameter combination result.
[0071] In a possible implementation manner, after taking the parameter value list of each test parameter as a test parameter set and performing Cartesian product processing on each test parameter set to determine a new test parameter set, the test case generation method further includes:
[0072] The test parameter combination result is subjected to test parameter elimination based on the set filtering information to obtain the test parameter combination result after elimination; and the target test case is generated based on the test parameter combination result after elimination and the basic test case.
[0073] Here, the test parameter combination result is subjected to test parameter elimination according to the set filtering information to obtain the test parameter combination result after elimination, and the target test case is generated according to the test parameter combination result after elimination and the basic test case.
[0074] In a specific embodiment, in the scanning test case mode, many test parameters can be configured simply and quickly. For the test parameter combination results generated in the permutation and combination mode, the filter can be compared to filter out the test parameters that do not meet the filtering conditions. For example, edit the test case, change the test case mode to the scanning test case mode, add the value list of the test parameter V (the unit refers to the instrument document), such as: starting value 0, end value 5, step value 0.5, and obtain the value list set [0, 0.5, 1, ..., 5], add the value list of the test parameter C, such as: [0.3, 0.35, 0.5], select the permutation and combination mode as Combine_All, and get 30 groups (10 * 3) of different input parameters of the edited test case,) set the filtering information to condition 1 (V! = 3.5), condition 2 (C! = 0.3), and get 18 groups of test parameter combination results after screening.
[0075] In a possible implementation manner, after editing the current test case pattern of the basic test case based on the user requirements and determining the target test case pattern, the test case generation method further includes:
[0076] For the target test case mode being the general test case mode, multiple test parameters are added in the test case mode based on the user requirements, and the target test case is generated based on the multiple test parameters and the basic test case.
[0077] Here, the target test case mode is a general test case mode, multiple test parameters are added in this test case mode, and the target test case is generated according to the multiple test parameters and the basic test case.
[0078] Among them, the general test case mode (Nomal mode) means that the input test parameters can be configured to any value, but they cannot be modified through external configuration when the program is executed. It is often used in test methods that can get the required test results by filling in the parameters once. For example, the test engineer applies a 3.3 volt voltage to the pin VCC1 to get the current value (set the current clamp to 0.1 amps), and can directly add the test parameter VCC1 as 3.3 volts when configuring the test method.
[0079] In a possible implementation manner, after editing the current test case pattern of the basic test case based on the user requirements and determining the target test case pattern, the test case generation method further includes:
[0080] i: When the target test case mode is the shmoo test case mode, a parameter value list of two test parameters under the test case mode is tested and executed to determine boundary values of the two test parameters that can be accepted by the device under test.
[0081] Here, for the target test case mode being the shmoo test case mode, a parameter value list of two test parameters in the test case mode is tested and executed to determine the boundary values of the two test parameters that the device under test can accept.
[0082] ii: Based on the boundary values of the two test parameters and the basic test case, generate the target test case.
[0083] Here, the target test case is generated according to the boundary values of the two test parameters and the basic test case.
[0084] Among them, the shmoo test case mode focuses on the connection between two input parameters of numerical type. You can configure the numerical list for the two numerical parameters respectively, and observe the boundary values of the parameters (the maximum and minimum values that the device under test can accept as input) and the real characteristics of the parameters of the device under test through the test results. For example, input the voltage values of two pins, test the two voltage values, and get the boundary values of the two voltage values that the device under test can accept.
[0085] S103: calling a general test script to test the target test case and generate a test result.
[0086] In this step, the general test script is called to test the target test case and generate test results.
[0087] A test case generation method provided by an embodiment of the present application includes: editing the current test case mode of the basic test case based on user needs to determine the target test case mode; wherein the test case mode includes a general test case mode, a scanning test case mode and a shmoo test case mode; for the target test case mode being the scanning test case mode, adding multiple test parameters under the target test case mode based on the user needs, screening out the target permutation and combination mode of the test parameters from multiple permutation and combination modes, traversing and combining multiple test parameters based on the target permutation and combination mode, and generating a target test case; wherein the permutation and combination mode includes a cross combination, a sequence combination and a custom combination; calling a general test script to test the target test case and generate a test result. When configuring the test case, the parameters in the test case can be configured and permuted and combined, rather than repeatedly configuring the same test case for the purpose of configuring the parameters, thereby avoiding configuring the same test case multiple times to adapt to different parameters, improving the test efficiency and saving the test case configuration time.
[0088] See also Figure 2 , Figure 3 , Figure 2 One of the structural schematic diagrams of a test case generation method device provided in an embodiment of the present application; Figure 3 The second structural diagram of a test case generation method device provided in the embodiment of the present application. Figure 2 As shown in , the test case generating device 200 includes:
[0089] The test case mode selection module 210 is used to edit the current test case mode of the basic test case based on user requirements and determine the target test case mode; wherein the test case mode includes a general test case mode, a scanning test case mode and a shmoo test case mode;
[0090] The first processing module 220 is used for adding multiple test parameters in the target test case mode based on the user requirements when the target test case mode is the scanning test case mode, screening out a target permutation and combination mode of the test parameters from multiple permutation and combination modes, traversing and combining multiple test parameters based on the target permutation and combination mode, and generating a target test case; wherein the permutation and combination mode includes a cross combination, a sequence combination, and a custom combination;
[0091] The test result generating module 230 is used to call the general test script to test the target test case and generate a test result.
[0092] Further, when the first processing module 220 is used for traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case, the first processing module 220 is used to:
[0093] The parameter value list of each test parameter is regarded as a test parameter set, and Cartesian product processing is performed on each test parameter set to determine the test parameter combination result;
[0094] The target test case is generated based on the test parameter combination result and the basic test case.
[0095] Further, when the first processing module 220 is used for traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case, the first processing module 220 is specifically used for:
[0096] The parameter value list of each test parameter is taken as an ordered parameter list, and the parameter values in each ordered parameter list are extracted in turn to construct a test parameter combination result; wherein the length of the shortest ordered parameter list is the number of items in the test parameter combination result;
[0097] The target test case is generated based on the test parameter combination result and the basic test case.
[0098] Further, when the first processing module 220 is used for traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case, the first processing module 220 is specifically used for:
[0099] Performing traversal combinations on any two of the parameter value lists of the test parameters in the parameter value lists of the multiple test parameters based on the cross combination or the sequence combination to generate a test parameter combination result;
[0100] The test parameter combination result and the parameter value list of the next test parameter are traversed and combined based on the cross combination or the sequence combination to generate the next test parameter combination result, until the parameter value lists of multiple test parameters are involved in completing the traversal combination, and the target test parameter combination result corresponding to the last traversal combination is determined;
[0101] The target test case is generated based on the target test parameter combination result and the basic test case.
[0102] Furthermore, the first processing module 220 is further configured to:
[0103] Eliminating test parameters from the test parameter combination result based on the set filtering information to obtain the test parameter combination result after elimination;
[0104] The target test case is generated based on the test parameter combination result after elimination and the basic test case.
[0105] Further, such as Figure 3 As shown, the test case generating device 200 further includes a second processing module 240, and the second processing module 240 is used to:
[0106] For the target test case mode being the general test case mode, multiple test parameters are added in the test case mode based on the user requirements, and the target test case is generated based on the multiple test parameters and the basic test case.
[0107] Furthermore, the second processing module 240 is further configured to:
[0108] For the target test case mode being the shmoo test case mode, a parameter value list of two test parameters under the test case mode is tested and executed to determine boundary values of the two test parameters that can be accepted by the device under test;
[0109] The target test case is generated based on the boundary values of the two test parameters and the basic test case.
[0110] The present application provides a test case generation device, the test case generation device includes: a test case mode selection module, which is used to edit the current test case mode of the basic test case based on user needs and determine the target test case mode; wherein the test case mode includes a general test case mode, a scanning test case mode and a shmoo test case mode; a first processing module, which is used for adding multiple test parameters in the target test case mode based on the user needs for the target test case mode as the scanning test case mode, screening out the target permutation and combination mode of the test parameters from multiple permutation and combination modes, traversing and combining multiple test parameters based on the target permutation and combination mode, and generating a target test case; wherein the permutation and combination mode includes a cross combination, a sequence combination and a custom combination; a test result generation module, which is used to call a general test script to test the target test case and generate a test result. When configuring the test case, the parameters in the test case can be configured and permuted, rather than repeatedly configuring the same test case for the configuration parameters, avoiding multiple configurations of the same test case to adapt to different parameters, improving the test efficiency and saving the test case configuration time.
[0111] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .
[0112] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of the test case generation method in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0113] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the test case generation method in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0115] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0119] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A test case generation method, characterized in that: The test case generation method comprises: Select the current test case mode of the basic test case based on user needs and determine the target test case mode; In view of the target test case mode being a scanning test case mode, multiple test parameters are added in the target test case mode based on the user needs, a target permutation and combination mode of the test parameters is screened out from multiple permutation and combination modes, and multiple test parameters are traversed and combined based on the target permutation and combination mode to generate a target test case; wherein the permutation and combination modes include cross combination, sequence combination and custom combination; Calling a general test script to test the target test case and generate a test result; For the target permutation and combination mode being the custom combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes: Performing traversal combinations on any two of the parameter value lists of the test parameters in the parameter value lists of the multiple test parameters based on the cross combination or the sequence combination to generate a test parameter combination result; The test parameter combination result and the parameter value list of the next test parameter are traversed and combined based on the cross combination or the sequence combination to generate the next test parameter combination result, until the parameter value lists of multiple test parameters are involved in completing the traversal combination, and the target test parameter combination result corresponding to the last traversal combination is determined; Based on the target test parameter combination result and the basic test case, generate the target test case; When the target permutation and combination mode is the cross combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes: The parameter value list of each test parameter is regarded as a test parameter set, and Cartesian product processing is performed on each test parameter set to determine the test parameter combination result; Based on the test parameter combination result and the basic test case, generate the target test case; For the target permutation and combination mode being the sequence combination, traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case includes: The parameter value list of each test parameter is taken as an ordered parameter list, and the parameter values in each ordered parameter list are extracted in turn to construct a test parameter combination result; wherein the length of the shortest ordered parameter list is the number of items in the test parameter combination result; The target test case is generated based on the test parameter combination result and the basic test case.
2. The test case generation method according to claim 1, characterized in that: After taking the parameter value list of each test parameter as a test parameter set and performing Cartesian product processing on each test parameter set to determine a new test parameter set, the test case generation method further includes: Eliminating test parameters from the test parameter combination result based on the set filtering information to obtain the test parameter combination result after elimination; The target test case is generated based on the test parameter combination result after elimination and the basic test case.
3. The test case generation method according to claim 1, characterized in that: After selecting the current test case mode of the basic test case based on the user requirements and determining the target test case mode, the test case generation method further includes: In view of the target test case mode being a general test case mode, multiple test parameters are added in the test case mode based on the user requirements, and the target test case is generated based on the multiple test parameters and the basic test case.
4. The test case generation method according to claim 1, characterized in that: After selecting the current test case mode of the basic test case based on the user requirements and determining the target test case mode, the test case generation method further includes: When the target test case mode is the shmoo test case mode, a parameter value list of two test parameters under the test case mode is tested and executed to determine the boundary values of the two test parameters that can be accepted by the device under test; The target test case is generated based on the boundary values of the two test parameters and the basic test case.
5. A test case generating device, characterized in that: The test case generating device comprises: A test case mode selection module is used to select the current test case mode of the basic test case based on user requirements and determine the target test case mode; A first processing module is used for adding multiple test parameters in the target test case mode based on the user's needs when the target test case mode is a scanning test case mode, screening out a target permutation and combination mode of the test parameters from multiple permutation and combination modes, traversing and combining multiple test parameters based on the target permutation and combination mode, and generating a target test case; wherein the permutation and combination mode includes a cross combination, a sequence combination, and a custom combination; A test result generation module is used to call a general test script to test the target test case and generate a test result; When the first processing module is used for traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case, the first processing module is specifically used for: Performing traversal combinations on any two of the parameter value lists of the test parameters in the parameter value lists of the multiple test parameters based on the cross combination or the sequence combination to generate a test parameter combination result; The test parameter combination result and the parameter value list of the next test parameter are traversed and combined based on the cross combination or the sequence combination to generate the next test parameter combination result, until the parameter value lists of multiple test parameters are involved in completing the traversal combination, and the target test parameter combination result corresponding to the last traversal combination is determined; Based on the target test parameter combination result and the basic test case, generate the target test case; When the first processing module is used for traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case, the first processing module is specifically used for: The parameter value list of each test parameter is regarded as a test parameter set, and Cartesian product processing is performed on each test parameter set to determine the test parameter combination result; Based on the test parameter combination result and the basic test case, generate the target test case; When the first processing module is used for traversing and combining multiple test parameters based on the target permutation and combination mode to generate a target test case, the first processing module is specifically used for: The parameter value list of each test parameter is taken as an ordered parameter list, and the parameter values in each ordered parameter list are extracted in turn to construct a test parameter combination result; wherein the length of the shortest ordered parameter list is the number of items in the test parameter combination result; The target test case is generated based on the test parameter combination result and the basic test case.
6. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the test case generation method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the test case generation method according to any one of claims 1 to 4 are executed.
Citation Information
Patent Citations
Test case generation method and device, storage medium and processor
CN116501622A
Chip evaluation method based on shmoo test, test equipment, system and electronic equipment
CN118311407A