Test case processing method and device, electronic equipment and readable storage medium

By acquiring and adjusting the node relationships of the test case tree when importing test case data into the test case management system, the problem of inaccurate test case tree updates in the prior art is solved, and the effective adjustment of the relationships between nodes and the accurate expression of data relationships are realized.

CN114706791BActive Publication Date: 2026-02-24BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210520143.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2026-02-24
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

In existing technologies, how to effectively update the test case tree when importing test case data into a test case management system, especially how to adjust the relationships between nodes to accurately express the relationships between test case data, is an important issue.

Method used

By obtaining the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data, each node in the first test case tree is imported into the second test case tree, and the relationship between nodes is adjusted according to the matching nodes and the update rules of adjacent nodes, including creating new nodes and updating node attributes.

Benefits of technology

It enables effective updating of the test case tree, ensuring that the updated test case tree accurately expresses the relationships between test case data, avoids conflicts between nodes, and meets the usage requirements for importing test case data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114706791B_ABST
    Figure CN114706791B_ABST
Patent Text Reader

Abstract

The present disclosure provides a test case processing method and device, electronic equipment and readable storage medium, relates to the field of computers, and particularly to the field of test technology. The specific implementation scheme is: obtaining a first test case tree corresponding to to-be-imported test case data and a second test case tree corresponding to stored test case data; and respectively importing each first node in the first test case tree into the second test case tree. In the present scheme, the nodes in the first test case tree constructed by the to-be-imported test case data are respectively imported into the second test case tree, effective updating of the second test case tree is realized, and the use requirement when importing the test case data can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to the field of testing technology. Specifically, this disclosure relates to a test case processing method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] To test the quality of internet products, test cases are typically used to perform functional testing. Currently, test cases are generally managed through a test case management system. To facilitate test case management, a test case tree is usually constructed within the system.

[0003] In existing technologies, there may be a need to import test case data into a test case management system. How to effectively update the test case tree when importing test case data into the test case management system has become an important technical problem. Summary of the Invention

[0004] To address at least one of the aforementioned deficiencies, this disclosure provides a test case processing method, apparatus, electronic device, and readable storage medium.

[0005] According to a first aspect of this disclosure, a test case processing method is provided, the method comprising:

[0006] Get the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data;

[0007] Import each first node in the first test case tree into the second test case tree.

[0008] According to a second aspect of this disclosure, a test case processing apparatus is provided, the apparatus comprising:

[0009] The test case tree acquisition module is used to acquire the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data.

[0010] The node import module is used to import each first node in the first test case tree into the second test case tree.

[0011] According to a third aspect of this disclosure, an electronic device is provided, the electronic device comprising:

[0012] At least one processor; and

[0013] A memory communicatively connected to at least one of the aforementioned processors; wherein,

[0014] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to perform the test case processing method.

[0015] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to execute the above-described test case processing method.

[0016] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described test case processing method.

[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0018] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0019] Figure 1 This is a flowchart illustrating a test case processing method provided in an embodiment of this disclosure;

[0020] Figure 2 This is a schematic diagram of the process of importing the first node into the second test case tree to obtain the updated second test case tree, provided by an embodiment of this disclosure;

[0021] Figure 3 This is a schematic diagram of the process of importing the first node into the second test case tree to obtain the updated second test case tree, provided by an embodiment of this disclosure;

[0022] Figure 4 This is a schematic diagram of the process of importing the first node into the second test case tree to obtain the updated second test case tree, provided by an embodiment of this disclosure;

[0023] Figure 5 This is a schematic diagram of the structure of the rule pool provided in an embodiment of this disclosure;

[0024] Figure 6 This is a schematic diagram of the structure of each rule provided in the embodiments of this disclosure;

[0025] Figure 7 This is a flowchart illustrating another test case processing method provided in this embodiment of the disclosure;

[0026] Figure 8 This is a schematic diagram of the structure of a test case processing device provided in an embodiment of this disclosure;

[0027] Figure 9 This is a schematic diagram of another test case processing device provided in an embodiment of this disclosure;

[0028] Figure 10 This is a block diagram of an electronic device used to implement the test case processing method of the embodiments of this disclosure. Detailed Implementation

[0029] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0030] A test case tree is a tree-like structure built by parsing test case data, used for managing test cases. Test case data typically includes test case groups and test cases. Test case groups are represented by test case group nodes in the test case tree, and test cases are represented by test case nodes.

[0031] Test case management systems provide users with functions such as test case management and test case viewing. Test case management systems typically construct test case trees based on existing test case data.

[0032] When importing test case data into a test case management system, how to effectively update the test case tree based on the imported test case data has become an important technical issue.

[0033] When updating the test case tree based on the test case data to be imported, the relationships between nodes in the test case tree may also need to be adjusted to ensure that the test case tree accurately represents the relationships between the test case data. Therefore, how to adjust the relationships between nodes in the test case tree to maintain the relationships between the test case data is an important technical issue when updating the test case tree.

[0034] The test case processing method, apparatus, electronic device, and readable storage medium provided in this disclosure are intended to solve at least one of the above-mentioned technical problems in the prior art.

[0035] Figure 1 A flowchart illustrating a test case processing method provided in an embodiment of this disclosure is shown, as follows: Figure 1 As shown, the method can mainly include:

[0036] Step S110: Obtain the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data;

[0037] Step S120: Import each first node in the first test case tree into the second test case tree.

[0038] The existing test case data can be test case data that has already been stored in the test case management system. The second test case tree is constructed by parsing the existing test case data.

[0039] The test case data to be imported is the test case data in the test case management system. When importing the test case data into the test case management system, the second test case tree can be updated according to the test case data to ensure that the second test case tree can represent the relationship between the test case data in the test case management system.

[0040] The first test case tree is constructed by parsing the test case data to be imported. This first test case tree can be built by parsing the test case data to be imported into the test case management system.

[0041] In this embodiment of the disclosure, each node in the first test case tree can be designated as a first node. By importing each first node into the second test case tree, the second test case tree contains the nodes corresponding to the first nodes, thus updating the second test case tree. The updated second test case tree can represent the relationships between the test case data in the test case management system after the test case data to be imported is imported into the test case management system.

[0042] The method provided in this disclosure acquires a first test case tree corresponding to the test case data to be imported and a second test case tree corresponding to the existing test case data, and then imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0043] In one optional embodiment of this disclosure, each first node in the first test case tree is imported into the second test case tree, including:

[0044] Based on whether each first node in the first test case tree has a matching second node in the second test case tree, the first node is imported into the second test case tree.

[0045] In this embodiment of the disclosure, there may be some identical test case data between the test case data to be imported and the existing test case data, resulting in matching nodes in the first test case tree and the second test case tree. The matching first node and the second node correspond to the same test case data.

[0046] Adjacent nodes can be the parent and / or child nodes of a node. Relationships between nodes can include inheritance relationships between child nodes and their parent nodes.

[0047] When a second node exists in the second test case tree that matches the first node, the adjacent nodes of the first node in the first test case tree are usually different from the adjacent nodes of the second node in the second test case tree. If the first test case tree is directly inserted as a subtree into the second test case tree without adjusting the adjacent nodes of the second node in the updated second test case tree, conflicts may occur in the relationships between some nodes, making it impossible to accurately represent the relationships between test case data. Therefore, when a second node exists in the second test case tree that matches the first node, the adjacent nodes of these second nodes need to be adjusted to adjust the relationships between nodes.

[0048] In this embodiment of the disclosure, during the process of importing each first node in the first test case tree into the second test case tree, it can be determined whether each first node has a matching second node in the second test case tree, and the corresponding processing method can be determined according to whether the first node has a matching second node in the second test case tree, so as to adjust the relationship between nodes in the updated second test case tree.

[0049] In one optional embodiment of this disclosure, importing a first node into a second test case tree based on whether a matching second node exists in the second test case tree for each first node in the first test case tree includes:

[0050] When a first node in the first test case tree has a matching second node in the second test case tree, the adjacent nodes of the second node are processed based on the adjacent node update rule corresponding to the second node.

[0051] In this embodiment of the disclosure, when a first node has a matching second node in the second test case tree, it can be assumed that the test case data corresponding to the first node already exists in the existing test case data, and there is no need to add a new node. At this time, the adjacent nodes of the second node can be processed according to the adjacent node update rule corresponding to the second node, so as to adjust the relationship between nodes in the updated second test case tree.

[0052] In this embodiment of the disclosure, neighbor node update rules can be pre-configured for the second node based on information such as the node type and attributes of the second node, so as to control the adjustment of the neighbor nodes of the second node.

[0053] The solution provided in this embodiment of the present disclosure, by processing the adjacent nodes of the second node based on the adjacent node update rule corresponding to the second node when the first node in the first test case tree has a matching second node in the second test case tree, effectively adjusts the relationship between nodes in the second test case tree, and can ensure that the updated second test case tree can accurately express the relationship between test case data.

[0054] In one optional embodiment of this disclosure, when the update rule for the adjacent nodes corresponding to the second node allows updates to the adjacent nodes of the second node, the adjacent nodes of the second node are processed, including:

[0055] The first pre-specified node is determined as the adjacent node of the second node, or the adjacent nodes of the second node are determined based on the adjacent nodes of the first node.

