Test case writing and conversion method, device, equipment, medium and program

By parsing data from mind mapping software and converting it to dictionaries and lists, combined with table template matching, the problem of low test case conversion efficiency was solved, and the standardization and consistency management of test cases were achieved, improving the accuracy and efficiency of conversion.

CN119759745BActive Publication Date: 2025-12-12CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311262787.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-12-12
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

Existing test case writing and conversion methods are based on fixed formats, which cannot accurately match diverse test case templates, resulting in low efficiency.

Method used

By parsing the thought structure data from mind mapping software, converting it into dictionary and list formats, and matching it with pre-acquired table templates, test case table data is generated, thereby achieving standardization and consistency of test cases.

Benefits of technology

It improves the accuracy and efficiency of test case conversion, reduces manual processing workload, ensures that information is accurately mapped to the corresponding fields, and facilitates test management and understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759745B_ABST
    Figure CN119759745B_ABST
Patent Text Reader

Abstract

The application relates to the field of software testing and provides a test case compiling and converting method, which comprises the following steps: obtaining a test case from mind mapping software, parsing mind structure data from the test case, performing dictionary conversion on the mind structure data to obtain mind dictionary data, performing list conversion on the mind dictionary data to obtain mind list data, performing structure analysis on a pre-acquired table template to obtain table structure data, performing data matching on the table structure data by using the mind list data to obtain case table data, and recombining the case table data into a case table. The application further provides a test case compiling and converting device, equipment, medium and program. The application can improve the efficiency of test case format conversion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software testing, and in particular to a test case writing and conversion method, device, equipment, medium and program. BACKGROUND

[0002] With the development of software and information industry, software testing for improving software quality has become an increasingly important field, and mind map as a widely used tool for thinking arrangement can provide clear hierarchical structure and correlation, which helps to organize and organize test cases. At present, it is widely used by many test teams to write test cases. However, the traditional test case is in word format or execl format, so the mind map needs to be written and converted into test cases.

[0003] The existing test case writing and conversion is mostly based on fixed format writing and conversion method, for example, writing and converting the mind map of Testlink format and Chan Dao format. In actual application, test cases need to be customized according to their own business, and the writing and conversion method based on fixed format cannot accurately match the templates of various test cases, which needs to be adjusted and input manually, resulting in low efficiency in test case conversion. SUMMARY

[0004] In view of the above problems, the embodiments of the present application provide a test case writing and conversion method, device, equipment, medium and program.

[0005] In a first aspect, the embodiments of the present application provide a test case writing and conversion method, comprising:

[0006] obtaining a test case from a mind map software, and parsing mind structure data from the test case;

[0007] performing dictionary conversion on the mind structure data to obtain mind dictionary data;

[0008] performing list conversion on the mind dictionary data to obtain mind list data;

[0009] performing structure analysis on a pre-obtained table template to obtain table structure data;

[0010] performing data matching on the table structure data by using the mind list data to obtain case table data, and recombining the case table data into a case table.

[0011] According to the embodiments of the present application, the mind structure data is parsed from the test case, comprising:

[0012] extracting a file root element from the test case;

[0013] performing a downward loop operation on the file root element to obtain a file element set and an element structure;

[0014] performing attribute analysis on each file element in the file element set to obtain element attributes;

[0015] generating thinking structure data according to the element structure and the element attributes.

[0016] According to an embodiment of the present application, the dictionary coding of the thinking structure data to obtain thinking dictionary data comprises:

[0017] splitting the thinking 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] performing nested key-value conversion on the internal node data in a recursive manner to obtain internal node dictionary data;

[0020] integrating the leaf node dictionary data and the internal node dictionary data into thinking dictionary data.

[0021] According to an embodiment of the present application, the list coding of the thinking dictionary data to obtain thinking list data comprises:

[0022] selecting dictionary data in the thinking dictionary data as target dictionary data one by one;

[0023] extracting target dictionary key and target dictionary value pairs from the target dictionary data respectively;

[0024] generating target list data according to the target dictionary key and the target dictionary value pairs, and integrating all target list data into thinking list data.

[0025] According to an embodiment of the present application, the structure analysis of the pre-acquired table template to obtain table structure data comprises:

[0026] performing list coding on the pre-acquired table template to obtain template list data;

[0027] selecting list data in the template list data as target structure list data one by one, and extracting target structure attributes of the target structure list data;

[0028] generating target structure data according to the target structure list data and the target structure attributes, and integrating all target structure data into table structure data.

