Test case writing and conversion method and device, equipment, medium and program
By analyzing test case data from mind mapping software, transcoding and matching table templates, the problem of low efficiency in writing and conversion of test cases in the prior art is solved, and the standardization and efficient conversion of test cases are achieved.
Patent Information
- Application Number
- CN202311262787.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Existing test case writing and conversion methods are based on fixed formats and cannot accurately match a variety of test case templates, resulting in low efficiency.
By obtaining test cases from mind mapping software, analyzing the thinking structure data, and performing dictionary transcoding and list transcoding, matching the pre-acquisitioned table template structure, and generating use case table data.
It realizes standardization and consistency of test cases, improves the accuracy and efficiency of test case conversion, and reduces the workload of manual processing and conversion.
Smart Images

Figure CN119759745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software testing technology, and in particular to a test case writing and conversion method, device, equipment, medium and program. Background Art
[0002] With the development of software and information industry, software testing to improve software quality has become an increasingly important field. Mind mapping, as a widely used tool for organizing thoughts, can provide a clear hierarchical structure and association relationships, which helps to sort out and organize test cases. It is currently widely used by many testing teams to write test cases, but traditional test cases are in word format or execl format, so mind maps need to be used for test case writing and conversion.
[0003] Existing test case writing and conversion methods are mostly based on fixed formats. For example, the writing and conversion of mind maps in Testlink format and ZenTao format. In actual applications, test cases need to be customized according to their own business. However, the fixed format-based writing and conversion methods cannot accurately match the templates of various test cases and require manual adjustment and entry, resulting in low efficiency in test case conversion. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention provide a test case writing and conversion method, apparatus, device, medium and program.
[0005] In a first aspect, an embodiment of the present invention provides a test case writing and conversion method, comprising:
[0006] Acquire test cases from mind mapping software, and parse thought structure data from the test cases;
[0007] Performing dictionary transcoding on the thought structure data to obtain thought dictionary data;
[0008] Performing list transcoding on the thought dictionary data to obtain thought list data;
[0009] Perform structural analysis on the pre-acquired table template to obtain table structure data;
[0010] The table structure data is matched with the thinking list data to obtain use case table data, and the use case table data is reorganized into a use case table.
[0011] According to an embodiment of the present invention, parsing the thought structure data from the test case includes:
[0012] Extracting a file root element from the test case;
[0013] Performing a downward loop traversal operation on the file root element to obtain a file element set and an element structure;
[0014] Performing attribute parsing on each file element in the file element set to obtain element attributes;
[0015] The thought structure data is generated according to the element structure and the element attribute.
[0016] According to an embodiment of the present invention, the dictionary transcoding of the thought structure data to obtain thought dictionary data includes:
[0017] Splitting the thought structure data into internal node data and leaf node data;
[0018] Performing key-value conversion on the leaf node data to obtain leaf node dictionary data;
[0019] Recursively convert the internal node data into nested key values to obtain internal node dictionary data;
[0020] The leaf node dictionary data and the internal node dictionary data are aggregated into thinking dictionary data.
[0021] According to an embodiment of the present invention, the list transcoding of the thinking dictionary data to obtain thinking list data includes:
[0022] Selecting dictionary data in the thought dictionary data one by one as target dictionary data;
[0023] Extracting target dictionary key and target dictionary value pairs from the target dictionary data respectively;
[0024] Generate target list data according to the target dictionary key and the target dictionary value pair, and collect all the target list data into thought list data.
[0025] According to an embodiment of the present invention, the step of performing structural analysis on the pre-acquired table template to obtain table structure data includes:
[0026] Perform list transcoding on the pre-acquired table template to obtain template list data;
[0027] Selecting list data in the template list data one by one as target structure list data, and extracting target structure attributes of the target structure list data;
[0028] Target structure data are generated according to the target structure list data and the target structure attributes, and all target structure data are collected into table structure data.
[0029] According to an embodiment of the present invention, the step of performing data matching on the table structure data using the thought list data to obtain the use case table data includes:
[0030] Selecting structure data in the table structure data one by one as target structure data, and extracting target structure key data from the target structure data;
[0031] Using the target structure key data to perform key matching on the thought list data to obtain matching list data;
[0032] Using the matching list data to perform value replacement on the target structure data to obtain target table data;
[0033] Aggregate all target table data into use case table data.
[0034] In a second aspect, an embodiment of the present invention provides a test case writing and conversion device, characterized in that it includes:
[0035] A mind map parsing module, used to obtain test cases from the mind map software and parse the mind structure data from the test cases;
[0036] A dictionary transcoding module, used for performing dictionary transcoding on the thought structure data to obtain thought dictionary data;
[0037] A list transcoding module, used for performing list transcoding on the thought dictionary data to obtain thought list data;
[0038] The template parsing module is used to perform structural analysis on the pre-acquired table template to obtain table structure data;
[0039] The data matching module is used to use the thought list data to perform data matching on the table structure data to obtain use case table data, and reorganize the use case table data into a use case table.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device, comprising:
[0041] processor;
[0042] a memory for storing instructions executable by the processor;
[0043] Among them, the processor is configured to execute the instructions to implement a test case writing and conversion method as described in the first aspect above.
[0044] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a test case writing and conversion method as described in the first aspect.
[0045] In a fifth aspect, an embodiment of the present invention provides a computer program, which, when executed by a processor, implements a test case writing and conversion method as described in the first aspect.
[0046] Compared with the prior art, the above technical solution of the present invention has the following beneficial effects:
[0047] The embodiments of the present invention allow each enterprise or team to customize the test case template according to its own needs by performing structural analysis on the table template, thereby improving the standardization and consistency of the test case, and matching the test case with the specific business process and needs. The accuracy of the conversion can be improved by traversing the node conversion method, ensuring that all test case information can be correctly mapped to the corresponding field, avoiding information loss or inaccuracy, reducing the workload of manual processing and conversion, and improving the work efficiency of the team. By converting the test case into a unified file format, standardized management of the test case is achieved, which will help team members better understand and use the test case, and provide a consistent format and structure, facilitating the location and management of test items and test points. Therefore, the test case writing and conversion method, device and equipment proposed in the present invention can solve the problem of low efficiency when performing test case conversion. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 The flowchart of the test case writing and conversion method according to the first embodiment of the present invention is shown;
[0050] Figure 2 A functional module diagram of a test case writing and conversion device according to a second embodiment of the present invention is shown;
[0051] Figure 3 A schematic diagram of the composition structure of an electronic device for implementing the test case writing and conversion method according to the third embodiment of the present invention is shown. DETAILED DESCRIPTION
[0052] The present disclosure is further described below in conjunction with the embodiments shown in the accompanying drawings.
[0053] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0054] The present invention proposes a test case writing and conversion based on process transcoding technology, which is based on a multi-level data format conversion method, extracts key values and structural attributes of test cases by node traversal, realizes fast and accurate test case writing and conversion, and has application value in the field of software testing technology.
[0055] Embodiment 1
[0056] like Figure 1 As shown, the present invention proposes a test case writing and conversion method, comprising the following steps:
[0057] S1. Obtain test cases from mind mapping software, and parse thinking structure data from the test cases.
[0058] In an embodiment of the present invention, the mind mapping software may be Mindmaster, MindManager or XMind. The mind mapping software may conveniently edit a mind map. The test case is the mind map used for testing. The mind map is a tool for graphically representing thoughts, ideas, concepts, tasks, plans or other information. It is usually centered on a central theme and expanded through tree branches to present various related sub-themes, keywords, relationships and branches. The data format of the test case may be xmind or emmx.
[0059] In detail, the thinking structure data includes the overall organizational structure of the mind map, which displays topics, sub-topics, keywords and the hierarchical relationships between them in the form of a tree or branch structure. Each node of the thinking structure data can contain elements such as text, icons, colors, etc. to represent related information and attributes.
[0060] In the embodiment of the present invention, the step of parsing the thought structure data from the test case includes:
[0061] Extracting a file root element from the test case;
[0062] Performing a downward loop traversal operation on the file root element to obtain a file element set and an element structure;
[0063] Performing attribute parsing on each file element in the file element set to obtain element attributes;
[0064] The thought structure data is generated according to the element structure and the element attribute.
[0065] In detail, the tree.getroot function of ElementTree can be used to extract the file root element from the test case. The file root element is the starting point of the test case and the root node in the mind map. The iter function can be used to perform a downward loop traversal operation on the file root element to obtain a file element set and an element structure. The file element set is the elements in the test case, including file root elements and file sub-elements. The file sub-elements are child nodes in the mind map. The element structure is the overall file structure of the mind map and the position data of each node.
[0066] Specifically, the find function or the findall function can be used to perform attribute parsing on each file element in the file element set to obtain element attributes, wherein the element attributes include the label and value attributes of each element in the file element set. The generating of thinking structure data according to the element structure and the element attributes means adding the position data of each element in the element structure to the corresponding element data in the element attributes. The thinking structure data includes the position structure, value, data type and data attributes of each element data in the test case.
[0067] In an embodiment of the present invention, by obtaining test cases from mind mapping software and parsing thinking structure data from the test cases, the file format inherent in the mind mapping software can be converted into data structures and data attributes stored in a general format, thereby facilitating the conversion and operation of test case data.
[0068] S2. Perform dictionary transcoding on the thought structure data to obtain thought dictionary data.
[0069] In an embodiment of the present invention, the thinking dictionary data is thinking structure data stored in a dictionary format, and the dictionary format can be python's dict format, Java's json format, YAML format (YAML Ain't Markup Language) or TOML format (Tom's Obvious, Minimal Language). In order to facilitate computer recognition and operation of thinking structure data, the thinking structure data needs to be converted into dictionary data.
[0070] In the embodiment of the present invention, the dictionary transcoding of the thought structure data to obtain thought dictionary data includes:
[0071] Splitting the thought structure data into internal node data and leaf node data;
[0072] Performing key-value conversion on the leaf node data to obtain leaf node dictionary data;
[0073] Recursively convert the internal node data into nested key values to obtain internal node dictionary data;
[0074] The leaf node dictionary data and the internal node dictionary data are aggregated into thinking dictionary data.
[0075] In detail, the internal node data refers to the file element that has file sub-elements in the thinking structure data, and the leaf node data refers to the file element that does not have file sub-elements in the thinking structure data. Since the internal node data has file sub-elements, a nested relationship will be generated, and therefore they need to be converted separately.
[0076] Specifically, the key-value conversion of the leaf node data to obtain leaf node dictionary data refers to converting the label, attribute and subnode of each file element in the leaf node data into corresponding dictionary key-value pairs, and the tag label in the file element can be converted into a text text key value, and the attrib attribute in the file element can be updated to the corresponding key-value pair by means of an update function.
[0077] In an embodiment of the present invention, by performing dictionary transcoding on the thinking structure data to obtain thinking dictionary data, the nested structure between file elements in the thinking structure data can be removed, which facilitates the subsequent conversion of the table format. At the same time, the hierarchical structure and attribute information of the text elements are retained by converting the leaf node data and the internal node data separately, which facilitates the subsequent corresponding matching.
[0078] S3. Perform list transcoding on the thought dictionary data to obtain thought list data.
[0079] In an embodiment of the present invention, the thinking list data is thinking dictionary data stored in a list format, and the list format can be a list format or a linked list format. By converting the thinking dictionary data into thinking list data, the data can be flatter, which facilitates data iteration and processing, and is also convenient for subsequent conversion into data in a table format.
[0080] In the embodiment of the present invention, the list transcoding of the thinking dictionary data to obtain the thinking list data includes:
[0081] Selecting dictionary data in the thought dictionary data one by one as target dictionary data;
[0082] Extracting target dictionary key and target dictionary value pairs from the target dictionary data respectively;
[0083] Generate target list data according to the target dictionary key and the target dictionary value pair, and collect all the target list data into thought list data.
[0084] In detail, the target dictionary key refers to the key of the target dictionary data. The key is a unique identifier used to identify and access values in the dictionary. It can be any immutable data type, usually a string, integer, floating point number or tuple. Each key is unique in the dictionary and has uniqueness. The target dictionary value pair refers to the value of the target dictionary data. The value is the data associated with a specific key. A dictionary can contain multiple different key-value pairs, each key corresponds to a value, and the value can be any data type, including strings, integers, floating point numbers, lists, dictionaries and other data.
[0085] In detail, the keys function can be used to extract the target dictionary keys from the target dictionary data, the values function can be used to extract the target dictionary value pairs from the target dictionary data, or the items function can be used to extract the target dictionary keys and target dictionary value pairs from the target dictionary data respectively. Generating target list data according to the target dictionary keys and the target dictionary values means using the target dictionary keys as the keys of the target list data and the target dictionary value pairs as the values of the target list to obtain the target list data.
[0086] In an embodiment of the present invention, by performing list transcoding on the thinking dictionary data to obtain thinking list data, the data can be made flatter, more compact and easier to process, while also facilitating data sorting and screening, and also making it easier to convert data into list format.
[0087] S4. Perform structural analysis on the pre-acquired table template to obtain table structure data.
[0088] In an embodiment of the present invention, the table template refers to a template file of a file format that needs to be converted. The table template can be a table file in xls format. The table structure data contains fields such as test case ID, requirement correspondence, function number, prerequisite, test purpose, test steps, test data, expected results, whether passed, and author. The format and field attributes of the table template can be customized according to the needs of each structure and organization, which will improve the standardization and consistency of test cases and match test cases with specific business processes and requirements.
[0089] In the embodiment of the present invention, the structure analysis of the pre-acquired table template to obtain the table structure data includes:
[0090] Perform list transcoding on the pre-acquired table template to obtain template list data;
[0091] Selecting list data in the template list data one by one as target structure list data, and extracting target structure attributes of the target structure list data;
[0092] Target structure data are generated according to the target structure list data and the target structure attributes, and all target structure data are collected into table structure data.
[0093] In detail, the xlrd library of Python can be used to perform list transcoding on the pre-acquired table template to obtain template list data, and the target structure attributes refer to the structural attributes of the target structure list data in the table template, such as row number information, column number information, cell type and table cell. The target structure attributes of the target structure list data can be extracted by traversal unlocking. Generating target structure data according to the target structure list data and the target structure attributes refers to adding the target structure attributes as key values to the target structure list data to obtain the target structure data.
[0094] In the embodiment of the present invention, by performing structural analysis on the pre-acquired table template to obtain table structure data, the table structure and cell attributes of the table template can be analyzed, thereby facilitating subsequent data matching operations.
[0095] S5. Use the thinking list data to perform data matching on the table structure data to obtain use case table data, and reorganize the use case table data into a use case table.
[0096] In the embodiment of the present invention, the use case table data refers to data in a table structure data format including thought list data, and the use case table data may be in a list format.
[0097] In the embodiment of the present invention, the use of the thought list data to perform data matching on the table structure data to obtain the use case table data includes:
[0098] Selecting structure data in the table structure data one by one as target structure data, and extracting target structure key data from the target structure data;
[0099] Using the target structure key data to perform key matching on the thought list data to obtain matching list data;
[0100] Using the matching list data to perform value replacement on the target structure data to obtain target table data;
[0101] Aggregate all target table data into use case table data.
[0102] In detail, the target structure key data refers to the key of the target structure data, such as a test case ID, and using the target structure key data to perform key matching on the thinking list data to obtain matching list data means using the target structure key data to match the key of each list data of the thinking list data, and using the successfully matched list data as the matching list data.
[0103] Specifically, the use of the matching list data to replace the value of the target structure data to obtain the target table data refers to replacing some blank values of the target structure data with the values of the matching list data, and the values refer to the node values of the mind map, such as expected result 1, expected result 2, etc. The use case table data can be reorganized into a use case table using Python's xlwt library.
[0104] In an embodiment of the present invention, by using the thinking list data to match the table structure data to obtain use case table data, and reorganizing the use case table data into a use case table, the mind map can be converted into a table format that is easy to save, thereby improving the efficiency of subsequent software testing, while ensuring the accuracy of data when the test case is formatted, thereby improving the efficiency of test case conversion.
[0105] The embodiments of the present invention obtain test cases from mind mapping software and parse the thinking structure data from the test cases, so as to convert the file format inherent in the mind mapping software into a data structure and data attributes stored in a general format, thereby facilitating the conversion and operation of the test case data. By performing dictionary transcoding on the thinking structure data to obtain thinking dictionary data, the nested structure between file elements in the thinking structure data can be removed, thereby facilitating the subsequent conversion of the table format. At the same time, the hierarchical structure and attribute information of the text elements are retained by converting the leaf node data and the internal node data separately, thereby facilitating the subsequent corresponding matching. By performing list transcoding on the thinking dictionary data to obtain thinking list data, the data can be flattened, made more compact and easier to process. It is also convenient for sorting and filtering data, and it is also easier to convert data into a list format. By performing structural analysis on the pre-acquired table template to obtain table structure data, the table structure and unit attributes of the table template can be parsed, thereby facilitating subsequent data matching operations. By using the thinking list data to perform data matching on the table structure data to obtain use case table data, and reorganizing the use case table data into a use case table, the mind map can be converted into a table format that is easy to save, thereby improving the efficiency of subsequent software testing, and at the same time ensuring the accuracy of data when the test case is formatted, thereby improving the efficiency of test case conversion. Therefore, the test case writing and conversion method proposed in the present invention can solve the problem of low efficiency when performing test case format conversion.
[0106] Embodiment 2
[0107] like Figure 2 As shown, this embodiment also provides a functional module diagram of a test case writing and conversion device.
[0108] The test case writing and conversion device 100 described in this embodiment can be installed in an electronic device. According to the functions implemented, the test case writing and conversion device 100 may include a map parsing module 101, a dictionary transcoding module 102, a list transcoding module 103, a template parsing module 104 and a data matching module 105. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0109] In this embodiment, the functions of each module / unit are as follows:
[0110] The mind map parsing module 101 is used to obtain test cases from the mind map software and parse the mind structure data from the test cases;
[0111] The dictionary transcoding module 102 is used to perform dictionary transcoding on the thought structure data to obtain thought dictionary data;
[0112] The list transcoding module 103 is used to perform list transcoding on the thinking dictionary data to obtain thinking list data;
[0113] The template parsing module 104 is used to perform structural analysis on the pre-acquired table template to obtain table structure data;
[0114] The data matching module 105 is used to perform data matching on the table structure data using the thinking list data to obtain use case table data, and reorganize the use case table data into a use case table.
[0115] In detail, each module described in the test case writing and conversion device 100 described in the embodiment of the present invention adopts the same technical means as the test case writing and conversion method described in Example 1 when used, and can produce the same technical effects, which will not be repeated here.
[0116] Embodiment 3
[0117] like Figure 3 As shown, this embodiment also provides a computer electronic device, which may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a test case writing and conversion program.
[0118] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a product recommendation program based on user portraits, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.
[0119] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of a product recommendation program based on a user portrait, but can also be used to temporarily store data that has been output or is to be output.
[0120] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0121] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0122] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0123] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0124] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0125] The product recommendation program based on user portrait stored in the memory 11 of the electronic device is a combination of multiple instructions, and when running in the processor 10, it can achieve:
[0126] Acquire test cases from mind mapping software, and parse thought structure data from the test cases;
[0127] Performing dictionary transcoding on the thought structure data to obtain thought dictionary data;
[0128] Performing list transcoding on the thought dictionary data to obtain thought list data;
[0129] Perform structural analysis on the pre-acquired table template to obtain table structure data;
[0130] The table structure data is matched with the thinking list data to obtain use case table data, and the use case table data is reorganized into a use case table.
[0131] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0132] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0133] Embodiment 4
[0134] This embodiment provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the test case writing and conversion method described above are implemented.
[0135] These program codes can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable device for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.
[0136] Storage media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, modules of programs or other data. Examples of storage media can include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0137] Embodiment 5
[0138] An embodiment of the present invention provides a computer program, which, when executed by a processor, implements the steps of a test case writing and conversion method as described in the first aspect above.
[0139] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer programs can also be stored in a computer-readable storage medium, which enables the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the computer program includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0140] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. When the terms "include" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations.
[0141] It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or described herein.
[0142] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0143] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0145] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0146] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0147] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0148] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A test case writing and conversion method, characterized in that: The method comprises: Acquire test cases from mind mapping software, and parse thought structure data from the test cases; Performing dictionary transcoding on the thought structure data to obtain thought dictionary data; Performing list transcoding on the thought dictionary data to obtain thought list data; Perform structural analysis on the pre-acquired table template to obtain table structure data; The table structure data is matched with the thinking list data to obtain use case table data, and the use case table data is reorganized into a use case table.
2. The test case writing and conversion method according to claim 1, characterized in that: The step of parsing the thought structure data from the test case includes: Extracting a file root element from the test case; Performing a downward loop traversal operation on the file root element to obtain a file element set and an element structure; Performing attribute parsing on each file element in the file element set to obtain element attributes; The thought structure data is generated according to the element structure and the element attribute.
3. The test case writing and conversion method according to claim 1, characterized in that: The dictionary transcoding of the thought structure data to obtain thought dictionary data includes: Splitting the thought structure data into internal node data and leaf node data; Performing key-value conversion on the leaf node data to obtain leaf node dictionary data; Recursively convert the internal node data into nested key values to obtain internal node dictionary data; The leaf node dictionary data and the internal node dictionary data are aggregated into thinking dictionary data.
4. The test case writing and conversion method according to claim 1, characterized in that: The list transcoding of the thought dictionary data to obtain thought list data includes: Selecting dictionary data in the thought dictionary data one by one as target dictionary data; Extracting target dictionary key and target dictionary value pairs from the target dictionary data respectively; Generate target list data according to the target dictionary key and the target dictionary value pair, and collect all the target list data into thought list data.
5. The test case writing and conversion method according to claim 1, characterized in that: The structure analysis of the pre-acquired table template is performed to obtain table structure data, including: Perform list transcoding on the pre-acquired table template to obtain template list data; Selecting list data in the template list data one by one as target structure list data, and extracting target structure attributes of the target structure list data; Target structure data are generated according to the target structure list data and the target structure attributes, and all target structure data are collected into table structure data.
6. The test case writing and conversion method according to claim 1, characterized in that: The step of using the thought list data to perform data matching on the table structure data to obtain the use case table data includes: Selecting structure data in the table structure data one by one as target structure data, and extracting target structure key data from the target structure data; Using the target structure key data to perform key matching on the thought list data to obtain matching list data; Using the matching list data to perform value replacement on the target structure data to obtain target table data; Aggregate all target table data into use case table data.
7. A test case writing and conversion device, characterized in that: The device comprises: A mind map parsing module, used to obtain test cases from the mind map software and parse the mind structure data from the test cases; A dictionary transcoding module, used for performing dictionary transcoding on the thought structure data to obtain thought dictionary data; A list transcoding module, used for performing list transcoding on the thought dictionary data to obtain thought list data; The template parsing module is used to perform structural analysis on the pre-acquired table template to obtain table structure data; The data matching module is used to use the thought list data to perform data matching on the table structure data to obtain use case table data, and reorganize the use case table data into a use case table.
8. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the test case writing and conversion method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the test case writing and conversion method as described in any one of claims 1 to 6 is implemented.
10. A computer program, characterized in that When the program is executed by a processor, the test case writing and conversion method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Test case file conversion method and device and storage medium
CN111258903A
Automatic test case conversion method and device, electronic equipment and storage medium
CN113918455A
Test case format conversion method and device
CN114968810A
Format conversion method and device of test case document, computer equipment and storage medium
CN116126721A