[0056] In this embodiment of the disclosure, the neighbor node update rule may include allowing updates to the neighbor nodes of the second node, or disallowing updates to the neighbor nodes of the second node.

[0057] When the neighbor node update rule does not allow updating the neighbor nodes of the second node, the neighbor nodes of the second node do not need to be adjusted. This is equivalent to ignoring the neighbor nodes of the first node in the first test case tree when importing the first node into the second test case tree, and still using the original neighbor nodes in the second test case tree, thereby avoiding the situation where there are conflicts in the relationships between nodes in the updated second test case tree.

[0058] When the adjacency update rule allows updating the adjacency nodes of the second node, the first pre-specified node can be used as the adjacency node of the second node. For example, if the first pre-specified node specifies the parent node of the second node, then the first pre-specified node can be used as the parent node of the second node. In this embodiment, the adjacency nodes of the second node can also be adjusted based on the adjacency nodes of the first node. Specifically, the matching node of the adjacency node of the first node in the second test case tree can be used as the adjacency node of the second node. For example, the parent node of the first node in the first test case tree is determined, and the node in the second test case tree that matches the parent node is used as the parent node of the second node.

[0059] In practical use, the first pre-designated node can be set by the tester according to actual needs.

[0060] As an example, starting from the root node of the first test case tree, a depth-recursive approach can be used to traverse the input first test case tree, importing each first node into the second test case tree. In this example, starting from the root node of the first test case tree, the first nodes of each level are imported into the second test case tree sequentially. When updating the relationships between nodes in the second tree, the parent nodes of each second node can be updated sequentially, ultimately completing the update of all relationships between nodes in the second test case tree.

[0061] In one alternative embodiment of this disclosure, the method further includes:

[0062] The node attributes of the second node are processed based on the node attribute update rules corresponding to the second node.

[0063] In this embodiment of the disclosure, node attributes may include the type of test case (such as an automated test case or a manual test case) and the file type of the test case, etc.

[0064] When there is a second node in the second test case tree that matches the first node, the node attributes of the first node may be different from those of the matching second node. In this case, you can configure the node attribute update rules to determine whether to update the node attributes of the second node.

[0065] In this embodiment of the disclosure, node attribute update rules can be pre-configured for the second node based on information such as the node type and attributes of the second node, so as to control the node attribute update of the second node.

[0066] When a matching second node exists in the second test case tree for the first node in the first test case tree, the node attributes of the second node can be processed based on the node attribute update rules.

[0067] Specifically, node attribute update rules can include any of the following:

[0068] Update all node attributes of the second node;

[0069] Update the specified node properties of the second node;

[0070] Do not update the node properties of the second node.

[0071] Specifically, if the node attribute update rule is to update all node attributes of the second node, then all node attributes of the second node can be updated based on all node attributes of the first node. If the node attribute update rule is to update a specified node attribute of the second node, then the specified node attribute of the second node can be updated based on the specified node attribute of the first node. The specified node attribute can be set by the tester as needed. If the node attribute update rule is not to update the node attributes of the second node, then the node attributes of the second node will not be updated.

[0072] In practical use, node attribute update rules can be pre-configured or submitted by testers based on actual testing needs. Different priorities can be set for each node attribute update rule so that when a conflict arises between a tester-submitted node attribute update rule and a pre-configured node attribute update rule, the final node attribute update rule is determined based on priority.

[0073] As an example, updating all node attributes of the second node has higher priority than updating a specific node attribute of the second node. If the tester submits a node attribute update rule that updates a specific node attribute of the second node, while the default node attribute update rule updates all node attributes of the second node, then based on the priority, the final node attribute update rule can be determined to be updating all node attributes of the second node.

[0074] In one optional embodiment of this disclosure, importing a first node into a second test case tree based on whether a matching second node exists in the second test case tree for each first node in the first test case tree includes:

[0075] When a first node in the first test case tree does not have a matching second node in the second test case tree, a second node matching the first node is created in the second test case tree, and the adjacent nodes of the second node are determined.

[0076] In this embodiment of the disclosure, when there is no matching second node for the first node in the second test case tree, a second node matching the first node can be created in the second test case tree. This second node is a newly added node in the second test case tree. At the same time, it is necessary to determine the adjacent nodes of the second node, so as to import the first node into the second test case tree.

[0077] In one optional embodiment of this disclosure, determining the adjacent nodes of the second node includes:

[0078] The second pre-specified node is determined as the adjacent node of the second node, or the adjacent node of the second node is determined based on the adjacent nodes of the first node.