[0029] According to an embodiment of the present application, the data matching of the table structure data by using the mind list data obtains use case table data, and the data matching comprises:

[0030] The structure data in the table structure data is selected as target structure data one by one, and target structure key data is extracted from the target structure data;

[0031] The key matching of the mind list data by using the target structure key data obtains matched list data;

[0032] The value replacement of the target structure data by using the matched list data obtains target table data;

[0033] All the target table data is integrated into use case table data.

[0034] In a second aspect, an embodiment of the present application provides a test case writing and conversion device, and the device comprises:

[0035] A mind map analysis module is configured to obtain a test case from a mind map software and analyze mind structure data from the test case;

[0036] A dictionary conversion module is configured to perform dictionary conversion on the mind structure data to obtain mind dictionary data;

[0037] A list conversion module is configured to perform list conversion on the mind dictionary data to obtain mind list data;

[0038] A template analysis module is configured to perform structure analysis on a pre-obtained table template to obtain table structure data;

[0039] A data matching module is configured to perform data matching of the table structure data by using the mind list data to obtain use case table data, and recombine the use case table data into a use case table.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, and the device comprises:

[0041] A processor;

[0042] A memory for storing instructions executable by the processor;

[0043] The processor is configured to execute the instructions to implement the test case writing and conversion method according to the first aspect.

[0044] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, and the program is executed by a processor to implement the test case writing and conversion method according to the first aspect.

[0045] In a fifth aspect, an embodiment of the present application provides a computer program, which, when executed by a processor, implements the test case writing and conversion method according to the first aspect.

[0046] Compared with the prior art, the above technical solution of the present application has the following beneficial effects:

[0047] The embodiment of the present application allows each enterprise or team to customize test case templates according to their own needs by performing structural analysis on the table templates, improves the standardization and consistency of test cases, and makes the test cases match specific business processes and requirements. The traversal node conversion method can improve the accuracy of conversion, ensure that all test case information can be correctly mapped to the corresponding fields, avoid information loss or inaccuracy, reduce the workload of manual processing and conversion, improve the work efficiency of the team, and realize the standardized management of test cases by converting them into a unified file format. This will help team members better understand and use test cases and provide consistent formats and structures for easy positioning and management of test items and test points. Therefore, the test case writing and conversion method, device and equipment provided by the present application can solve the problem of low efficiency in test case conversion. BRIEF DESCRIPTION OF DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0049] Figure 1 The working flowchart of the test case writing and conversion method of the embodiment one of the present application is shown;

[0050] Figure 2 The functional module diagram of the test case writing and conversion device of the embodiment two of the present application is shown;

[0051] Figure 3 The composition structure schematic diagram of the electronic device for implementing the test case writing and conversion method of the embodiment three of the present application is shown. DETAILED DESCRIPTION

[0052] The present disclosure will be further described below in conjunction with the embodiments shown in the drawings.

[0053] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0054] The application provides a test case writing and conversion based on a flow transcoding technology, and is based on a multi-level data format conversion method, extracts key values and structural attributes of a test case through a node traversal manner, and realizes rapid and accurate test case writing and conversion, and has application value in the field of software testing technologies.

[0055] Embodiment one

[0056] As shown in the figure, the application provides a test case writing and conversion method, including the following steps: Figure 1

[0057] S1, obtaining a test case from a mind map software, and parsing mind structure data from the test case.

[0058] In the embodiment of the application, the mind map software can be Mindmaster, MindManager or XMind, the mind map software can conveniently edit a mind map, the test case is the mind map for testing, the mind map is a tool for representing thoughts, ideas, concepts, tasks, plans or other information in a graphical manner, and is usually centered on a central theme, and is expanded through tree branches to present various associated sub-themes, keywords, relationships and branches, and the data format of the test case can be xmind or emmx.

[0059] In detail, the mind structure data contains the overall organization structure of the mind map, and displays themes, sub-themes, keywords and hierarchical relationships therebetween in a tree or branch structure, each node of the mind structure data can contain text, icons, colors and other elements, and is used for representing related information and attributes.

[0060] In the embodiment of the application, the parsing of the mind 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 analysis on each file element in the file element set to obtain element attributes;

[0064] generating mind structure data according to the element structure and the element attributes.

