CN115080444A - Test case conversion method and device, electronic equipment and storage medium - Google Patents
Test case conversion method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115080444A CN115080444A CN202210817336.1A CN202210817336A CN115080444A CN 115080444 A CN115080444 A CN 115080444A CN 202210817336 A CN202210817336 A CN 202210817336A CN 115080444 A CN115080444 A CN 115080444A
- Authority
- CN
- China
- Prior art keywords
- test case
- test
- module
- sub
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention provides a test case conversion method, a test case conversion device, electronic equipment and a storage medium, belonging to the field of testing, wherein the method comprises the following steps: the method comprises the steps of receiving a thought guide map file, wherein the thought guide map on the thought guide map file comprises a plurality of test points, reading and analyzing the thought guide map to obtain a plurality of intermediate variables corresponding to the test points one by one, converting each intermediate variable into a test case based on a set rule of a test case table, and filling the test cases into the test case table, so that the automation process of converting the thought guide map into the test cases is realized, the test points do not need to be written in an Xmind file and an Excel table for multiple times manually, and the time consumption for generating the test cases can be reduced.
Description
Technical Field
The invention relates to the field of testing, in particular to a test case conversion method, a test case conversion device, electronic equipment and a storage medium.
Background
With the wide application of mind maps, the current generation method of test cases is generally as follows: by using the mind map, a tester writes test points in an Xmind file, and expands more test points according to the test points on the Xmind file in an Excel table. This approach requires writing two test cases and is therefore time consuming.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a test case transformation method, device, electronic device and storage medium, which can solve the problem of long time consumption of the current test case generation method.
In order to achieve the above object, the embodiments of the present invention adopt the following technical solutions.
In a first aspect, an embodiment of the present invention provides a test case conversion method, where the method includes:
receiving a thought map file, wherein a thought map in the thought map file comprises a main module and a plurality of sub-modules, the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents a test module;
reading and analyzing the mind map to obtain a plurality of intermediate variables, wherein each intermediate variable corresponds to one test point;
and converting each intermediate variable into a test case based on a set test case table rule, and filling the test case in the test case table.
Furthermore, each test point comprises a precondition, case content and an expected result, wherein the expected result is a leaf node of the thought graph;
the step of reading and analyzing the mind map to obtain a plurality of intermediate variables comprises the following steps:
reading and identifying the mind map file, and determining the category of each child node, wherein the category comprises a test module, a precondition, case content or an expected result;
converting the comment symbol in each child node into a corresponding comment word, and taking a single node as a breakpoint to split the thought guide graph to obtain a plurality of fields;
each field corresponds to a node, and the comment symbol represents modification, addition or deletion;
and storing all fields from the child node of the test module to a leaf node of the child node into an intermediate variable, and labeling the category of each field to obtain a plurality of intermediate variables.
Further, the mind map includes keywords, the keywords being identifications of the categories;
the step of reading and identifying the mind map file and determining the category of each child node comprises the following steps:
identifying the category of the child node with the keyword according to the keyword;
and based on the category of the child node with the keyword, determining the category of the child node without the keyword according to the creation rule of the mind map.
Further, the step of converting each intermediate variable into a test case based on the set rule of the test case table, and filling the test case in the test case table includes:
creating a test case table according to a preset rule, wherein each behavior of the test case table is a test case, and each list of the test case table characterizes a category;
for each intermediate variable, matching one row in the test case table for the intermediate variable as a matching row;
and filling each field of the intermediate variable into the matching row in the test case table according to the class corresponding relation.
Further, the step of converting each intermediate variable into a test case based on the set rule of the test case table, and filling the test case in the test case table further includes:
and if the annotation word exists in the intermediate variable, filling the representation meaning of the annotation word into the modification record column of the matching row.
Further, the step of converting each intermediate variable into a test case based on the set rule of the test case table, and filling the test case in the test case table further includes:
and if the field corresponding to the child node with the type of the expected result carries the requirement identification, filling the field into the corresponding requirement column of the matched row.
Further, after the step of receiving a mind map file, the method further comprises:
judging whether the file type of the mind map file is correct or not;
and when the type of the mind map file is judged to be correct, executing the step of reading and analyzing the mind map to obtain a plurality of intermediate variables.
In a second aspect, an embodiment of the present invention provides a test case converting apparatus, including a receiving module, a reading module, and a converting module;
the receiving module is used for receiving a thought-guide graph file, wherein a thought-guide graph in the thought-guide graph file comprises a main module and a plurality of sub-modules, the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents a test module;
the reading module is used for reading and analyzing the mind map to obtain a plurality of intermediate variables, wherein each intermediate variable corresponds to one test point;
the conversion module is used for converting each intermediate variable into a test case based on a set test case table rule and filling the test case into the test case table.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the test case conversion method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the test case conversion method according to the first aspect.
According to the test case conversion method, the test case conversion device, the electronic equipment and the storage medium, when the thought guide map file to be processed is received, the thought guide map in the thought guide map file is read and analyzed, each test point on the thought guide map is read as an intermediate variable, each intermediate variable is converted into the test case and filled in the test case table according to the rule of the test case table, the automatic process of converting the thought guide map into the test case is achieved, the test points do not need to be written in the Xmind file and the Excel table for multiple times, and therefore time consumption of test case generation can be reduced.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a first block diagram of an electronic device according to an embodiment of the present invention.
Fig. 2 shows one of the flow diagrams of the test case conversion method according to the embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a mind map provided by an embodiment of the present invention.
Fig. 4 shows a schematic flow chart of a part of the sub-steps of step S103 in fig. 2.
Fig. 5 shows a schematic flow chart of a part of the sub-steps of step S105 in fig. 2.
Fig. 6 is a second flowchart illustrating a test case conversion method according to an embodiment of the present invention.
Fig. 7 is a block diagram illustrating a test case conversion apparatus according to an embodiment of the present invention.
Fig. 8 shows a second block diagram of the electronic device according to the embodiment of the present invention.
Reference numerals: 100-an electronic device; 110-test case conversion device; 120-a receiving module; 130-a reading module; 140-conversion module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
With the development of electronic technology and software technology, testing is increasingly important in product design and production in various industries. A test case (test case) refers to a description of a test task performed on a specific software product, and embodies a test scheme, a method, a technique, and a measurement. It is to be understood that a test case is a set of test inputs, execution conditions, and expected results tailored for a particular purpose to verify that a particular software requirement is met.
In the testing process, in order to cover the testing requirements of the product as comprehensively as possible, there are generally two methods for writing test cases. One method is to write test cases in an Excel table directly according to the requirement documents of products, but test points are easy to miss by the method. The other is that a tester lists the functional points and the abnormal extreme conditions of the product on Xmind software, and then writes test cases (generally Excel files) according to the functional points and the abnormal extreme conditions listed on Xmind files. However, this method needs to write the test case twice, which results in a long time for generating the test case.
Based on the above consideration, the embodiment of the invention provides a test case conversion scheme, which can solve the problem of long time consumption of the current test case writing method and can cover the functional points and extreme abnormal conditions of the product as comprehensively as possible.
The test case conversion method provided by the embodiment of the invention can be applied to the electronic device 100 shown in fig. 1, the electronic device 100 is provided with a test case conversion program, when the program is started, a test case conversion interface is displayed on a display screen of the electronic device 100, the test case conversion interface comprises a file input option, a file generation option and a file type option, the file input option and the file generation option respectively correspond to one file type option, and one file type option comprises a plurality of selectable file types.
When the thinking guide picture file to be processed is input in the file input option, the Excel option is selected from the file type options of the file generation option, and then the file generation option is clicked, the electronic device 100 converts the thinking guide picture on the thinking guide picture file into a plurality of intermediate variables, then converts each intermediate variable into a test case according to the set rule of the test case table, and fills the test case into the test case table.
Otherwise, when the Excel file to be processed is input in the file input option, the xmnd option is selected in the file type options of the file generation option, and then the file generation option is clicked, the electronic device 100 converts the test case on the Excel table into a plurality of intermediate variables, converts each intermediate variable into a test point according to the set thought guidance diagram rule, and obtains the thought guidance diagram file according to the thought guidance diagrams of the components of the plurality of test points.
The thinking guide graph comprises a main module and a plurality of sub-modules, wherein the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, each sub-module represents one test module, and each intermediate variable corresponds to one test point.
In more detail, in one embodiment, referring to fig. 2, a test case transformation method is provided, which includes the following steps. In the present embodiment, the electronic device 100 shown in fig. 1 is exemplified as the execution subject of the test case conversion method.
S101, receiving a thinking map file.
S103, reading and analyzing the mind map to obtain a plurality of intermediate variables.
And S105, converting each intermediate variable into a test case based on the set test case table rule, and filling the test case into the test case table.
The thinking guide graph related to the test points is drawn on the thinking guide graph file, the thinking guide graph can be in a form shown in fig. 3, the thinking guide graph is composed of root nodes, sub-nodes and a plurality of leaf nodes, and comprises a main module and a plurality of sub-modules, the main module is the root node, all the sub-modules are the sub-nodes of the root node, each sub-module comprises a plurality of test points, each test point is the sub-node of the sub-module, and each sub-module represents one test module. For example, the main module is "meter-TT indicator light-theme", and may also be "multimedia-online music".
Each test point includes any of preconditions, use case content, and expected results, and generally, each test point must include use case content and expected results. The use case content can also be understood as an operation procedure. The content of the use case of a test point is generally an operation step, and only one expected result is included in the process. When the use case content of the test point is two or more operation steps, the expected result can be multiple, and the expected result and the use case content correspond to each other one by one.
If the use case content has a plurality of steps, the use case content can be written in a form of 1.xxx \2.nnn, namely, each step is distinguished in a line feed mode.
In this embodiment, the sequence between nodes on a branch in the thought graph is generally: main module-sub-module-precondition-use case content-desired result. It can also be understood that the creation rule of the mind map is that the nodes on one branch are constructed in the order of "main module-sub-module-precondition-use case content-expected result". It should be understood that the order among the preconditions, the use case content and the expected result may be changed, that is, the creation rule may be adjusted according to the actual situation, and the embodiment is not limited uniquely.
For example, the main module is a meter-TT indicator light-subject, one sub-module is used for testing, the number of test points included in the sub-module is four, the first test point includes preconditions, use case content and expected results, and the second test point, the third test point and the fourth test point only include use case content and expected results. In this embodiment, the expected results are child nodes of the case content, and the expected results are leaf nodes of the thought graph.
In order to facilitate learning of the category of each node in the mind map while reducing the data amount of the mind map, a keyword that is a unique identifier of a category may be configured for a part of the nodes when constructing the mind map. For example, nodes of two categories, namely a test module and a case built-in node, are configured with uniquely labeled keywords, and the keywords are used as prefixes of fields on the nodes as identifiers, which are in the form of [ M ] sub-modules and [ TC ] case contents. In addition, the use case content of each test point has a unique ID serial number, and the ID serial number can be immediately following the keyword identification of the use case content, namely TC < ID > use case content, for example, TC <1> use case content. It should be understood that the ID numbers may not be arranged in order.
Further, when constructing the mind map, in order to make the test points that can be converted into automation clear, the test points that can be automatically tested may be identified, and the automation test identification "a" may be followed by a case identification, for example, a character "a" may be used as an identification of the test points that can be automatically tested, and may be in the form of TC < ID > a case content.
After the version of the product and its system is updated or the test system is changed, the content of the test case may be changed accordingly, i.e. the test case is modified, added or deleted. In order to facilitate the implementation of the version tracking use case, a unique annotation symbol (which may also be an annotation identifier, but is not limited to be unique) is configured for different change operations, and the annotation symbol may also be located near a keyword identifier of the test case, for example, may be in the form of a "annotation symbol' TC < ID >. It should be understood that the position of the annotation symbol can be adjusted according to actual requirements, and the embodiment is not particularly limited.
Based on the construction rules and principles of the mind map, when the electronic device 100 obtains the mind map file, the mind map is read and analyzed, the mind map is divided into a plurality of intermediate variables, each intermediate variable corresponds to one test point, and each intermediate variable is converted into one test case according to the rules of the test case table and is filled in the test case table.
All information from the submodule to one leaf node of the submodule can be used as one intermediate variable, and fields from the main module to all nodes on a branch formed by one leaf node can be used as one intermediate variable, so that the thought-guiding graph is divided into a plurality of intermediate variables. In addition, the field of the root node can be used as a special intermediate variable, namely the field of the master module.
Compared with the traditional test case compiling method, the test case conversion method has the advantages that after the thought guide diagram (Xmind) file about the product test points is compiled, the thought guide diagram file is used as a file to be processed, the thought guide diagram in the thought guide diagram file is read and analyzed, each test point on the thought guide diagram is read as an intermediate variable, each intermediate variable is converted into a test case according to the rule of the test case table and is filled in the test case table, the automatic process of converting the thought guide diagram into the test case is realized, the test points do not need to be compiled in the Xmind file and the Excel table manually, and therefore time consumption of test case generation can be reduced.
For step S103, the manner of reading and analyzing the mind map to obtain a plurality of intermediate variables may be flexibly set, for example, the mind map may be read and analyzed by using a split model obtained by machine learning or neural network training to obtain a plurality of intermediate variables, or the mind map may be read and analyzed according to a preset rule to obtain a plurality of intermediate variables. In the present embodiment, it is not particularly limited.
In one possible implementation, referring to fig. 4, step S103 may be implemented by the following steps.
And S1031, reading and identifying the thinking map file, and determining the category of each child node.
Wherein the categories include test modules, preconditions, use case content, or expected results.
In detail, since some nodes in the mind map of China include keywords, the keywords are identifications of categories of the nodes, and the creation rules of the mind map are known. The classification of each child node can be determined by: and identifying the category of the child node with the keyword according to the keyword, and determining the category of the child node without the keyword according to the creation rule of the thinking guide graph based on the category of the child node with the keyword.
For example, when a test module and a case content under the test module are determined, the category of the child node of the node with the category of the case content is generally an expected result, and if a node exists between the child node of the test module and the node with the category of the case content, the category of the node is a precondition. Therefore, after the category of the node with the keyword is determined, the categories of other nodes without the keyword can be determined.
S1032, the comment symbol in each child node is converted into a corresponding comment word, and the thinking guide graph is split by taking a single node as a breakpoint to obtain a plurality of fields.
S1033, storing all fields from the child node with the category as the test module to a leaf node of the child node into an intermediate variable, and labeling the category of each field to obtain a plurality of intermediate variables.
Each field corresponds to a node, and the comment symbol represents change operations such as modification, addition or deletion.
Each field in the intermediate variable will be labeled with its own category, via step S1033.
Through the above steps S1031 to S1033, the mind map in the mind map file can be read and analyzed to obtain intermediate variables.
After splitting the mind map into a plurality of intermediate variables, referring to fig. 5, step S105 can be implemented in the following manner.
S1051, according to the preset rule, creating a test case table.
Each behavior of the test case table is a test case, each list of the test case table characterizes a category, and the name of the test case table is determined by a field of the main module, namely the name of the measurement case table is determined according to a child acid in an intermediate variable corresponding to the root node.
For example, the test case table includes, but is not limited to, a sequence number column, an owned module column, a use case name column, a preconditions column, an execution step column, an expected result column, a corresponding requirements column, a whether automation column, and a modification record column. It should be understood that the number of columns in the test case table is determined by the composition of the test cases, i.e., the design rule of the test case table is determined by the composition of the test cases, and the embodiment is not limited in particular.
S1052, for each intermediate variable, matching one row in the test case table for the intermediate variable as a matching row.
Each row in the test case table corresponds to a respective class of a test point, and thus, each intermediate variable has a row matching the row. The intermediate variables corresponding to the root nodes do not need to be configured with matching rows.
S1053, according to the corresponding relation of the categories, filling each field of the intermediate variable into the matching row in the test case table.
The category correspondence is the correspondence between each column in the test table and the category of the field in the intermediate variable, and the category correspondence may be stored in advance in the form of a data dictionary and may be called directly during conversion. After the category correspondence is obtained, a corresponding matching column can be quickly inquired for each field in the intermediate variable in the matching row, and the corresponding matching column in the test case table is filled according to each field.
In detail, the module to which the test case belongs corresponds to a field of the main module, and the case name corresponds to a field and an ID number of the sub-module, for example, the main module is "meter-TT indicator-main body", and the sub-section of the case content in the intermediate variable includes TC <97>, the module to which the test case belongs in the test case table is "meter", and the case name is "meter-TT indicator-main body-test-97".
The precondition column corresponds to the field whose category is the precondition, and the content of the field whose category is the precondition is directly filled in the precondition column, and similarly, the execution step column, the expected result column, the corresponding requirement column, and the modification record column are also the same.
Further, when step S1053 is executed, if a comment word exists in the intermediate variable, the representation meaning of the comment word is filled in the modified record column of the matching row. For example, if the comment word characterizes a modification, then "modify" is filled in the modification record column; if the comment word represents deletion, filling 'deletion' in the modified record column; if the comment word represents "add", the "add" is filled in the modified record column.
In other embodiments, if the comment word in one intermediate variable represents deletion, the intermediate variable with the comment word representing deletion can be directly ignored without filling the intermediate variable in the test case table.
In the mind map, the child nodes of the use case content are all expected result nodes in general, but sometimes there may be corresponding requirements, that is, the test point has no expected result and only has corresponding requirements, and at this time, when the mind map is constructed, a unique keyword is configured for the corresponding requirements. In this case, when step S1053 is executed, if the field corresponding to the child node whose category is the expected result has the requirement identifier, the field is filled into the corresponding requirement column of the matching row.
Through the steps S1051-S1053, each intermediate variable can be quickly converted into a test case in the test case table.
In order to avoid the situation of test case conversion failure caused by file receiving error or file type error to a certain extent, referring to fig. 6, in an embodiment, the test case conversion method provided by the present invention further includes step S102, which is executed after step S101 and before step S103.
S102, judging whether the file type of the mind map file is correct or not. If so, go to step S103, otherwise, prompt the file type error.
The type of the mind map file is generally an xmind type, and if the mind map file input to the electronic device 100 does not belong to the xmind type, the conversion from the mind map to the test case table cannot be performed.
Based on the thinking of the S101-S105 thinking guide graph file converted into the example table for test, the reverse reasoning is carried out, and the example table for test can also be converted into the thinking guide graph file.
In detail, after receiving the test case table to be converted, each test case in the test case table may be first converted into an intermediate variable, each intermediate variable corresponds to one test case (i.e., one row) in the test case table, and then each intermediate variable is converted into a node branch (each type of field is used as a node) in the thought-chart according to the creation rule of the thought-chart, so as to complete the conversion of the test case table into the thought-chart. In the conversion process, the category is converted into a corresponding keyword, and the annotation word is converted into a corresponding annotation symbol.
In the process of converting the intermediate variables into the node branches in the mind map, the existing nodes do not need to be repeatedly constructed, namely, each node in the mind map only needs to be created once.
The test case conversion method provided by the invention can convert the xmnd type mind map about the test points into the test case table, and also can convert the test case table into the mind map about the test points based on reverse thinking, thereby realizing the mutual conversion between the mind map file and the test case table, reducing the test case compiling times, reducing the test case compiling time consumption, improving the efficiency and covering the test requirements of the product as fully as possible.
In one embodiment, referring to fig. 7, based on the concept of the test case conversion method, a test case conversion apparatus 110 is provided, which includes a receiving module 120, a reading module 130, and a converting module 140.
The receiving module 120 is configured to receive a mind map file.
The thinking guide graph in the thinking guide graph file comprises a main module and a plurality of sub-modules, wherein the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents one test module.
The reading module 130 is configured to read and parse the mind map to obtain a plurality of intermediate variables.
Wherein each intermediate variable corresponds to a test point.
The conversion module 140 is configured to convert each intermediate variable into a test case based on the set test case table rule, and fill the test case in the test case table.
In the test case converting apparatus 110, after the receiving module 120 receives the mind map file to be processed, the reading module 130 reads and analyzes the mind map in the mind map file, and reads each test point on the mind map as an intermediate variable, and then the converting module 140 can convert each intermediate variable into a test case according to the rule of the test case table and fill the test case on the test case table, so as to realize the automatic process of converting the mind map into the test case, and it is not necessary to manually write the test points in the xmnd file and the Excel table, thereby reducing the time consumption for generating the test case.
Further, the receiving module 120 is further configured to receive a test case table to be converted. The reading module 130 is further configured to convert the test case table into a plurality of intermediate variables, where each intermediate variable corresponds to one test case (i.e., one row) in the test case table.
The converting module 140 is further configured to convert each intermediate variable into a node branch (each category field is used as a node) in the mind map according to the creating rule of the mind map, so as to complete the conversion of the mind map into the test case table.
For specific limitations of the test case converting apparatus 110, reference may be made to the above limitations of the test case converting method, which are not described herein again. The modules in the test case converting apparatus 110 may be implemented in whole or in part by software, hardware, or a combination thereof. The modules may be embedded in a hardware form or may be independent of a processor in the electronic device 100, or may be stored in a memory of the electronic device 100 in a software form, so that the processor calls and executes operations corresponding to the modules.
In one embodiment, an electronic device 100 is provided, the internal structure of which may be as shown in FIG. 8. The electronic device 100 includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Wherein the processor of the electronic device 100 is configured to provide computing and control capabilities. The memory of the electronic apparatus 100 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device 100 is used for performing wired or wireless communication with an external terminal, and the wireless communication may be implemented through WIFI, an operator network, Near Field Communication (NFC), or other technologies. The computer program is executed by a processor to implement a test case transformation method.
It will be understood by those skilled in the art that the structure shown in fig. 8 is a block diagram of only a portion of the structure associated with the inventive arrangements, and does not constitute a limitation on the electronic device 100 to which the inventive arrangements are applied, and that a particular electronic device 100 may include more or fewer components than those shown in fig. 8, or may combine certain components, or have a different arrangement of components.
In one embodiment, the test case conversion apparatus 110 provided by the present invention may be implemented in the form of a computer program that can be run on the electronic device 100 shown in fig. 8. The memory of the electronic device 100 may store various program modules constituting the test case converting apparatus 110, such as the receiving module 120, the reading module 130, and the converting module 140 shown in fig. 7. The computer program constituted by the respective program modules causes the processor to execute the steps described in this specification applied to the test case conversion method.
For example, the electronic device 100 shown in fig. 8 may execute step S101 through the receiving module 120 in the test case converting apparatus 110 shown in fig. 7. The electronic device 100 may perform step S103 through the reading module 130. The electronic device 100 may perform step S105 through the conversion module 140.
In one embodiment, an electronic device 100 is provided, comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program: receiving a thought map file, wherein a thought map in the thought map file comprises a main module and a plurality of sub-modules, the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents a test module; reading and analyzing the mind map to obtain a plurality of intermediate variables, wherein each intermediate variable corresponds to one test point; and converting each intermediate variable into a test case based on the set rule of the test case table, and filling the test case in the test case table.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a thought map file, wherein a thought map in the thought map file comprises a main module and a plurality of sub-modules, the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents a test module; reading and analyzing the mind map to obtain a plurality of intermediate variables, wherein each intermediate variable corresponds to one test point; and converting each intermediate variable into a test case based on the set rule of the test case table, and filling the test case in the test case table.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A test case conversion method, the method comprising:
receiving a thought map file, wherein a thought map in the thought map file comprises a main module and a plurality of sub-modules, the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents a test module;
reading and analyzing the mind map to obtain a plurality of intermediate variables, wherein each intermediate variable corresponds to one test point;
and converting each intermediate variable into a test case based on a set test case table rule, and filling the test case in the test case table.
2. The test case conversion method according to claim 1, wherein each of the test points includes preconditions, case contents, and expected results, the expected results being leaf nodes of a mind map;
the step of reading and analyzing the mind map to obtain a plurality of intermediate variables comprises the following steps:
reading and identifying the mind map file, and determining the category of each child node, wherein the category comprises a test module, a precondition, case content or an expected result;
converting the comment symbol in each child node into a corresponding comment word, and taking a single node as a breakpoint to split the thought guide graph to obtain a plurality of fields;
each field corresponds to a node, and the comment symbol represents modification, addition or deletion;
and storing all fields from the child node of the test module to a leaf node of the child node into an intermediate variable, and labeling the category of each field to obtain a plurality of intermediate variables.
3. The test case conversion method according to claim 2, wherein the mind map includes a keyword, the keyword being an identification of the category;
the step of reading and identifying the mind map file and determining the category of each child node comprises the following steps:
identifying the category of the child node with the keyword according to the keyword;
and based on the category of the child node with the keyword, determining the category of the child node without the keyword according to the creation rule of the mind map.
4. The method according to claim 2, wherein the step of converting each intermediate variable into a test case based on the set test case table rule and filling the test case in the test case table comprises:
creating a test case table according to a preset rule, wherein each behavior of the test case table is a test case, and each list of the test case table characterizes a category;
for each intermediate variable, matching one row in the test case table for the intermediate variable as a matching row;
and filling each field of the intermediate variable into the matching row in the test case table according to the class corresponding relation.
5. The method according to claim 4, wherein the step of converting each intermediate variable into a test case based on the set rules of the test case table and filling the test case in the test case table further comprises:
and if the annotation word exists in the intermediate variable, filling the representation meaning of the annotation word into the modification record column of the matching row.
6. The method according to claim 4, wherein the step of converting each intermediate variable into a test case based on the set rules of the test case table and filling the test case in the test case table further comprises:
and if the fields corresponding to the child nodes with the types of the expected results have the requirement identifications, filling the fields into the corresponding requirement columns of the matched rows.
7. The test case conversion method of claim 1, wherein after the step of receiving a mind map file, the method further comprises:
judging whether the file type of the mind map file is correct or not;
and when the type of the mind map file is judged to be correct, executing the step of reading and analyzing the mind map to obtain a plurality of intermediate variables.
8. A test case conversion device is characterized by comprising a receiving module, a reading module and a conversion module;
the receiving module is used for receiving a thought-guide graph file, wherein a thought-guide graph in the thought-guide graph file comprises a main module and a plurality of sub-modules, the main module is a root node, each sub-module is a sub-node of the root node, each sub-module comprises a plurality of test points, each test point is a sub-node of the sub-module, and each sub-module represents a test module;
the reading module is used for reading and analyzing the mind map to obtain a plurality of intermediate variables, wherein each intermediate variable corresponds to one test point;
the conversion module is used for converting each intermediate variable into a test case based on a set test case table rule and filling the test case into the test case table.
9. An electronic device comprising a processor and a memory, the memory storing a computer program executable by the processor, the processor being operable to execute the computer program to implement the test case conversion method of any of claims 1 to 7.
10. A storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the test case conversion method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210817336.1A CN115080444A (en) | 2022-07-12 | 2022-07-12 | Test case conversion method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210817336.1A CN115080444A (en) | 2022-07-12 | 2022-07-12 | Test case conversion method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115080444A true CN115080444A (en) | 2022-09-20 |
Family
ID=83259599
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210817336.1A Pending CN115080444A (en) | 2022-07-12 | 2022-07-12 | Test case conversion method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115080444A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20230053698A1 (en) * | 2021-08-19 | 2023-02-23 | Nio Technology (Anhui) Co., Ltd | Method and system for managing life cycle iteration of test case, and medium |
-
2022
- 2022-07-12 CN CN202210817336.1A patent/CN115080444A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20230053698A1 (en) * | 2021-08-19 | 2023-02-23 | Nio Technology (Anhui) Co., Ltd | Method and system for managing life cycle iteration of test case, and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107665171B (en) | Automatic regression testing method and device | |
US8516442B2 (en) | Graphical user interface metadata evolution tool | |
CN109740122B (en) | Method and device for converting thinking guide graph use case file | |
CN102541521B (en) | Automatic operating instruction generating device based on structured query language and method | |
CN108279885B (en) | Method and device for integrating software of multiple model codes | |
CN109710528B (en) | Test script generation method, device, equipment and medium | |
CN108170602B (en) | Test case generation method and device, terminal and computer readable medium | |
CN111158656B (en) | Test code generation method and device based on fruit tree method | |
CN112378420A (en) | Signal simulation method and system for automobile navigation test and electronic equipment | |
CN110659197B (en) | Application test case generation method and device and software test system | |
CN113094252B (en) | Test case generation method and device, computer equipment and storage medium | |
CN115080444A (en) | Test case conversion method and device, electronic equipment and storage medium | |
CN103761095A (en) | Method for generating universal header data information of upgraded file | |
CN114064003A (en) | Applet generation method, apparatus, device and storage medium | |
CN111143228B (en) | Test code generation method and device based on decision table method | |
CN104536897A (en) | Automatic testing method and system based on keyword | |
CN109582347B (en) | Method and device for acquiring front-end codes | |
Miller et al. | Learning Python for Forensics: Leverage the power of Python in forensic investigations | |
CN113360388B (en) | Method for integrally managing test process of unmanned aerial vehicle ground station software | |
CN111967274B (en) | Label conversion processing method and device, electronic equipment and readable storage medium | |
CN114356783A (en) | Method and device for automatically generating unit test code, storage medium and equipment | |
CN110119351B (en) | Test case execution method and device | |
CN115579096A (en) | Automatic generation and analysis verification method, system and storage medium for drug alert E2B R3 standard report | |
CN108628606B (en) | Method and system for generating WEB network management application program of embedded equipment | |
US20200125476A1 (en) | Manipulation of complex variables in orchestration applications |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |