Test case library introduction method, system and equipment based on tree form
Technical Field
The invention relates to the technical field of computers, in particular to a method, a system and equipment for introducing a test case base based on a tree form.
Background
The use case is a description of how a system reacts to an external request in software engineering or system engineering, and is a technology for acquiring a demand through a use scene of a user. Each use case provides one or more scenarios that illustrate how the system interacts with the end user or other system, i.e., who can do what with the system, to achieve a clear business goal. Technical terminology is to be avoided when writing use cases, and the language of the end user or domain expert should be used. Use cases are typically coauthored by software developers and end users.
In the test management system, a plurality of project example libraries are provided, and one baseline example library is provided. The baseline case library often contains a plurality of cases required by the project case library, and the traditional project case library is maintained by using cases in an Excel importing mode, so that the method is complicated and is easy to make mistakes. How to directly introduce the baseline case of the tree-form multi-hierarchy structure into each project case library in a line mode and process the introduction of the multi-hierarchy structure in an efficient mode is a problem to be solved urgently.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a method, a system, and a device for introducing a test case base based on a tree-form table, which are capable of efficiently introducing a baseline case into each project case base on line by processing nodes of a multi-level structure of the tree-form table and efficiently processing test cases and belonging level data in combination with a recursive traversal algorithm.
In order to achieve the purpose, the invention is realized by the following technical scheme: a test case library introduction method based on a tree form comprises the following steps:
s1: assembling a node object list;
s2: circularly traversing the node object list to ensure that the parents of the selected nodes are all introduced;
s3: the node objects are recursively saved.
Further, the tree table is treegrid, and step S1 includes:
acquiring a node list selected by treegrid at a foreground and circularly traversing;
screening use case nodes and fully selected level nodes;
and transmitting the use case or all selected hierarchical assembly node object to the background.
Further, the step S2 includes:
acquiring the number of use cases under the project according to the project name;
selecting a use case and acquiring a selected node id and a node id in a project use case table;
entering a selected use case;
and circularly traversing the nodes at all levels to ensure that the parents of the selected nodes are all introduced.
Further, the step S3 includes:
if the selected node is a use case, the selected node is directly introduced and stored into the project.
If the selected node is a hierarchy, the child nodes are recursively traversed, and the child hierarchies and use cases are saved.
Further, acquiring a baseline case entity;
judging whether the selected node exists under the project or not according to the hierarchy or the use case name;
and if the selected node is a leaf node, directly judging and storing, otherwise traversing all child nodes and storing and traversing, if the selected node does not exist, adding a new node, and inquiring the id of the new node as a father node of the next traversal.
Further, the storing of the node's predicate specifically includes:
firstly, deleting an old case and putting the old case into a history table; and then deleting the corresponding data in the formal table.
Correspondingly, the invention also discloses a test case base introducing system based on the tree form, which comprises the following steps:
a list assembling unit for assembling a node object list;
the list traversal unit is used for circularly traversing the node object list to ensure that the parents of the selected nodes are all introduced;
and the node storage unit is used for recursively storing the node objects.
Correspondingly, the invention also discloses a test case library introducing device based on the tree form, which comprises the following steps:
a memory for storing a computer program;
a processor for implementing the tree table based test case base introduction method steps as described in any one of the above when the computer program is executed.
Compared with the prior art, the invention has the beneficial effects that: the invention provides a test case library introduction method, a test case library introduction system and test case library introduction equipment based on a tree form. And traversing and storing the multi-level child nodes by using a recursive algorithm. The method is used for introducing the baseline case library of the treegrid multi-level structure, can be used for more efficiently and accurately improving the management efficiency of the test cases, and further promotes the test efficiency of products such as servers.
The invention processes the data of the multi-level tree structure between the similar level and the use case more reasonably and accurately, improves the test management efficiency, saves the labor cost and ensures the product quality.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of the method of the present invention.
Fig. 2 is a system block diagram of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made with reference to the accompanying drawings.
As shown in fig. 1, the present invention provides a test case base importing method based on a tree form, which includes the following steps:
s1: and acquiring a node list selected by the treegrid at the foreground and circularly traversing.
S2: and screening case nodes and all selected hierarchical nodes.
S3: and transmitting the use case or all selected hierarchical assembly node object to the background.
S4: and acquiring the number of use cases under the project according to the project name.
S5: and selecting a use case and acquiring the id of the selected node and the id of the node in the project use case table.
S6: and entering the selected use case.
S7: and circularly traversing the nodes at all levels to ensure that the parents of the selected nodes are all introduced.
S8: if the selected node is a use case, the selected node is directly introduced, namely is stored in the project.
S9: if the selected node is a hierarchy, the child nodes are recursively traversed, and the child hierarchies and use cases are saved.
On the basis, the steps S8 and S9 are specifically: firstly, acquiring a baseline case entity;
judging whether the selected node exists under the project or not according to the hierarchy or the use case name; and if the selected node is a leaf node, directly judging and storing, otherwise traversing all child nodes and storing and traversing, if the selected node does not exist, adding a new node, and inquiring the id of the new node as a father node of the next traversal.
The node judgment and storage specifically comprises the following steps: firstly, deleting an old case and putting the old case into a history table; and then deleting the corresponding data in the formal table.
On the basis, the specific script content of the tree-form-based test case library introduction method provided by the invention by taking JAVA as a main development language is as follows:
1. assembling node object list:
correspondingly, as shown in fig. 2, the present invention also discloses a test case library importing system based on a tree form, which includes:
a list assembling unit for assembling a node object list;
the list traversal unit is used for circularly traversing the node object list to ensure that the parents of the selected nodes are all introduced;
and the node storage unit is used for recursively storing the node objects.
Correspondingly, the invention also discloses a test case library introducing device based on the tree form, which comprises the following steps: a memory for storing a computer program;
a processor for implementing the tree table based test case base introduction method steps as described in any one of the above when the computer program is executed.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention. The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.
In the embodiments provided by the present invention, it should be understood that the disclosed system, system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit.
Similarly, each processing unit in the embodiments of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units are integrated into one functional module.
The invention is further described with reference to the accompanying drawings and specific embodiments. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and these equivalents also fall within the scope of the present application.