[0065] ​In detail, a file root element can be extracted from the test case by using a tree.getroot function of ElementTree, the file root element is a starting point of the test case and is a root node in the mind map, a down loop operation can be performed on the file root element by using an iter function to obtain a file element set and an element structure, the file element set is elements in the test case, including the file root element and a file sub-element, the file sub-element is a sub-node in the mind map, and the element structure is an overall file structure of the mind map and position data of each node.

[0066] Specifically, an attribute analysis can be performed on each file element in the file element set by using a find function or a findall function to obtain element attributes, the element attributes include a label and a value attribute of each element in each file element in the file element set, and the generation of the mind structure data according to the element structure and the element attributes means that the position data of each element in the element structure is added to corresponding element data in the element attributes, and the mind structure data contains position structure, value, data type and data attribute of each element data in the test case.

[0067] In the embodiment of the application, the test case is obtained from the mind map software, and the mind structure data is parsed from the test case, so that the file format inherent in the mind map software can be converted into a data structure and data attributes stored in a general format, facilitating conversion and operation of the test case data.

[0068] S2, dictionary conversion is performed on the mind structure data to obtain mind dictionary data.

[0069] In the embodiment of the application, the mind dictionary data is mind structure data stored in a dictionary format, the dictionary format can be a dict format of python, a json format of Java, a YAML format (YAML Ain't Markup Language) or a TOML format (Tom's Obvious, Minimal Language), in order to facilitate computer recognition and operation of the mind structure data, the mind structure data needs to be converted into dictionary data.

[0070] In the embodiment of the application, the dictionary conversion of the mind structure data to obtain the mind dictionary data comprises:

[0071] The mind structure data is split into internal node data and leaf node data;

[0072] The leaf node data is converted into key-value to obtain leaf node dictionary data;

[0073] The internal node data is converted into internal node dictionary data by using a recursive manner to perform nested key-value conversion on the internal node data.

[0074] The leaf node dictionary data and the internal node dictionary data are integrated into thought dictionary data.

[0075] In detail, the internal node data refers to a file element in the thought structure data that has a file sub-element, the leaf node data refers to a file element in the thought structure data that does not have a file sub-element, and the internal node data has a nested relationship due to the presence of the file sub-element, and therefore needs 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 sub-node 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, and the attrib attribute in the file element can be updated into the corresponding key-value pair by using an update function.

[0077] In the embodiment of the application, the thought dictionary data is obtained by performing dictionary conversion on the thought structure data, the nested structure between the file elements in the thought structure data can be removed, subsequent table format conversion is facilitated, the hierarchical structure and attribute information of the text element are retained by using the leaf node data and the internal node data to be converted respectively, and subsequent corresponding matching is facilitated.

[0078] S3, list conversion is performed on the thought dictionary data to obtain thought list data.

[0079] In the embodiment of the application, the thought list data is thought dictionary data stored in a list format, and the list format can be a list format or a linked list format. By converting the thought dictionary data into thought list data, the data can be made more flat, data iteration and processing are facilitated, and subsequent conversion into table format data is facilitated.

[0080] In the embodiment of the application, the list conversion of the thought dictionary data to obtain thought list data includes:

[0081] The dictionary data in the thought dictionary data is selected one by one as target dictionary data;

[0082] The target dictionary key and the target dictionary value pair are extracted from the target dictionary data, respectively;

[0083] The target list data is generated according to the target dictionary key and the target dictionary value pair, and all the target list data is integrated 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 in the dictionary for identifying and accessing values, can be any immutable data type, usually a string, an integer, a floating point number or a tuple, each key is unique in the dictionary and has uniqueness, and the target dictionary value pair refers to the value of the target dictionary data, the value is 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 string, integer, floating point number, list, dictionary and the like.

[0085] In detail, the target dictionary key can be extracted from the target dictionary data by using the keys function, the target dictionary value pair can be extracted from the target dictionary data by using the values function or the target dictionary key and the target dictionary value pair can be extracted from the target dictionary data by using the items function respectively, and the target list data generated according to the target dictionary key and the target dictionary value refers to that the target dictionary key is taken as the key of the target list data, and the target dictionary value pair is taken as the value of the target list to obtain the target list data.

[0086] In the embodiment of the application, the thought dictionary data is converted into list code to obtain thought list data, so that the data is more flattened, more compact and easier to process, and the data is also convenient for sorting and screening, and is also easier to be converted into list format data.

[0087] S4, structure analysis is performed on the pre-acquired table template to obtain table structure data.