[0079] In this embodiment of the disclosure, when there is no matching second node for the first node in the second test case tree, it is necessary to add a matching second node to the second test case tree and determine the adjacent nodes of the second node. Specifically, a pre-specified second node can be used as the adjacent node of the second node.

[0080] For example, if the second pre-specified node specifies the parent node of the second node, then the first pre-specified node can be used as the parent node of the second node. In this embodiment, the adjacent nodes of the second node can also be adjusted based on the adjacent nodes of the first node. Specifically, the matching nodes of the adjacent nodes of the first node in the second test case tree can be used as the adjacent nodes of the second node. For example, determining the parent node of the first node in the first test case tree...

[0081] In practical use, the second pre-specified node can be configured by the tester according to actual needs.

[0082] In one optional embodiment of this disclosure, where the node identifiers of each first node in the first test case tree and the node identifiers of each second node in the second test case tree are both determined based on preset naming rules, the above method further includes:

[0083] Based on the node identifier of the first node and the node identifiers of each second node in the second test case tree, search in the second test case tree for a second node that matches the first node.

[0084] In this embodiment, the node identifiers of each node in both the first and second test case trees can be determined based on pre-configured naming rules. This ensures that nodes corresponding to the same test case data in the existing test case data have the same node identifier, and first and second nodes with the same node identifier match each other. In practical use, a search can be performed in the second test case tree based on the node identifier of the first node to determine whether a second node with the same node identifier exists, thereby determining whether a second node matching the first node exists in the second test case tree.

[0085] Figure 2 The diagram illustrates a process for importing a first node into a second test case tree to obtain an updated second test case tree, as provided in an embodiment of this disclosure.

[0086] like Figure 2As shown, the first test case tree includes the first nodes S4, S5, C3, C4, and C5, where S4 and S5 are test case grouping nodes, and C3, C4, and C5 are test case nodes. The second test case tree includes the second nodes S1, S2, S3, C1, C2, C3, and C4, where S1, S2, and S3 are test case grouping nodes, and C1, C2, C3, and C4 are test case nodes. The updated second test case tree includes the second nodes S1, S2, S3, S4, S5, C1, C2, C3, C4, and C5, where S1, S2, S3, S4, and S5 are test case grouping nodes, and C1, C2, C3, C4, and C5 are test case nodes.

[0087] Each first node is imported into the second test case tree to obtain the updated second test case tree. The specific process is as follows:

[0088] Import the first node S4 into the second test case tree. Since there is no matching second node for the first node S4 in the second test case tree, a new second node S4 is created. The pre-defined relationship between the nodes of the second node S4 is that the parent node of the second node S4 is the second node S2. Therefore, the second node S4 is imported into the second test case tree as a child node of the second node S2.

[0089] Import the first node S5 into the second test case tree. Since there is no matching second node for the first node S5 in the second test case tree, a new second node S5 is added. The relationships between nodes of the second node S5 are updated based on the relationships between the first node S5, with the parent node of the first node S5 becoming the first node S4, and the second node S5 imported into the second test case tree as a child node of the second node S4.

[0090] Import the first node C3 into the second test case tree. A matching second node C3 exists within the second test case tree. The neighbor node update rule for the second node C3 allows updating the relationships between nodes corresponding to the second node C3. Therefore, the relationships between nodes of the second node C3 can be updated based on the relationships between nodes of the first node C3. The parent node of the first node C3 is the first node S4, and the second node C3 is imported into the second test case tree as a child node of the second node S4. The node attribute update rule for the second node C3 is to update all node attributes of the second node C3. All node attributes of the second node C3 can be updated based on all node attributes of the first node C3.

[0091] Import the first node C4 into the second test case tree. A matching second node C4 exists in the second test case tree. The update rule for the adjacent nodes of the second node C4 is that updates to the relationships between nodes corresponding to the second node C4 are not allowed; therefore, the relationships between nodes of the second node C4 do not need to be updated. The update rule for the node attributes of the second node C4 is that node attributes are not updated; therefore, the node attributes of the second node C4 do not need to be updated.

[0092] Import the first node C5 into the second test case tree. Since there is no matching second node for the first node C5 in the second test case tree, a new second node C5 is created. The node relationships of the second node C5 are updated based on the relationships between the first node C5, with the parent node of the first node C5 becoming the first node S5, and the second node C5 imported into the second test case tree as a child node of the second node S5.

[0093] Figure 3 The diagram illustrates a process for importing a first node into a second test case tree to obtain an updated second test case tree, as provided in an embodiment of this disclosure.

[0094] like Figure 3 As shown, the subtree is traversed, and the tree nodes are traversed, that is, the first node in the first test case tree is traversed.

