Test case updating method and device, storage medium and electronic device
By synchronizing and updating the reference relationships between test case trees, the problem of test case changes and additions not being automatically updated is solved, realizing automated test case updates and improving efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, changes and additions to test cases cannot be automatically updated, resulting in significant time consumption and potential omissions.
By obtaining the reference relationship between the first test case tree and the second test case tree, the synchronous update of the content of the target reference node and the target reference source node is achieved, and the test cases are automatically updated by using a preset update method of merging or overwriting.
Automatic updates of test cases were achieved, avoiding omissions caused by manual recording and improving the accuracy and efficiency of updates.
Smart Images

Figure CN114924988B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to a test case update method, a test case update device, a storage medium, and an electronic device. Background Technology
[0002] To ensure the proper functioning of testing software, test cases are typically used to test its functionality. Full-scale test cases used in large-scale R&D projects are composed of tree-structured baseline test cases for all or part of multiple subsystems. During project development, functional changes to these subsystem modules may need to be made, or test cases may need to be updated for newly discovered test points. When the project ends, these added or modified test cases usually need to be manually transcribed into the tree-structured baseline test cases for the subsystems. Automatic updates of test cases are not possible, which is not only time-consuming but also prone to omissions.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] The purpose of this disclosure is to provide a test case updating method, test case updating device, storage medium, and electronic device, which aim to solve the problem of automatically updating test cases.
[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0006] According to one aspect of the embodiments of this disclosure, a test case update method is provided, comprising: obtaining a first test case tree; wherein the first test case tree includes reference nodes, the reference nodes having a reference relationship with reference source nodes in a second test case tree; when the content of a target reference source node referenced by a target reference node changes, synchronizing the changed content of the target reference source node to the target reference node; and when the content of a target reference node changes, synchronizing the changed content of the target reference node to the target reference source node.
[0007] According to some embodiments of this disclosure, based on the foregoing scheme, the method further includes: writing the first test case tree based on the second test case tree, wherein writing the first test case tree based on the second test case tree includes: selecting the reference source node to form a test subtree according to the test requirements and the identification information of each node in the second test case tree; copying the test subtree to the first test case tree to obtain reference nodes that have a reference relationship with the reference source node; and completing the first test case tree based on the reference nodes.
[0008] According to some embodiments of this disclosure, based on the foregoing scheme, synchronizing the modified content of the target reference source node to the target reference node includes: determining the test subtree according to the reference relationship; comparing the target reference source node in the test subtree with the target reference node in the first test case tree to obtain a first comparison result; and updating the node content of the target reference node according to the first comparison result and a preset update method.
[0009] According to some embodiments of this disclosure, based on the foregoing scheme, synchronizing the modified content of the target reference node to the target reference source node includes: comparing the target reference node with the second test case tree to obtain a second comparison result; and updating the node content of the target reference source node according to the second comparison result and a preset update method.
[0010] According to some embodiments of this disclosure, based on the foregoing scheme, the preset update method includes merging or overwriting.
[0011] According to some embodiments of this disclosure, based on the foregoing scheme, the method further includes: performing functional analysis on each node in the second test case tree, or determining the identification information of each node based on the annotation information of each node in the second test case tree.
[0012] According to some embodiments of this disclosure, based on the foregoing scheme, when the node is a module node, the identification information of the node includes a module identifier; when the node is a use case node, the identification information of the node includes a use case identifier and a use case level identifier; the module node includes at least one use case node.
[0013] According to a second aspect of the present disclosure, a test case updating apparatus includes: an acquisition module, configured to acquire a first test case tree; wherein the first test case tree includes reference nodes, and the reference nodes have a reference relationship with reference source nodes in a second test case tree; a first update module, configured to synchronize the changed content of the target reference source node to the target reference node when the content of the target reference source node changes; and a second update module, configured to synchronize the changed content of the target reference node to the target reference source node when the content of the target reference node changes.
[0014] According to a third aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the test case update method as described in the above embodiments.
[0015] According to a fourth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the test case update method as described in the above embodiments.
[0016] The exemplary embodiments disclosed herein may have some or all of the following beneficial effects:
[0017] In the technical solutions provided by some embodiments of this disclosure, when a reference node in the first test case tree references a reference source node in the second test case tree, regardless of whether the content of the target reference source node or the content of the target reference node changes, the test cases can be updated synchronously according to the reference relationship between the test cases, realizing bidirectional updating of the referenced content, thereby realizing the reference inheritance between test cases, avoiding the need to manually rewrite the test cases after the change, reducing costs and increasing efficiency, and realizing automatic updating of test cases.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0020] Figure 1 The illustration shows a flowchart of a test case update method according to an exemplary embodiment of the present disclosure;
[0021] Figure 2 This schematic diagram illustrates an interface for creating a new test case tree in an exemplary embodiment of the present disclosure;
[0022] Figure 3 This schematic diagram illustrates an interface for adding referenced test cases in an exemplary embodiment of this disclosure;
[0023] Figure 4 The illustration shows a flowchart of a bidirectional update method for referenced content in an exemplary embodiment of this disclosure;
[0024] Figure 5 The schematic diagram illustrates a flowchart of another bidirectional update method for referenced content in an exemplary embodiment of this disclosure;
[0025] Figure 6 This schematic diagram illustrates an interface for referencing node information in an exemplary embodiment of the present disclosure.
[0026] Figure 7 This schematic diagram illustrates the composition of a test case updating apparatus according to an exemplary embodiment of the present disclosure;
[0027] Figure 8 This schematic diagram illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure;
[0028] Figure 9 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0029] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.
[0030] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0032] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily need to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0033] The implementation details of the technical solutions of the embodiments of this disclosure are described in detail below.
[0034] Figure 1 This schematically illustrates a flowchart of a test case update method according to an exemplary embodiment of this disclosure. Figure 1 As shown, the test case update method includes steps S101 to S103:
[0035] Step S101: Obtain the first test case tree; wherein the first test case tree includes reference nodes, and the reference nodes have a reference relationship with the reference source nodes in the second test case tree;
[0036] Step S102: When the content of the target reference source node referenced by the target reference node changes, synchronize the changed content of the target reference source node to the target reference node; and
[0037] Step S103: When the content of the target reference node changes, synchronize the changed content of the target reference node to the target reference source node.
[0038] In some embodiments of the present disclosure, when a reference node in the first test case tree references a reference source node in the second test case tree, regardless of whether the content of the target reference source node or the content of the target reference node changes, the test cases can be updated synchronously according to the reference relationship between the test cases, thereby realizing bidirectional updating of the referenced content, thus realizing the reference inheritance between test cases, avoiding manual rewriting of the changed test cases, reducing costs and increasing efficiency, and realizing automatic updating of test cases.
[0039] The following will describe in more detail each step of the test case update method in this example implementation with reference to the accompanying drawings and embodiments.
[0040] In step S101, a first test case tree is obtained; wherein the first test case tree includes reference nodes, and the reference nodes have a reference relationship with the reference source nodes in the second test case tree.
[0041] In one embodiment of this disclosure, the test case tree may include multiple nodes. Some nodes are created independently and have no association with other nodes; some nodes have a referencing and / or being referenced relationship with other nodes; nodes that refer to other nodes are denoted as "referring nodes", and nodes that are referenced by other nodes are denoted as "referring source nodes", that is, "referring nodes" refer to "referring source nodes".
[0042] When node content changes, to clearly illustrate how the node content changes, the test case tree containing the "referring node" corresponding to the node change event is designated as the first test case tree, and the test case tree containing the "referring source node" is designated as the second test case tree. All or part of the test cases in the first test case tree reference the second test case tree; that is, there is a one-to-one correspondence between the referencing nodes in the first test case tree and the referencing source nodes in the second test case tree.
[0043] Therefore, the method further includes: writing the first test case tree based on the second test case tree, the process of which includes: selecting the reference source node to form a test subtree according to the test requirements and the identification information of each node in the second test case tree; copying the test subtree to the first test case tree to obtain reference nodes that have a reference relationship with the reference source node; and writing the first test case tree based on the reference nodes.
[0044] Specifically, when writing the first test case tree, the test cases in it can reference parts or the whole of the second test case tree to achieve the purpose of local reference. This can be done by directly selecting or by filtering using filtering conditions to obtain the test subtree. Then, the reference source node in the test subtree is copied from the first test case tree to another test case tree as a node in the second test case tree to complete the reference of the test case.
[0045] In practice, there may be different application scenarios. For example, a mind-map-based visual test case editing platform can be used to write test case trees. Test cases are connected in the form of nodes, branching from the root node to form a tree structure. A test case tree can also be called a test case set.
[0046] Figure 2 This schematic diagram illustrates an interface for creating a new test case tree according to an exemplary embodiment of this disclosure, with reference to... Figure 2As shown, when creating a new test case tree, you can select the referenced test cases, that is, edit the content of "Referenced Test Cases". After the test case tree is created, the referenced test cases can be placed in the newly created test case tree.
[0047] Another scenario is referencing test cases after a test case tree has already been created. Figure 3 This schematic diagram illustrates an interface for adding reference test cases in an exemplary embodiment of this disclosure, with reference to... Figure 3 As shown, you can select a node in the test case tree and add referenced test cases under that node. That is, you can edit "Add Reference" to complete the reference of test cases.
[0048] It should be noted that the first test case tree and the second test case tree are only relative terms. Each test case tree can reference the content of other test case trees, and can also be used as a referenced test case tree.
[0049] In one embodiment of this disclosure, identification information can be configured for test cases at each node in the test case tree to select the test cases to be referenced based on the identification information.
[0050] Specifically, the method further includes: performing functional analysis on each node in the second test case tree, or determining the identification information of each node based on the annotation information of each node in the second test case tree.
[0051] When the node is a module node, the node's identification information includes a module identifier; when the node is a use case node, the node's identification information includes a use case identifier and a use case level identifier.
[0052] The nodes in the test case tree can be divided into two categories: module nodes, which are sets of test cases that can implement certain test functions, and test case nodes. Module nodes are the parent nodes of test case nodes, and a module node can include one or more test case nodes. Therefore, for different node types, corresponding module identifiers or test case identifiers can be configured.
[0053] For a single test case, different test cases have different effects on the final test case. For example, baseline test cases are used to complete basic system testing functions, while higher-level test cases are used to complete certain special testing functions. Therefore, test case level identifiers can be configured for test case nodes. For example, level 1 is the baseline test case, and level 2, level 3, etc. are above it.
[0054] Once the nodes in the test case tree have identification information, the filtering of reference source nodes can be accomplished by filtering the identification information. For example, you can first select the target module node from the module nodes with module identification, and then select all level 1 test cases under the target module node according to the test case level identification to serve as the referenced test subtree, thus obtaining the reference source node.
[0055] When determining the identification information of each node in the test case tree, one approach is to rely on the parsing function of the test case editing system itself to perform functional analysis on each node and automatically and intelligently add corresponding identifiers based on the test functions that the test cases can perform. However, since different testers have different habits in writing test cases, it is sometimes impossible to accurately parse which nodes are module nodes and which are test case nodes. Therefore, another approach is to allow users to manually annotate each node and determine its identification information based on the annotations.
[0056] In step S102, when the content of the target reference source node referenced by the target reference node changes, the changed content of the target reference source node is synchronized to the target reference node. In this embodiment, the target reference node references the target reference source node.
[0057] Figure 4 This schematic diagram illustrates a flowchart of a bidirectional update method for referenced content in an exemplary embodiment of this disclosure. (Refer to...) Figure 4 As shown, the method includes:
[0058] Step S401: Determine the test subtree based on the reference relationship;
[0059] Step S402: Compare the target reference source node in the test subtree with the target reference node in the first test case tree to obtain the first comparison result;
[0060] Step S403: Update the node content of the target reference node according to the first comparison result and a preset update method.
[0061] Specifically, when the content of the referenced source node changes, the changes in the content of the referenced source node need to be synchronized to the current referenced node in order to "update the current test case". At this time, a test subtree can be extracted from a complete second test tree that is referenced based on the reference relationship. Then, the test subtree is compared with the current first test case tree to perform recursive merging or coverage.
[0062] In step S103, when the content of the target reference node changes, the changed content of the target reference node is synchronized to the target reference source node.
[0063] Figure 5This schematically illustrates a flowchart of another bidirectional update method for referenced content in an exemplary embodiment of this disclosure, with reference to... Figure 5 As shown, the method includes:
[0064] Step S501: Compare the target reference node with the second test case tree to obtain a second comparison result;
[0065] Step S502: Update the node content of the target reference source node according to the second comparison result and a preset update method.
[0066] Specifically, when writing the first test case tree, there may be changes to the content of the referenced nodes. If it is necessary to synchronize the changed content of the referenced nodes to the referenced source nodes to "update the source test cases", the referenced nodes in the current test case tree can be extracted and compared with the complete test case tree of the referenced source nodes, and then recursively merged or overwritten.
[0067] It's important to note that the default update methods include merging and overwriting. Merging stores the modified node content along with the previous node content, while overwriting deletes the previous node content and replaces it with the updated node content. These two update methods have different application scenarios. For example, if a test function of a test case is deleted from the first test case tree, but the second test case tree referenced by that test case still needs to retain the test case, then the merging update method can be used. However, if the second test case tree also does not need to retain the original test function, then the deletion update method can be used.
[0068] Figure 6 This diagram schematically illustrates an interface for referencing node information in an exemplary embodiment of this disclosure. After creating a test case tree in the test case editing platform, clicking on a reference node in the test case tree will display information such as... in a preset location on the platform. Figure 6 The reference information for this reference node is shown. This includes a window displaying the referenced content of the node, and update buttons indicating the reference update direction and method for bidirectional node updates. Reference update directions include updating the current use case and updating the source use case; reference update methods include merging and overwriting.
[0069] When the content of the source node changes and the referenced node also needs to be changed accordingly, the user can choose to update the current test case as the reference update direction, then select the corresponding reference update method, submit and save, and then obtain the latest node change information in the current test case tree.
[0070] If changes are made to the referenced nodes and child nodes in the current first test case tree, and these changes need to be synchronized to the referenced second test case tree, the user can choose to update the source test case as the reference update direction, select the corresponding reference update method, and submit and save. After that, the referenced source node will obtain the relevant node change information.
[0071] Based on the above method, whether it is the reused source use case (referring to the source node) or the reused use case (referring to the node), the content can be automatically updated bidirectionally when the node content changes. That is, when the content of the referencing source node changes, the content of the referencing node will be updated accordingly, or when the content of the referencing node changes, the content of the referencing source node will also be updated accordingly. This avoids the omissions caused by manually completing the change record and improves the accuracy and efficiency of the update.
[0072] Figure 7 This schematic diagram illustrates the composition of a test case updating apparatus according to an exemplary embodiment of the present disclosure, such as... Figure 7 As shown, the test case update device 700 may include an acquisition module 701, a first update module 702, and a second update module 703. Wherein:
[0073] The acquisition module 701 is used to acquire a first test case tree; wherein, the first test case tree includes reference nodes, and the reference nodes have a reference relationship with the reference source nodes in the second test case tree;
[0074] The first update module 702 is used to synchronize the changed content of the target reference source node to the target reference node when the content of the target reference source node changes.
[0075] The second update module 703 is used to synchronize the changed content of the target reference node to the target reference source node when the content of the target reference node changes.
[0076] According to an exemplary embodiment of this disclosure, the test case update device 700 further includes a writing module, configured to write the first test case tree based on the second test case tree, including: selecting the reference source node to form a test subtree according to test requirements and the identification information of each node in the second test case tree; copying the test subtree to the first test case tree to obtain reference nodes that have a reference relationship with the reference source node; and completing the writing of the first test case tree based on the reference nodes.
[0077] According to an exemplary embodiment of this disclosure, the first update module 702 is configured to determine the test subtree based on the reference relationship; compare the target reference source node in the test subtree with the target reference node in the first test case tree to obtain a first comparison result; and update the node content of the target reference node according to a preset update method based on the first comparison result.
[0078] According to an exemplary embodiment of this disclosure, the second update module 703 is used to compare the target reference node with the second test case tree to obtain a second comparison result; and update the node content of the target reference source node according to the second comparison result and a preset update method.
[0079] According to exemplary embodiments of this disclosure, the preset update method includes merging or overwriting.
[0080] According to an exemplary embodiment of this disclosure, the test case update device 700 further includes an identification module, which is used to perform functional parsing on each node in the second test case tree, or to determine the identification information of each node based on the annotation information of each node in the second test case tree.
[0081] According to an exemplary embodiment of this disclosure, when the node is a module node, the identification information of the node includes a module identifier; when the node is a use case node, the identification information of the node includes a use case identifier and a use case level identifier; the module node includes at least one use case node.
[0082] The specific details of each module in the aforementioned test case update device 700 have been described in detail in the corresponding test case update method, so they will not be repeated here.
[0083] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0084] In an exemplary embodiment of this disclosure, a storage medium capable of implementing the above-described method is also provided. Figure 8 This schematic diagram illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure, such as... Figure 8As shown, a program product 800 for implementing the above-described method according to an embodiment of the present disclosure is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a mobile phone. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0085] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided. Figure 9 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure.
[0086] It should be noted that, Figure 9 The computer system 900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0087] like Figure 9 As shown, the computer system 900 includes a Central Processing Unit (CPU) 901, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 902 or programs loaded from storage section 908 into Random Access Memory (RAM) 903. The RAM 903 also stores various programs and data required for system operation. The CPU 901, ROM 902, and RAM 903 are interconnected via a bus 904. An Input / Output (I / O) interface 905 is also connected to the bus 904.
[0088] The following components are connected to I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to I / O interface 905 as needed. Removable media 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 910 as needed so that computer programs read from them can be installed into storage section 908 as needed.
[0089] In particular, according to embodiments of this disclosure, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by central processing unit (CPU) 901, it performs various functions defined in the system of this disclosure.
[0090] It should be noted that the computer-readable medium shown in the embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0091] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0092] The units described in the embodiments of this disclosure can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the unit itself.
[0093] In another aspect, this disclosure also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0094] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0095] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this disclosure.
[0096] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0097] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A test case update method, characterized in that, include: Perform functional analysis on each node in the second test case tree, or determine the identification information of each node in the second test case tree based on the annotation information of each node in the second test case tree; When the node is a module node, the node's identification information includes a module identifier; when the node is a use case node, the node's identification information includes a use case identifier and a use case level identifier. The module node includes at least one use case node; Based on the testing requirements and the identification information of each node in the second test case tree, the reference source nodes are selected to form the test subtree; Copy the test subtree to the first test case tree to obtain reference nodes that have a reference relationship with the reference source node; complete the first test case tree based on the reference nodes; Obtain a first test case tree; wherein the first test case tree includes reference nodes, and the reference nodes have a reference relationship with the reference source nodes in the second test case tree; When the content of the target reference source node referenced by the target reference node changes, the changed content of the target reference source node is synchronized to the target reference node; as well as When the content of the target reference node changes, the changed content of the target reference node is synchronized to the target reference source node.
2. The test case update method according to claim 1, characterized in that, The step of synchronizing the modified content of the target reference source node to the target reference node includes: The test subtree is determined based on the reference relationship; The target reference source node in the test subtree is compared with the target reference node in the first test case tree to obtain the first comparison result; Based on the first comparison result, update the node content of the target reference node according to the preset update method.
3. The test case update method according to claim 1, characterized in that, The step of synchronizing the modified content of the target reference node to the target reference source node includes: The target reference node is compared with the second test case tree to obtain a second comparison result; Based on the second comparison result, update the node content of the target reference source node according to the preset update method.
4. The test case update method according to claim 2 or 3, characterized in that, The preset update methods include merging or overwriting.
5. A test case updating device, characterized in that, include: The identification module is used to perform functional parsing on each node in the second test case tree, or to determine the identification information of each node in the second test case tree based on the annotation information of each node in the second test case tree. When the node is a module node, the node's identification information includes a module identifier; when the node is a use case node, the node's identification information includes a use case identifier and a use case level identifier. The module node includes at least one use case node; Write a module to select reference source nodes to form a test subtree based on test requirements and the identification information of each node in the second test case tree; Copy the test subtree to the first test case tree to obtain reference nodes that have a reference relationship with the reference source node; complete the first test case tree based on the reference nodes; An acquisition module is used to acquire a first test case tree; wherein the first test case tree includes reference nodes, and the reference nodes have a reference relationship with the reference source nodes in the second test case tree; The first update module is used to synchronize the changed content of the target reference source node to the target reference node when the content of the target reference source node referenced by the target reference node changes; The second update module is used to synchronize the changed content of the target reference node to the target reference source node when the content of the target reference node changes.
6. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the test case update method as described in any one of claims 1 to 4.
7. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the test case update method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Software testing method and device for changing case quickly
CN103226514A
Automatic testing method and device
CN111435329A