Test case selection method and device and electronic equipment
By adopting a tree data structure in the test case storage and using the parameter information input by the user to quickly locate the target node, the problem of long test case selection time in the existing technology is solved and the testing efficiency is improved.
Patent Information
- Application Number
- CN202411378906.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, the process of selecting test cases requires traversing a large number of test cases, resulting in a long selection time and reducing the testing efficiency.
The tree -shaped data structure is used to organize test cases, and the target node is determined through the parameter information entered by the user to quickly locate and select the required test cases.
Through the use of tree data structures, the time for selecting test cases is significantly reduced and the efficiency of testing is improved.
Smart Images

Figure CN119357048A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a test case selection method, device and electronic equipment. Background Art
[0002] With the advancement of technology, more and more new functions are added to each application. Each new function needs to be tested using test cases before it goes online. Usually, each version of the test cases needs to be saved.
[0003] Currently, test cases are usually stored in a single branch storage or in multiple branches. However, if a test case needs to be selected, most of the test cases need to be traversed and selected from the beginning in a single branch storage structure. In a multiple branch storage structure, since there is no proper index, it is also necessary to select the required test cases from most of the test cases. Selecting test cases in the above two storage methods increases the time for selecting test cases and reduces the efficiency of testing. Summary of the invention
[0004] In order to solve the problems in the above-mentioned related technologies, the present application example provides a test case selection method, device and electronic device.
[0005] In a first aspect, an embodiment of the present application provides a test case selection method, the method comprising:
[0006] In response to parameter information input by a user, obtaining multiple target parameter values included in the parameter information;
[0007] Determine multiple target nodes of a tree data structure according to the multiple target parameter values; wherein the tree data structure includes multiple nodes; the level at which each node is located corresponds to a parameter one by one, and each node at the same level represents a different value of the same parameter; any two of the target nodes are at different levels;
[0008] The test cases stored in the first storage space corresponding to the first target node are used as target test cases; the first target node is a leaf node, and the leaf node has no child nodes; the parameter values corresponding to any leaf node and the parameter values corresponding to multiple parent nodes of the any leaf node are the parameter values contained in the test cases stored in the first storage space corresponding to the any leaf node.
[0009] By using a tree data structure to select test cases, compared with selecting test cases stored in a single branch or multiple branches, there is no need to select required test cases from most test cases, which can reduce the time for selecting test cases and improve test efficiency.
[0010] In a possible implementation manner, before responding to the parameter information input by the user, the method further includes:
[0011] If the test case stored in the first storage space corresponding to any leaf node is updated, the original test case and the test result corresponding to the original test case are stored in the second storage space corresponding to any leaf node;
[0012] In response to the user's viewing operation, the differentiation steps between the updated test case stored in the first storage space corresponding to any leaf node and the original test case stored in the second storage space corresponding to any leaf node are determined, and the user is notified of the differentiation steps.
[0013] By saving historical test cases in the second storage space and displaying the difference steps between historical test cases and updated test cases according to the user's viewing operation, the difference between different versions of test cases can be made more obvious, and the user can make corresponding adjustments to different versions of test cases according to the difference steps.
[0014] In a possible implementation, the method further includes:
[0015] Get the test cases that need to be saved;
[0016] Determine multiple parameter values included in the test case to be saved, and determine the nodes of the tree data structure in order of hierarchy according to the multiple parameter values until a leaf node is determined;
[0017] Based on the encoding information corresponding to each step in the test case that needs to be saved, a storage operation is performed in the first storage space corresponding to the determined leaf node.
[0018] According to the parameter value corresponding to each node in the tree data structure and the parameter value contained in the test case to be saved, the location where the test case to be saved can be saved is determined, which shows that the use of the tree data structure can not only reduce the burden of users selecting test cases, but also make the process of saving test cases simpler.
[0019] In a possible implementation, performing a storage operation in a first storage space corresponding to a determined leaf node based on the encoding information corresponding to each step in the test case to be saved includes:
[0020] For any step in the test case that needs to be saved, if the coding information corresponding to any step is the same as the saved coding information, then based on the correspondence between the coding information and the coding identifier, determine the coding identifier corresponding to the coding information of any step, and store the determined coding identifier in the first storage space corresponding to the determined leaf node;
[0021] If the coding information corresponding to any one of the steps is different from the saved coding information, the coding information corresponding to any one of the steps is stored in the first storage space corresponding to the determined leaf node, and a unique coding identifier is assigned to the coding information corresponding to any one of the steps, and a corresponding relationship between the coding information corresponding to any one of the steps and the coding identifier is established.
[0022] By comparing the coding information corresponding to any step with the saved coding information, different coding information can be saved. For the same coding information, only one coding information is saved, and the coding identifier corresponding to the coding information is saved in other steps, which can greatly reduce space occupancy.
[0023] In a possible implementation, the encoding information corresponding to each step is determined in the following manner:
[0024] For any step in the test case to be saved, extract the step information of the any step; the step information includes a valid character string of the any step;
[0025] The valid character string is encoded using the MD5 algorithm to obtain encoding information corresponding to any one of the steps.
[0026] Compared with directly saving test cases, using the MD5 algorithm to encode valid strings can reduce the pressure on memory usage.
[0027] In a possible implementation manner, after taking the test case stored in the first storage space corresponding to the first target node as the target test case, the method further includes:
[0028] The test is performed according to the steps of the target test case in the test environment stored in the third storage space corresponding to the first target node, and the test results are recorded; the test environment is configured according to the environmental parameters in the parameter values corresponding to multiple parent nodes of the first target node.
[0029] The third storage space in the first target node can also store the test environment determined according to the multiple parent nodes, which can save time for configuring different test environments according to different test cases.
[0030] In a possible implementation manner, after recording the test results, the method further includes:
[0031] If an error occurs during the test, the user will be notified of the error message and corresponding modification suggestions;
[0032] In response to the user's modification of the target test case based on the error information, retesting is performed using the modified target test case, and the result obtained from the retesting is updated.
[0033] By providing error messages and modification suggestions during the test process, users can make modifications to test cases or test objects, thus improving test efficiency.
[0034] In a second aspect, an embodiment of the present application provides a test case selection device, comprising:
[0035] A target parameter value acquisition unit, configured to respond to parameter information input by a user and acquire a plurality of target parameter values included in the parameter information;
[0036] A target node determination unit, configured to determine a plurality of target nodes of a tree data structure according to the plurality of target parameter values; wherein the tree data structure comprises a plurality of nodes; the level at which each node is located corresponds one-to-one to a parameter, and each node at the same level represents a different value of the same parameter; any two of the target nodes are at different levels;
[0037] A test execution unit is used to use the test cases stored in the first storage space corresponding to the first target node as target test cases; the first target node is a leaf node, and the leaf node has no child nodes; the parameter values corresponding to any leaf node and the parameter values corresponding to multiple parent nodes of the any leaf node are the parameter values contained in the test cases stored in the first storage space corresponding to the any leaf node.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0039] A memory for storing program instructions;
[0040] The processor is used to call the program instructions stored in the memory and execute the steps included in the method described in the first aspect according to the obtained program instructions.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the first aspect.
[0042] The embodiments of the present application provide a test case selection method, device and electronic device. Through the test case selection method provided by the embodiments of the present application, it is possible to respond to parameter information input by a user, obtain multiple target parameter values contained in the parameter information, and determine multiple target nodes of a tree data structure based on the multiple target parameter values, wherein the tree data structure has been constructed before the user selects a test case, and the tree data structure contains multiple nodes. There is a parent-child relationship between any two adjacent nodes in the multiple nodes. The level at which each node is located corresponds to the parameter one-to-one, and each node at the same level represents a different value of the same parameter. Any two target nodes are at different levels, and the test case stored in the first storage space of the first target node is used as the target test case for testing. By using the tree data structure to select the test case, compared with selecting the test case stored in a single branch or multiple branches, the time for selecting the test case can be reduced and the efficiency of the test can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 A schematic diagram of an application scenario of a test case selection method provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of a test case selection method provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of a tree data structure provided in an embodiment of the present application;
[0047] Figure 4 A flowchart of obtaining multiple target parameter values included in parameter information provided in an embodiment of the present application;
[0048] Figure 5 A flowchart of a specific test case selection method provided in an embodiment of the present application;
[0049] Figure 6 A structural block diagram of a test case selection device provided in an embodiment of the present application;
[0050] Figure 7 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order 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. Among them, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0052] In the description of the embodiments of the present application, unless otherwise specified, "and" means or. For example, A / B can mean A or B. The "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0053] Specifically, in the description of the present application, it needs to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application, and, unless otherwise specified, the "connection" and "connection" mentioned in the present application include direct and indirect connections (connections).
[0054] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0055] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] Figure 1 A schematic diagram of an application scenario of a test case selection method provided in an embodiment of the present application is shown. Figure 1 As shown, Figure 1The electronic device 1 100, the electronic device 2 200 and the database 110 are included. The electronic device 1 100 can establish a communication connection with the database 110, so that the electronic device 1 100 can store the test case in the database 110, wherein the database 110 can be a server capable of transmitting data between the electronic device 1 100, or a cloud storage capable of transmitting data between the electronic device 1 100, and the present application does not limit this; and the electronic device 2 200 can store the test case in the storage in the electronic device 2 200, or in the built-in database 110, and the present application does not limit this either. It should be noted that after the electronic device 1 100 stores the test case, the electronic device 2 200 can select and call the test case stored in the electronic device 1 100 in some scenarios, and, in addition to the electronic device 1 100 and the electronic device 2 200, there can be more electronic devices, and the specific number is not limited in the present application. Among them, the electronic device can be a portable device (for example: a mobile phone, a tablet computer, a smart watch, etc.), or a computer, a smart screen or a personal computer, etc.
[0057] The following describes the two-dimensional code recognition method provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this regard.
[0058] Figure 2 A flow chart of a test case selection method provided by an embodiment of the present application is shown. Figure 2 As shown, a test case selection method provided in an embodiment of the present application may include the following steps:
[0059] Step S201, in response to parameter information input by a user, obtaining multiple target parameter values contained in the parameter information.
[0060] In a possible embodiment, before the user selects a test case, the test case that needs to be saved and that is input by the user may be saved first.
[0061] First, different tree data structures can be established according to different needs. Figure 3 A schematic diagram of a tree data structure provided by an embodiment of the present application is shown. Figure 3As shown, the established tree data structure includes three levels, namely the first level, the second level and the third level, each level corresponds to the parameters of the test case one by one, and each node at the same level represents different values of the same parameter. Among them, in the first level, the basic information of the test case is included, which may include the ID, title, label, path, test target and other necessary data attributes of the test case. For example, there is a test case with an ID of 9527, a title of a test for a graphic fuzzy model, and a label that may include keywords in the title, such as a graphic fuzzy model, a test, and a test target that may be a graphic fuzzy model. Usually, although the versions of the test case are different, the ID, title, label, path, test target and other necessary data attributes corresponding to the test case are usually the same, so the above content can be used as the root node of the tree data structure, i.e., a node without a parent node. The second level corresponds to the operating system parameters of the test case. The tree of the operating system of the test software in the test case attributes is extracted separately. As a level, different test environments will lead to significantly different attributes of the test case. Different branch nodes can represent different operating systems, including OS1 on the left branch node and OS2 on the right branch node. Both branch nodes are child nodes of the root node. The third level corresponds to different conditions met by the test case. Different branch nodes correspond to different conditions. When OS1 is the parent node, it contains child nodes that meet condition 1 and child nodes that meet condition 2; when OS2 is the parent node, it contains child nodes that meet condition 1. Each node in the third level does not contain child nodes. Therefore, each node in the third level is a leaf node.
[0062] It should be noted that Figure 3 The tree data structure shown is only one of multiple tree data structures. The second level may correspond to the test case operating system, or may correspond to other parameters in the test case. For example, if the difference in the test case operating system is not sufficient to cause significant differences in test sending and receiving, preparation work, test steps, etc., the operating system may not be extracted. Similarly, the third level may also correspond to other parameters in the test case, and may not be limited to three levels. There may be fewer levels or more levels for storing test cases. This application does not limit this. In addition, each leaf node corresponds to three storage spaces, and the functions of the three storage spaces will be explained below.
[0063] Secondly, after establishing different tree data structures, the test cases that need to be saved can be saved. Figure 4 A flowchart of saving a test case provided by an embodiment of the present application is shown. Figure 4 As shown, the process includes the following steps:
[0064] Step S2011, obtaining the test case to be saved.
[0065] In a possible embodiment, the test cases that need to be saved can be saved in a separate folder first, and the electronic device can obtain the test cases that need to be saved by reading this separate folder, or the electronic device can directly receive the test cases input by the user, thereby obtaining the test cases that need to be saved.
[0066] Step S2012, determining multiple parameter values included in the test case to be saved, and determining the nodes of the tree data structure in order of hierarchy according to the multiple parameter values until a leaf node is determined.
[0067] For example, if the parameters in the test case to be saved are determined to satisfy condition 1 under OS1 operating system, Figure 3 In the tree data structure shown, it can be determined that the nodes in the second level should be the nodes corresponding to OS1, and the nodes in the third level should be the nodes corresponding to OS1 that meet condition 1. The nodes in the third level are leaf nodes.
[0068] Step S2013, based on the coding information corresponding to each step in the test case to be saved, a storage operation is performed in the first storage space corresponding to the determined leaf node.
[0069] In a possible embodiment, if the test case to be saved contains three steps, namely step 1, step 2, and step 3, then the step information contained therein can be extracted for any one of the steps, and the step information contains a valid string of any one of the steps. For example, step 1 may contain a lot of invalid information, and the invalid information may come from invisible tags, invalid tags, useless spaces, carriage returns and other characters in HTML. Therefore, the invalid information can be eliminated to obtain the step information in step 1.
[0070] After obtaining the step information of any step, the step information can be encoded using the MD5 algorithm to obtain the encoding information corresponding to any step. For example, if the step information of step 1 is AAA, defb99e69a9f1f6e06f15006b1f166ae can be obtained after encoding using MD5. Compared with directly saving test cases, encoding valid strings using the MD5 algorithm can reduce the pressure on memory usage.
[0071] In a possible embodiment, if the coding information corresponding to any step is different from the saved coding information, the coding information corresponding to any step is stored in the first storage space corresponding to the determined leaf node, and a unique coding identifier is assigned to the coding information corresponding to any step, and a corresponding relationship between the coding information corresponding to any step and the coding identifier is established. For example, the saved coding information includes the coding information corresponding to step 1 with step information AAA in test case 1 and the coding information corresponding to step 2 with step information BBB. If it is necessary to save the coding information corresponding to step 1 with step information CCC in test case 2, it can be determined that the coding information with step information CCC has not been saved, then the coding information corresponding to step 1 of test case 2 can be stored in the first storage space corresponding to the determined leaf node, and a coding identifier C is assigned to the coding information with step information CCC. The coding identifier C corresponds to the coding information with step information CCC, and can be used to indicate the coding information with step information CCC.
[0072] In another possible embodiment, two different test cases may include the same steps. For any step in the test case to be saved, if the coding information corresponding to any step is the same as the saved coding information, the coding identifier corresponding to the coding information of any step is determined based on the correspondence between the coding information and the coding identifier, and the determined coding identifier is stored in the first storage space corresponding to the determined leaf node. For example, the saved coding information includes the coding information corresponding to step 1 with step information AAA in test case 1 and the coding information corresponding to step 2 with step information BBB. If the coding information corresponding to step 1 with step information BBB in test case 2 needs to be saved, it can be determined that the coding information with step information BBB has been saved, and then the coding information corresponding to step 1 with step information BBB in test case 2 can be determined based on the coding information corresponding to step 2 with step information BBB in test case 1, that is, the coding information corresponding to the two steps is the same. Therefore, the coding identifier corresponding to the coding information of step 2 with step information BBB in test case 1 can be stored in the first storage space corresponding to the determined leaf node. If test case 2 needs to be selected in subsequent steps, when step 1 of test case 2 is extracted, the corresponding coding information can be determined by reading the coding identifier. By comparing the coding information corresponding to any step with the saved coding information, different coding information can be saved. For the same coding information, only one coding information is saved, and the coding identifier corresponding to the coding information is saved in other steps, which can greatly reduce space occupancy.
[0073] In a possible embodiment, if the test case stored in the first storage space corresponding to any leaf node needs to be updated, the original test case and the corresponding test result can be saved in the second storage space corresponding to any leaf node. For example, the test case stored in the first storage space corresponding to leaf node 1 is test case 3. As the test progresses, test case 4 needs to be saved in the first storage space corresponding to leaf node 1. Then, test case 3 can be saved in the second storage space corresponding to leaf node 1, and test case 4 can be saved in the first storage space corresponding to leaf node 1. It should be noted that the second storage space is invisible to the user, and the user cannot directly call the test case stored in the second storage space, which also reduces the time spent on selecting test cases and improves efficiency.
[0074] If the user needs to view historical test cases, the system can respond to the user's viewing operation, determine the difference steps between the updated test cases stored in the first storage space corresponding to any leaf node and the original test cases stored in the second storage space corresponding to any leaf node, and notify the user of the difference steps. For example, if the user needs to view the difference steps between test case 5 stored in the first storage space corresponding to leaf node 2 and test case 6 stored in the second storage space, the system can send a viewing operation to the electronic device corresponding to the test case selection method provided in the embodiment of the present application. In response to the viewing operation sent by the user, the electronic device can determine the difference steps between test case 5 and test case 6 by comparison, and display the difference steps between test case 5 and test case 6 in a pop-up window.
[0075] In a possible embodiment, after the test cases are stored, the test cases need to be selected, and step S201 can be executed to obtain multiple target parameter values contained in the parameter information in response to the parameter information input by the user. That is, the target node corresponding to each level in the tree data structure is determined by the user's input.
[0076] Step S202: determining a plurality of target nodes of the tree data structure according to a plurality of target parameter values.
[0077] In a possible embodiment, after obtaining multiple target parameter values included in the parameter information, multiple target nodes of the tree data structure can be determined according to the multiple target parameter values. For example, Figure 3 In the tree data structure shown, the user needs to select a test case that meets condition 1 under the operating system OS2. Then, it can be determined that in the second level, the selected target node is the second node from the left to the right, and in the third level, the selected target node is the third node from the left to the right. It should be noted that each target node is located at a different level.
[0078] Step S203: Use the test case stored in the first storage space corresponding to the first target node as the target test case.
[0079] In a possible embodiment, the first target node is a leaf node among multiple target nodes, that is, a target node without any child nodes, that is, the target node in the third level of the example in step S202. It can be determined that the test case stored in the first storage space corresponding to the first target node is the target test case required by the user.
[0080] In a possible embodiment, a test environment is stored in a third storage space corresponding to the first target node, wherein the test environment is configured according to environmental parameters in parameter values corresponding to multiple parent nodes of the first target node. For example, the parent node of the first target node includes an operating system value of OS1 and a test software version of 2.0. Then, a test environment in which the operating system is not OS1 and the test software version is 2.0 can be configured according to the above content.
[0081] In a possible embodiment, after the test environment is set up, the test can be carried out. If an error occurs during the test, the user can be prompted with error information and corresponding modification suggestions through pop-up windows, etc. If the user receives a modification to the target test case based on the error information, or a modification to the test environment or the test object, the target test case to be modified can be used to retest, and the result of the retest can be updated. It should be noted that if no error occurs during the test, the test results can also be saved in the same first storage space as the test case. Similarly, until the test case is updated, the original test case and the test results corresponding to the original test case can also be stored in the same second storage space.
[0082] In a possible embodiment, relevant parameters of the testing process can also be monitored. For example, the duration of the test can be monitored. Different versions of test cases may have many identical steps. The test duration can be monitored to determine which specific step consumes more time, thereby providing an early warning of problems that may arise in the production process.
[0083] The embodiments of the present application provide a test case selection method, device and electronic device. Through the test case selection method provided by the embodiments of the present application, it is possible to respond to parameter information input by a user, obtain multiple target parameter values contained in the parameter information, and determine multiple target nodes of a tree data structure based on the multiple target parameter values, wherein the tree data structure has been constructed before the user selects a test case, and the tree data structure contains multiple nodes. There is a parent-child relationship between any two adjacent nodes in the multiple nodes. The level at which each node is located corresponds to the parameter one-to-one, and each node at the same level represents a different value of the same parameter. Any two target nodes are at different levels, and the test case stored in the first storage space of the first target node is used as the target test case for testing. By using the tree data structure to select the test case, compared with selecting the test case stored in a single branch or multiple branches, the time for selecting the test case can be reduced and the efficiency of the test can be improved.
[0084] In a specific implementation, the process of a test case selection method provided in an embodiment of the present application can be as follows: Figure 5 As shown, the following steps are included:
[0085] Step S501, establishing different tree data structures according to different needs.
[0086] Step S502, obtaining the test case to be saved.
[0087] Step S503, determining multiple parameter values included in the test case to be saved, and determining the nodes of the tree data structure in order of hierarchy according to the multiple parameter values until a leaf node is determined.
[0088] Step S504: Encode each step in the test case to be saved using the MD5 algorithm to obtain corresponding encoding information.
[0089] Step S505, based on the coding information corresponding to each step in the test case to be saved, a storage operation is performed in the first storage space corresponding to the determined leaf node.
[0090] In a possible embodiment, for any step in the test case that needs to be saved, if the coding information corresponding to any step is different from the saved coding information, the coding information corresponding to any step is stored in the first storage space corresponding to the determined leaf node, and a unique coding identifier is assigned to the coding information corresponding to any step, and a corresponding relationship between the coding information corresponding to any step and the coding identifier is established.
[0091] In another possible embodiment, for any step in the test case that needs to be saved, if the coding information corresponding to any step is the same as the saved coding information, the coding identifier corresponding to the coding information of any step is determined based on the correspondence between the coding information and the coding identifier, and the determined coding identifier is stored in the first storage space corresponding to the determined leaf node.
[0092] Step S506, in response to the parameter information input by the user, obtaining multiple target parameter values included in the parameter information.
[0093] Step S507: determining a plurality of target nodes of the tree data structure according to a plurality of target parameter values.
[0094] Step S508: Use the test case stored in the first storage space corresponding to the first target node as the target test case.
[0095] Step S509: perform testing according to the steps of the target test case in the test environment stored in the third storage space corresponding to the first target node, and record the test results.
[0096] Step S510: If an error occurs during the test, the user is notified of the error information and corresponding modification suggestions.
[0097] Step S511, in response to the user's modification of the target test case based on the error information, retesting is performed using the modified target test case, and the retesting result is updated.
[0098] Based on the same inventive concept, the present application embodiment provides a test case selection device, please refer to Figure 6 , the test case selection device 600 comprises:
[0099] The target parameter value acquisition unit 601 is used to respond to the parameter information input by the user and acquire multiple target parameter values included in the parameter information;
[0100] A target node determination unit 602 is used to determine multiple target nodes of a tree data structure according to the multiple target parameter values; wherein the tree data structure includes multiple nodes; the level at which each node is located corresponds to a parameter one by one, and each node at the same level represents a different value of the same parameter; any two of the target nodes are located at different levels;
[0101] The test execution unit 603 is used to use the test case stored in the first storage space corresponding to the first target node as the target test case; the first target node is a leaf node, and the leaf node has no child nodes; the parameter values corresponding to any leaf node and the parameter values corresponding to multiple parent nodes of the any leaf node are the parameter values contained in the test case stored in the first storage space corresponding to the any leaf node.
[0102] In a possible implementation, the target parameter value acquisition unit 601 may also be used to save the original test case and the test result corresponding to the original test case to the second storage space corresponding to any leaf node if the test case stored in the first storage space corresponding to any leaf node is updated;
[0103] In response to the user's viewing operation, the differentiation steps between the updated test case stored in the first storage space corresponding to any leaf node and the original test case stored in the second storage space corresponding to any leaf node are determined, and the user is notified of the differentiation steps.
[0104] In a possible implementation manner, the target parameter value acquisition unit 601 may also be used to acquire the test case to be saved;
[0105] Determine multiple parameter values included in the test case to be saved, and determine the nodes of the tree data structure in order of hierarchy according to the multiple parameter values until a leaf node is determined;
[0106] Based on the encoding information corresponding to each step in the test case that needs to be saved, a storage operation is performed in the first storage space corresponding to the determined leaf node.
[0107] In a possible implementation, the target parameter value acquisition unit 601 may also be used to determine the coding identifier corresponding to the coding information of any one step in the test case that needs to be saved, based on the correspondence between the coding information and the coding identifier, if the coding information corresponding to the any one step is the same as the saved coding information, and store the determined coding identifier in the first storage space corresponding to the determined leaf node;
[0108] If the coding information corresponding to any one of the steps is different from the saved coding information, the coding information corresponding to any one of the steps is stored in the first storage space corresponding to the determined leaf node, and a unique coding identifier is assigned to the coding information corresponding to any one of the steps, and a corresponding relationship between the coding information corresponding to any one of the steps and the coding identifier is established.
[0109] In a possible implementation manner, the target parameter value obtaining unit 601 may also be used to determine the encoding information corresponding to each step in the following manner:
[0110] For any step in the test case to be saved, extract the step information of the any step; the step information includes a valid character string of the any step;
[0111] The step information is encoded using the MD5 algorithm to obtain the encoding information corresponding to any one of the steps.
[0112] In a possible implementation, the test conducting unit 603 can also be used to perform testing according to the steps of the target test case in the test environment stored in the third storage space corresponding to the first target node, and record the test results; the test environment is configured according to the environmental parameters in the parameter values corresponding to multiple parent nodes of the first target node.
[0113] In a possible implementation, the test performing unit 603 may also be used to notify the user of error information and corresponding modification suggestions if an error occurs during the test;
[0114] In response to the user's modification of the target test case based on the error information, retesting is performed using the modified target test case, and the result obtained from the retesting is updated.
[0115] Based on the same inventive concept, the embodiment of the present application provides an electronic device, which can realize the function of the test case selection device discussed above, please refer to Figure 7 The electronic device 700 includes a memory 701, a processor 702 and a bus 703.
[0116] The memory 701 is used to store computer programs executed by the processor 702. The memory 701 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0117] The memory 701 may be a volatile memory, such as a random-access memory (RAM); the memory 701 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 701 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 701 may be a combination of the above memories.
[0118] The processor 702 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 702 is used to implement the test case selection method in the above embodiment when calling the computer program stored in the memory 701 .
[0119] The specific connection medium between the memory 701 and the processor 702 is not limited in the embodiment of the present application. Figure 7 In the embodiment, the memory 701 and the processor 702 are connected via a bus 703. The bus 703 is connected to the processor 702 via a bus 703. Figure 7 The connections between other components are shown in bold lines, which are only for illustration and are not intended to be limiting. Bus 703 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0120] Based on the same inventive concept, the embodiment of the present application provides a computer-readable storage medium, and the computer program product includes: computer program code, when the computer program code is run on a computer, the computer executes any of the test case selection methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the test case selection method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0125] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A test case selection method, characterized in that: include: In response to parameter information input by a user, obtaining multiple target parameter values included in the parameter information; Determine a plurality of target nodes of the tree data structure according to the plurality of target parameter values; The tree data structure includes a plurality of nodes; the level at which each node is located corresponds to a parameter one by one, and each node at the same level represents a different value of the same parameter; any two target nodes are located at different levels; Using the test case stored in the first storage space corresponding to the first target node as the target test case; The first target node is a leaf node, and the leaf node has no child nodes; The parameter values corresponding to any leaf node and the parameter values corresponding to multiple parent nodes of the any leaf node are the parameter values contained in the test case stored in the first storage space corresponding to the any leaf node.
2. The method according to claim 1, characterized in that Before responding to the parameter information input by the user, the method further includes: If the test case stored in the first storage space corresponding to any leaf node is updated, the original test case and the test result corresponding to the original test case are stored in the second storage space corresponding to any leaf node; In response to the user's viewing operation, the differentiation steps between the updated test case stored in the first storage space corresponding to any leaf node and the original test case stored in the second storage space corresponding to any leaf node are determined, and the user is notified of the differentiation steps.
3. The method according to claim 1, characterized in that The method further comprises: Get the test cases that need to be saved; Determine multiple parameter values included in the test case to be saved, and determine the nodes of the tree data structure in order of hierarchy according to the multiple parameter values until a leaf node is determined; Based on the encoding information corresponding to each step in the test case that needs to be saved, a storage operation is performed in the first storage space corresponding to the determined leaf node.
4. The method according to claim 3, characterized in that The step of performing a storage operation in a first storage space corresponding to a determined leaf node based on the encoding information corresponding to each step in the test case to be saved includes: For any step in the test case that needs to be saved, if the coding information corresponding to any step is the same as the saved coding information, then based on the correspondence between the coding information and the coding identifier, determine the coding identifier corresponding to the coding information of any step, and store the determined coding identifier in the first storage space corresponding to the determined leaf node; If the coding information corresponding to any one of the steps is different from the saved coding information, the coding information corresponding to any one of the steps is stored in the first storage space corresponding to the determined leaf node, and a unique coding identifier is assigned to the coding information corresponding to any one of the steps, and a corresponding relationship between the coding information corresponding to any one of the steps and the coding identifier is established.
5. The method according to claim 3, characterized in that: The encoding information corresponding to each step is determined by: For any step in the test case to be saved, extract the step information of the any step; the step information includes a valid character string of the any step; The step information is encoded using the MD5 algorithm to obtain the encoding information corresponding to any one of the steps.
6. The method according to claim 1, characterized in that After taking the test case stored in the first storage space corresponding to the first target node as the target test case, the method further includes: The test is performed according to the steps of the target test case in the test environment stored in the third storage space corresponding to the first target node, and the test results are recorded; the test environment is configured according to the environmental parameters in the parameter values corresponding to multiple parent nodes of the first target node.
7. The method according to claim 6, characterized in that After recording the test results, the method further includes: If an error occurs during the test, the user will be notified of the error message and corresponding modification suggestions; In response to the user's modification of the target test case based on the error information, retesting is performed using the modified target test case, and the result obtained from the retesting is updated.
8. A test case selection device, characterized in that: include: A target parameter value acquisition unit, configured to respond to parameter information input by a user and acquire a plurality of target parameter values included in the parameter information; a target node determination unit, configured to determine a plurality of target nodes of the tree data structure according to the plurality of target parameter values; The tree data structure includes a plurality of nodes; the level at which each node is located corresponds to a parameter one by one, and each node at the same level represents a different value of the same parameter; any two target nodes are located at different levels; A test execution unit, configured to use the test case stored in the first storage space corresponding to the first target node as a target test case; The first target node is a leaf node, and the leaf node has no child nodes; The parameter values corresponding to any leaf node and the parameter values corresponding to multiple parent nodes of the any leaf node are the parameter values contained in the test case stored in the first storage space corresponding to the any leaf node.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1 to 7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 7.