[0095] Node type identification involves determining the node type of the first node. Node types can include test case group nodes and test case nodes, and the node type can correspond to a rule. In this example, the rules can include, but are not limited to, adjacent node update rules and node attribute update rules.

[0096] Rule processing includes: obtaining the rule pool corresponding to the node; taking the intersection of the input rule set and the rule pool; sorting the rules according to their priority; and determining the effective rule based on the rule priority. The rule pool is a pre-set set of rules, including pre-set neighbor node update rules and node attribute update rules. The input rule set consists of rules submitted by testers, such as node attribute update rules. When there is a conflict between the input rule set and the rules in the rule pool, the final effective rule is determined based on the priority order of the rules. For example, if the node attribute update rule submitted by the tester updates a specified node attribute of a second node, and the pre-set node attribute update rule in the rule pool updates all node attributes of the second node, updating all node attributes of the second node has a higher priority. In this case, based on the priority, the final node attribute update rule can be determined to update all node attributes of the second node.

[0097] The rule determination process checks whether a rule has been matched, specifically whether the first node is configured with the aforementioned adjacent node update rule or node attribute update rule. If the first node is configured with such a rule, appropriate processing can be performed based on it. If the first node is not configured with such a rule, processing of the current first node can end, and the process can continue to traverse the next first node.

[0098] To determine whether a child node exists, we need to check if the first node being traversed still has child nodes during the traversal process. If it does, we can repeat the above operation of importing the first node into the second test case tree until the first node being traversed no longer has child nodes. At this point, we can assume that all the first nodes in the first test case tree have been imported into the second test case tree, and we can end the traversal operation.

[0099] Figure 4 The diagram illustrates a process for importing a first node into a second test case tree to obtain an updated second test case tree, as provided in an embodiment of this disclosure.

[0100] Test data parsing involves generating the first test case tree by parsing the test case data to be imported.

[0101] Data identification refers to identifying the second node that matches the first node from the second test case tree.

[0102] Data generation refers to the generation of node information, such as node attributes and node types.

[0103] Merge the target trees, that is, import the first node into the second test case tree.

[0104] Figure 5 A schematic diagram of the structure of the rule pool provided in an embodiment of this disclosure is shown.

[0105] like Figure 5 As shown, rule pool 1, rule pool 2, rule pool 3, and rule pool 4 are all preset rule pools. Rule pool 1 includes rules 1-1, 1-2, and 1-3, rule pool 2 includes rules 2-1, 2-2, and 2-3, rule pool 3 includes rules 3-1, 3-2, and 3-3, and rule pool 4 includes rules 4-1, 4-2, and 4-3.

[0106] The rule pools correspond to the node types, such as... Figure 5 As shown, node type A corresponds to rule pool 1 and rule pool 2, and node type B corresponds to rule pool 3 and rule pool 4.

[0107] Figure 6 A schematic diagram of the structure of each rule provided in the embodiments of this disclosure is shown.

[0108] like Figure 6 As shown, a rule generally consists of three parts: judgment conditions, execution operations, and priority. Priority is used to determine which rules take effect in order of priority when conflicting rules exist. When a rule takes effect, it first checks whether the current node's attributes meet the judgment conditions of the current rule. If they do, the corresponding operation is executed according to the rule definition; otherwise, the current rule is skipped.

[0109] Figure 7 The following is a flowchart illustrating another test case processing method provided in this disclosure embodiment, as shown below. Figure 7 As shown, the method can mainly include:

[0110] Step S710: Obtain the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data;

[0111] Step S720: When a first node in the first test case tree has a matching second node in the second test case tree, the adjacent nodes of the second node are processed based on the adjacent node update rule corresponding to the second node.

[0112] Step S730: When the first node in the first test case tree does not have a matching second node in the second test case tree, create a second node that matches the first node in the second test case tree and determine the adjacent nodes of the second node.

[0113] The existing test case data can be test case data that has already been stored in the test case management system. The second test case tree is constructed by parsing the existing test case data.

[0114] The test case data to be imported is the test case data in the test case management system. When importing the test case data into the test case management system, the second test case tree can be updated according to the test case data to ensure that the second test case tree can represent the relationship between the test case data in the test case management system.

[0115] The first test case tree is constructed by parsing the test case data to be imported. This first test case tree can be built by parsing the test case data to be imported into the test case management system.

[0116] In this embodiment of the disclosure, each node in the first test case tree can be designated as a first node. By importing each first node into the second test case tree, the second test case tree contains the nodes corresponding to the first nodes, thus updating the second test case tree. The updated second test case tree can represent the relationships between the test case data in the test case management system after the test case data to be imported is imported into the test case management system.

[0117] The method provided in this disclosure acquires a first test case tree corresponding to the test case data to be imported and a second test case tree corresponding to the existing test case data, and then imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0118] In this embodiment of the disclosure, there may be some identical test case data between the test case data to be imported and the existing test case data, resulting in matching nodes in the first test case tree and the second test case tree. The matching first node and the second node correspond to the same test case data.

[0119] Adjacent nodes can be the parent and / or child nodes of a node. Relationships between nodes can include inheritance relationships between child nodes and their parent nodes.

[0120] When a second node exists in the second test case tree that matches the first node, the adjacent nodes of the first node in the first test case tree are usually different from the adjacent nodes of the second node in the second test case tree. If the first test case tree is directly inserted as a subtree into the second test case tree without adjusting the adjacent nodes of the second node in the updated second test case tree, conflicts may occur in the relationships between some nodes, making it impossible to accurately represent the relationships between test case data. Therefore, when a second node exists in the second test case tree that matches the first node, the adjacent nodes of these second nodes need to be adjusted to adjust the relationships between nodes.

[0121] In this embodiment of the disclosure, during the process of importing each first node in the first test case tree into the second test case tree, it can be determined whether each first node has a matching second node in the second test case tree, and the corresponding processing method can be determined according to whether the first node has a matching second node in the second test case tree, so as to adjust the relationship between nodes in the updated second test case tree.

[0122] In this embodiment of the disclosure, when a first node has a matching second node in the second test case tree, it can be assumed that the test case data corresponding to the first node already exists in the existing test case data, and there is no need to add a new node. At this time, the adjacent nodes of the second node can be processed according to the adjacent node update rule corresponding to the second node, so as to adjust the relationship between nodes in the updated second test case tree.

[0123] In this embodiment of the disclosure, neighbor node update rules can be pre-configured for the second node based on information such as the node type and attributes of the second node, so as to control the adjustment of the neighbor nodes of the second node.

[0124] The solution provided in this embodiment of the present disclosure, by processing the adjacent nodes of the second node based on the adjacent node update rule corresponding to the second node when the first node in the first test case tree has a matching second node in the second test case tree, effectively adjusts the relationship between nodes in the second test case tree, and can ensure that the updated second test case tree can accurately express the relationship between test case data.

[0125] When a first node in the first test case tree does not have a matching second node in the second test case tree, a second node matching the first node is created in the second test case tree, and the adjacent nodes of the second node are determined.

[0126] In this embodiment of the disclosure, when there is no matching second node for the first node in the second test case tree, a second node matching the first node can be created in the second test case tree. This second node is a newly added node in the second test case tree. At the same time, it is necessary to determine the adjacent nodes of the second node, so as to import the first node into the second test case tree.

[0127] Based on and Figure 1 The method shown follows the same principle. Figure 8 A schematic diagram of the structure of a test case processing device provided in an embodiment of this disclosure is shown, as follows: Figure 8 As shown, the test case processing device 80 may include:

[0128] The test case tree acquisition module 810 is used to acquire the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data.

[0129] The node import module 820 is used to import each first node in the first test case tree into the second test case tree.

[0130] The apparatus provided in this disclosure acquires a first test case tree corresponding to the test case data to be imported and a second test case tree corresponding to the existing test case data, and then imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0131] Optionally, the node import module is specifically used for:

[0132] Based on whether each first node in the first test case tree has a matching second node in the second test case tree, the first node is imported into the second test case tree.

[0133] Optionally, when the node import module imports a first node into the second test case tree based on whether there is a matching second node in the second test case tree for each first node in the first test case tree, it is specifically used for:

[0134] When a first node in the first test case tree has a matching second node in the second test case tree, the adjacent nodes of the second node are processed based on the adjacent node update rule corresponding to the second node.

[0135] Optionally, when the neighbor node update rule corresponding to the second node allows updating the neighbor nodes of the second node, the node import module, when processing the neighbor nodes of the second node, specifically uses the following methods:

[0136] The first pre-specified node is determined as the adjacent node of the second node, or the adjacent nodes of the second node are determined based on the adjacent nodes of the first node.

[0137] Optionally, the above-mentioned device further includes:

[0138] The node attribute update module is used to process the node attributes of the second node based on the node attribute update rules corresponding to the second node.

[0139] Optionally, the node attribute update rules include any of the following:

[0140] Update all node attributes of the second node;

[0141] Update the specified node properties of the second node;

[0142] Do not update the node properties of the second node.

[0143] Optionally, when the node import module imports a first node into the second test case tree based on whether there is a matching second node in the second test case tree for each first node in the first test case tree, it is specifically used for:

[0144] When a first node in the first test case tree does not have a matching second node in the second test case tree, a second node matching the first node is created in the second test case tree, and the adjacent nodes of the second node are determined.