[0088] In the embodiment of the application, the table template refers to a template file of a file format to be converted, the table template can be an xls format table file, the table structure data includes test case ID, requirement correspondence, function number, premise condition, test purpose, test step, test data, expected result, whether passed, writer and the like, the format and field attribute of the table template can be customized according to the self needs of each structure and organization, which will improve the standardization and consistency of the test case, and make the test case match a specific business process and requirement.

[0089] In the embodiment of the application, the structure analysis is performed on the pre-acquired table template to obtain table structure data, including:

[0090] List code conversion is performed on the pre-acquired table template to obtain template list data;

[0091] The list data in the template list data is selected as target structure list data one by one, and the target structure attribute of the target structure list data is extracted.

[0092] According to the target structure list data and the target structure attribute, target structure data is generated, and all target structure data is collected into table structure data.

[0093] In detail, the pre-acquired table template can be converted into a list by using the xlrd library of python to obtain template list data, the target structure attribute refers to the structure attribute of the target structure list data in the table template, for example, row number information, column number information, cell type and table cell, the target structure attribute of the target structure list data can be extracted by using the traversal unlocking mode, and the target structure data is generated according to the target structure list data and the target structure attribute, that is, the target structure attribute is added to the target structure list data as a key value to obtain the target structure data.

[0094] In the embodiment of the application, the table structure data is obtained by performing structure analysis on the pre-acquired table template, the table structure and cell attribute of the table template can be parsed, and then the subsequent data matching operation is facilitated.

[0095] S5, data matching is performed on the table structure data by using the thought list data to obtain use case table data, and the use case table data is reorganized into a use case table.

[0096] In the embodiment of the application, the use case table data refers to data in the format of table structure data containing thought list data, and the use case table data can be in the format of list.

[0097] In the embodiment of the application, the use case table data is obtained by performing data matching on the table structure data by using the thought list data, and the use case table data is reorganized into a use case table.

[0098] The structure data in the table structure data is selected as target structure data one by one, and target structure key data is extracted from the target structure data;

[0099] The thought list data is key matched by using the target structure key data to obtain matching list data;

[0100] The target structure data is value replaced by using the matching list data to obtain target table data;

[0101] All target table data is collected into use case table data.

[0102] In detail, the target structure key data refers to a key of the target structure data, for example, a test case ID, the key matching of the mind list data by using the target structure key data refers to matching the key of each list data of the mind list data by using the target structure key data, and taking the list data with a matching success as the matching list data.

[0103] Specifically, the value replacement of the target structure data by using the matching list data to obtain target table data refers to replacing the part of blank values of the target structure data by using the values of the matching list data, and the values refer to node values of the mind map, for example, expected result 1, expected result 2, etc., and the use case table data can be reorganized into a use case table by using the xlwt library of python.

[0104] In the embodiment of the application, the use case table data is obtained by data matching of the table structure data by using the mind list data, and the use case table data is reorganized into a use case table, the mind map can be converted into a table format convenient for saving, and the subsequent software testing efficiency is improved, meanwhile, the data accuracy during the format conversion of the test case is ensured, and the efficiency of the test case conversion is improved.

[0105] The embodiment of the application can convert the file format inherent in the mind map software into a data structure and data attribute stored in a general format, facilitate the conversion and operation of the test case data, remove the nested structure between file elements in the mind structure data by dictionary transcoding of the mind structure data to obtain mind dictionary data, facilitate the subsequent conversion of the table format, retain the hierarchical structure and attribute information of the text element by using the leaf node data and the internal node data respectively, facilitate the subsequent corresponding matching, make the data more flat and compact and easier to process by listing the mind dictionary data to obtain mind list data, facilitate the sorting and screening of the data, and also make it easier to convert into a list format data, parse the table structure and cell attribute of the table template by structure parsing of the pre-acquired table template to obtain table structure data, facilitate the subsequent data matching operation, convert the mind map into a table format convenient for saving by data matching of the table structure data by using the mind list data to obtain use case table data, reorganize the use case table data into a use case table, improve the subsequent software testing efficiency, meanwhile, ensure the data accuracy during the format conversion of the test case, and improve the efficiency of the test case conversion, therefore, the test case writing and conversion method provided by the application can solve the problem of low efficiency during the format conversion of the test case.

[0106] Embodiment Two

[0107] As Figure 2 shown, the embodiment also provides a function module diagram of a test case writing and conversion device.

[0108] The test case writing and conversion device 100 described in the embodiment can be installed in an electronic device. According to the implemented functions, the test case writing and conversion device 100 can include a mind 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 modules described in the present application can also be referred to as units, which refer to a series of computer program segments that can be executed by an electronic device processor and can complete a fixed function, which are stored in the memory of the electronic device.