[0145] Optionally, when determining the adjacent nodes of the second node, the node import module is specifically used for:

[0146] The second pre-specified node is determined as the adjacent node of the second node, or the adjacent node of the second node is determined based on the adjacent nodes of the first node.

[0147] Optionally, the node identifiers of each first node in the first test case tree and the node identifiers of each second node in the second test case tree are both determined based on preset naming rules. The above-mentioned device further includes:

[0148] The matching node search module is used to search in the second test case tree for a second node that matches the first node, based on the node identifier of the first node and the node identifiers of each second node in the second test case tree.

[0149] It is understood that the above-described modules of the test case processing device in the embodiments of this disclosure have the ability to implement... Figure 1 The embodiments shown illustrate the functionality of the corresponding steps in the test case processing method. This functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions. These modules can be software and / or hardware, and each module can be implemented individually or integrated from multiple modules. For a detailed description of the functions of each module in the above-described test case processing device, please refer to [link to relevant documentation]. Figure 1 The corresponding descriptions of the test case processing methods in the embodiments shown are not repeated here.

[0150] Based on and Figure 7 The method shown follows the same principle. Figure 9 A schematic diagram of another test case processing device provided in an embodiment of this disclosure is shown, such as... Figure 9 As shown, the test case processing device 90 may include:

[0151] The test case tree acquisition module 910 is used to acquire the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data.

[0152] The first node import module 920 is used to process the adjacent nodes of the second node based on the adjacent node update rule corresponding to the second node when the first node in the first test case tree has a matching second node in the second test case tree.

[0153] The second node import module 930 is used to create a second node that matches the first node in the second test case tree when there is no matching second node in the second test case tree for the first node in the first test case tree, and to determine the adjacent nodes of the second node.

[0154] The apparatus provided in this disclosure acquires a first test case tree corresponding to the test case data to be imported and a second test case tree corresponding to the existing test case data, and then imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0155] It is understood that the above-described modules of the test case processing device in the embodiments of this disclosure have the ability to implement... Figure 7 The embodiments shown illustrate the functionality of the corresponding steps in the test case processing method. This functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions. These modules can be software and / or hardware, and each module can be implemented individually or integrated from multiple modules. For a detailed description of the functions of each module in the above-described test case processing device, please refer to [link to relevant documentation]. Figure 7 The corresponding descriptions of the test case processing methods in the embodiments shown are not repeated here.

[0156] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0157] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0158] The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the test case processing method provided in the embodiments of this disclosure.

[0159] Compared with existing technologies, this electronic device acquires a first test case tree corresponding to the test case data to be imported and a second test case tree corresponding to the existing test case data, and then imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0160] The readable storage medium is a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the test case processing method provided in the embodiments of this disclosure.

[0161] Compared with existing technologies, this readable storage medium obtains the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data, and imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0162] The computer program product includes a computer program that, when executed by a processor, implements the test case processing method provided in the embodiments of this disclosure.

[0163] Compared with existing technologies, this computer program product obtains a first test case tree corresponding to the test case data to be imported and a second test case tree corresponding to the existing test case data, and then imports each first node in the first test case tree into the second test case tree. In this solution, by importing the nodes in the first test case tree constructed from the test case data to be imported into the second test case tree, the second test case tree is effectively updated, thus meeting the usage requirements when importing test case data.

[0164] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0165] like Figure 10 As shown, the electronic device 1000 includes a computing unit 1010, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1020 or a computer program loaded from a storage unit 1080 into a random access memory (RAM) 1030. The RAM 1030 may also store various programs and data required for the operation of the device 1000. The computing unit 1010, ROM 1020, and RAM 1030 are interconnected via a bus 1040. An input / output (I / O) interface 1050 is also connected to the bus 1040.

[0166] Multiple components in device 1000 are connected to I / O interface 1050, including: input unit 1060, such as keyboard, mouse, etc.; output unit 1070, such as various types of monitors, speakers, etc.; storage unit 1080, such as disk, optical disk, etc.; and communication unit 1090, such as network card, modem, wireless transceiver, etc. Communication unit 1090 allows device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0167] The computing unit 1010 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1010 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1010 executes the test case processing methods provided in the embodiments of this disclosure. For example, in some embodiments, executing the test case processing methods provided in the embodiments of this disclosure can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 1080. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1000 via ROM 1020 and / or communication unit 1090. When the computer program is loaded into RAM 1030 and executed by the computing unit 1010, one or more steps of the test case processing methods provided in the embodiments of this disclosure can be performed. Alternatively, in other embodiments, the computing unit 1010 may be configured to perform the test case processing method provided in the embodiments of this disclosure by any other suitable means (e.g., by means of firmware).

[0168] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0170] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0172] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0173] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0174] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0175] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A test case processing method, comprising: Get the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data; When a first node in the first test case tree has a matching second node in the second test case tree, the adjacent nodes of the second node are processed based on the adjacent node update rule corresponding to the second node. The test case data to be imported and the existing test case data have the same test case data. The first node and the matching second node have the same test case data. The adjacent nodes corresponding to the first node are different from the adjacent nodes corresponding to the second node. The adjacent node update rule of the second node is configured according to the node type and attributes of the second node. The node type includes test case group nodes and test case nodes. When the neighbor node update rule corresponding to the second node allows updating the neighbor nodes of the second node, the processing of the neighbor nodes of the second node includes: The first pre-designated node is determined as the adjacent node of the second node, or the adjacent node of the second node is determined based on the adjacent node of the first node; Determining the neighboring nodes of the second node based on the neighboring nodes of the first node includes: Determine the parent node of the first node in the first test case tree, and take the node in the second test case tree that matches the parent node as the parent node of the second node.

2. The method according to claim 1, further comprising: The node attributes of the second node are processed based on the node attribute update rules corresponding to the second node.

3. The method according to claim 2, wherein, The node attribute update rule includes any one of the following: Update all node attributes of the second node; Update the specified node attribute of the second node; Do not update the node attributes of the second node.

4. The method according to any one of claims 1-3, wherein importing the first node into the second test case tree based on whether there is a matching second node in the second test case tree for each first node in the first test case tree, comprises: When a first node in the first test case tree does not have a matching second node in the second test case tree, a second node matching the first node is created in the second test case tree, and the adjacent nodes of the second node are determined.

5. The method according to claim 4, wherein, Determining the adjacent nodes of the second node includes: The second pre-designated node is determined as the adjacent node of the second node, or the adjacent node of the second node is determined based on the adjacent nodes of the first node.

6. The method according to any one of claims 1-5, wherein, The node identifiers of each first node in the first test case tree and the node identifiers of each second node in the second test case tree are both determined based on preset naming rules. The method further includes: Based on the node identifier of the first node and the node identifiers of each second node in the second test case tree, search in the second test case tree for a second node that matches the first node.

7. A test case processing apparatus, comprising: The test case tree acquisition module is used to acquire the first test case tree corresponding to the test case data to be imported and the second test case tree corresponding to the existing test case data. The node import module is used to process the adjacent nodes of the second node based on the adjacent node update rule corresponding to the second node when a first node in the first test case tree has a matching second node in the second test case tree. The test case data to be imported has the same test case data as the existing test case data. The first node and the matching second node have the same test case data. The adjacent nodes corresponding to the first node include the adjacent nodes corresponding to the second node. The adjacent node update rule of the second node is configured according to the node type and attributes of the second node. The node type includes test case group nodes and test case nodes. Specifically, when the neighbor node update rule corresponding to the second node allows updates to the neighbor nodes corresponding to the second node, the node import module, when processing the neighbor nodes of the second node, is used to: The first pre-designated node is determined as the adjacent node of the second node, or the adjacent node of the second node is determined based on the adjacent node of the first node; When determining the adjacent nodes of the second node based on the adjacent nodes of the first node, the node import module is specifically used for: Determine the parent node of the first node in the first test case tree, and take the node in the second test case tree that matches the parent node as the parent node of the second node.

8. The apparatus according to claim 7, further comprising: The node attribute update module is used to process the node attributes of the second node based on the node attribute update rules corresponding to the second node.

9. The apparatus according to claim 7 or 8, wherein, When the node import module imports the first nodes into the second test case tree based on whether each first node in the first test case tree has a matching second node in the second test case tree, it is specifically used for: When a first node in the first test case tree does not have a matching second node in the second test case tree, a second node matching the first node is created in the second test case tree, and the adjacent nodes of the second node are determined.

10. The apparatus according to claim 9, wherein, When determining the adjacent nodes of the second node, the node import module is specifically used for: The second pre-designated node is determined as the adjacent node of the second node, or the adjacent node of the second node is determined based on the adjacent nodes of the first node.

11. The apparatus according to any one of claims 7-10, wherein, The node identifiers of each first node in the first test case tree and the node identifiers of each second node in the second test case tree are both determined based on preset naming rules. The device further includes: The matching node search module is used to search in the second test case tree whether there is a second node that matches the first node, based on the node identifier of the first node and the node identifier of each second node in the second test case tree.

12. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

13. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.

14. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Test case library introduction method, system and device based on tree table

    CN111124883A

  • Method and system for analyzing test cases for automatically generating optimized business models

    US20180089058A1