[0109] In the embodiment, the functions of each module / unit are as follows:

[0110] The mind map parsing module 101 is configured to obtain a test case from a mind map software and parse mind structure data from the test case.

[0111] The dictionary transcoding module 102 is configured to perform dictionary transcoding on the mind structure data to obtain mind dictionary data.

[0112] The list transcoding module 103 is configured to perform list transcoding on the mind dictionary data to obtain mind list data.

[0113] The template parsing module 104 is configured to perform structural parsing on a pre-obtained table template to obtain table structure data.

[0114] The data matching module 105 is configured to perform data matching on the table structure data using the mind list data to obtain case table data, and reorganize the case table data into a case table.

[0115] In detail, each module in the test case writing and conversion device 100 described in the embodiment uses the same technical means as the test case writing and conversion method described in Embodiment One, and can produce the same technical effects. Therefore, no further description is given here.

[0116] Embodiment Three

[0117] As Figure 3 shown, the embodiment also provides a computer electronic device, which can include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and can also include a computer program, such as a test case writing and conversion program, stored in the memory 11 and executable on the processor 10.

[0118] The processor 10 may, in some embodiments, be composed of integrated circuits, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits of the same or different functions, including one or more combinations of central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, and connects various components of the electronic device through various interfaces and lines, executes programs or modules stored in the memory 11 (for example, a product recommendation program based on user portrait), and calls data stored in the memory 11, to perform various functions and process data of the electronic device.

[0119] The memory 11 includes at least one type of readable storage medium, including 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 magnetic disk, an optical disk, etc. The memory 11 may, in some embodiments, be an internal storage unit of the electronic device, for example, a mobile hard disk of the electronic device. The memory 11 may, in other embodiments, also be an external storage device of the electronic device, for example, a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 11 may include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used not only to store application software and various data installed in the electronic device, for example, codes of a product recommendation program based on user portrait, but also to temporarily store data that has been or will be output.

[0120] The communication bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize the connection and communication between the memory 11, the processor 10, etc.

[0121] The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the electronic device and other electronic devices. The user interface can be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display information processed in the electronic device and to display a visualized user interface.

[0122] Only the electronic device with components is shown in the figure, and those skilled in the art can understand that the structure shown in the figure does not constitute a limitation on the electronic device, and can include fewer or more components than the figure, or combine certain components, or different component arrangements.

[0123] For example, although not shown, the electronic device can also include a power supply (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so as to realize functions such as charge management, discharge management, and power consumption management through the power management device. The power supply can also include one or more direct current or alternating current power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device can also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which are not described here.

[0124] It should be understood that the embodiments are only for illustration and are not limited in the scope of the patent application by this structure.

[0125] The product recommendation program based on the user portrait stored in the memory 11 in the electronic device is a combination of multiple instructions, which, when running in the processor 10, can realize:

[0126] Obtain test cases from the mind mapping software, and parse mind structure data from the test cases;

[0127] Dictionary transcoding is performed on the mind structure data to obtain mind dictionary data;

[0128] List transcoding is performed on the mind dictionary data to obtain mind list data;

[0129] Structural analysis is performed on the pre-acquired table template to obtain table structure data;

[0130] Data matching is performed on the table structure data by using the thought 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 on the above instructions can refer to the description of the related steps in the corresponding embodiments of the drawings, which will not be described here.

[0132] Further, the modules / units integrated in the electronic device, if realized in the form of software function units and sold or used as independent products, 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 can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).

[0133] Embodiment four

[0134] The embodiment provides a storage medium storing a computer program, the computer program being executed by a processor to implement the steps of the test case writing and conversion method described above.

[0135] These program codes can also be loaded onto a computer or other programmable data processing device to cause a series of operation steps to be performed on the computer or other programmable device to generate a computer implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the flow Figure 1 In one flow or multiple flows.

[0136] The storage medium includes permanent and non-permanent, removable and non-removable media, and can be realized by any method or technology. Information can be computer readable instructions, data structures, program modules 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0137] Embodiment five

[0138] The embodiment of the present application provides a computer program, which, when executed by a processor, implements steps of a test case writing and conversion method according to the first aspect.

[0139] The computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. The computer readable program instructions can also be stored in a computer readable storage medium that can include a non-exhaustive list of media including: semiconductor memories, ohc magnetic disks, and optical disks, etc. The computer readable storage medium can also be a machine readable storage medium, a machine readable storage device, a machine readable storage medium device, or a machine readable storage medium, etc.

[0140] It should be noted that the terms used herein are only used to describe specific embodiments and are not intended to limit the exemplary embodiments according to the present application. When the terms "comprise" and / or "include" are used in the specification, it means that there is a feature, step, operation, device, component, and / or combination thereof.

[0141] It should be understood that the terms used herein can be interchanged as appropriate, so that the embodiments of the present application described herein can be implemented in other than the order illustrated or described herein.

[0142] In several embodiments provided by the present application, 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 merely illustrative, and the division of the modules is merely a logical function division, and actual implementation can have another division manner.

[0143] The modules described as separate components can or can not be physically separated, and the components shown as modules can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0144] In addition, the function modules in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function modules.

[0145] It is apparent for a person skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that it can be implemented in other concrete forms without departing from the spirit or essential characteristics of the application.

[0146] Therefore, the embodiments should be considered in all respects as illustrative and not restrictive, the scope of the application being defined by the appended claims rather than the above description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. No reference signs in the claims shall be construed as limiting the claim being referred to.

[0147] Embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (AI) is to use digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, obtain 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. The plurality of units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names and not to indicate any particular order.

[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limit the present application, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A test case authoring and conversion method, characterized by, The method comprises: obtaining a test case from mind mapping software, and parsing mind structure data from the test case; performing dictionary conversion on the mind structure data to obtain mind dictionary data; performing list conversion on the mind dictionary data to obtain mind list data; performing structural analysis on a pre-obtained table template to obtain table structure data; performing data matching on the table structure data by using the mind list data to obtain case table data, and recombining the case table data into a case table; the parsing of the mind structure data from the test case comprises: 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 analysis on each file element in the file element set to obtain element attributes; generating mind structure data according to the element structure and the element attributes; the dictionary conversion of the mind structure data to obtain mind dictionary data comprises: splitting the mind 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; performing nested key-value conversion on the internal node data in a recursive manner to obtain internal node dictionary data; integrating the leaf node dictionary data and the internal node dictionary data into mind dictionary data.

2. The test case authoring and translation method of claim 1, wherein, the list conversion of the mind dictionary data to obtain mind list data comprises: selecting dictionary data in the mind dictionary data as target dictionary data one by one; extracting target dictionary key and target dictionary value pairs from the target dictionary data, respectively; generating target list data according to the target dictionary key and the target dictionary value pairs, and integrating all target list data into mind list data.

3. The test case authoring and translation method of claim 1, wherein, the structural analysis of the pre-obtained table template to obtain table structure data comprises: performing list conversion on the pre-obtained table template to obtain template list data; selecting list data in the template list data as target structure list data one by one, and extracting target structure attributes of the target structure list data; generating target structure data according to the target structure list data and the target structure attributes, and integrating all target structure data into table structure data.

4. The test case authoring and translation method of claim 1, wherein, the data matching of the table structure data by using the mind list data to obtain case table data comprises: selecting structure data in the table structure data as target structure data one by one, and extracting target structure key data from the target structure data; performing key matching on the mind list data by using the target structure key data to obtain matching list data; performing value replacement on the target structure data by using the matching list data to obtain target table data; integrating all target table data into case table data.

5. A test case writing and converting apparatus for implementing the test case writing and converting method of any one of claims 1 to 4, characterized by, The device comprises: a mind map analysis module configured to obtain a test case from mind mapping software, and parse mind structure data from the test case; a dictionary conversion module configured to perform dictionary conversion on the mind structure data to obtain mind dictionary data; a list conversion module configured to perform list conversion on the mind dictionary data to obtain mind list data; a list transcoding module, configured to perform list transcoding on the thought dictionary data to obtain thought list data; a template parsing module, configured to perform structural parsing on a pre-acquired table template to obtain table structure data; a data matching module, configured to perform data matching on the table structure data by using the thought list data to obtain use case table data, and reorganize the use case table data into a use case table. 6.An electronic device comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the test case authoring and conversion method of any one of claims 1 to 4.

7. A computer readable storage medium characterized by a computer program stored thereon, which, when executed by a processor, implements the test case authoring and conversion method of any one of claims 1 to 4.

8. A computer program, characterized in that, the program, when executed by a processor, implements the test case authoring and conversion method of any one of claims 1 to 4.

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