Test case generation method and device, storage medium and electronic equipment
By constructing the system function tree and page component information, a function tree for the trusted innovation transformation is generated, which solves the problem of low efficiency in generating test cases for the trusted innovation transformation and realizes efficient and accurate automatic generation of test cases.
Patent Information
- Application Number
- CN202510755432.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-09-12
AI Technical Summary
The existing technology has low efficiency in generating test cases for Xinchuang transformation and is prone to typos or missing elements, which affects the quality of test cases.
By constructing the system function tree and page component information, a trusted innovation transformation function tree is generated, and a test case set is generated according to preset rules, including determining the target test configuration parameters, obtaining page component information, building a function tree, and generating a test case set.
The efficiency and accuracy of generating test cases for information technology transformation have been improved, and the automatic generation of function trees and the automated construction of test cases have been realized.
Smart Images

Figure CN120631768A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and specifically, to a test case generation method and device, a storage medium and an electronic device. Background Art
[0002] The transformation of information technology innovation refers to the transformation and upgrading of the information technology application innovation industry. The localization of information system transformation includes the replacement of basic hardware, basic software (operating systems, application middleware, databases, etc.), office software, terminal peripherals, and the basic hardware and software that the information system relies on with information technology products and related adaptation and transformation. The testing of information technology transformation requires the preparation of a test plan in conjunction with the implementation plan of the information technology system. In the plan, the test risks and dependencies should be identified, the test scope, test content and test methods should be clarified, the test objectives and test plans should be formulated, and test cases should be written and executed according to the test plan to verify the functional adaptation of the information technology system. A test case refers to a description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, step description, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special purpose, used to verify whether a specific software requirement is met.
[0003] In the existing technology, the test case generation solution for the information technology transformation mainly adopts the manual method to write the information technology transformation test cases. This method not only consumes a lot of time, but also manual writing is prone to typos or omissions of elements, thus affecting the quality of the test cases.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The main purpose of this application is to provide a test case generation method and device, storage medium and electronic device to solve the problem of low efficiency in generating test cases for information technology transformation in related technologies.
[0006] To achieve the above-mentioned objectives, according to one aspect of the present application, a test case generation method is provided. The method comprises: determining target test configuration parameters based on an ICT transformation information system and a reference system corresponding to the ICT transformation information system, and constructing a system function tree based on the target test configuration parameters; obtaining page component information of the ICT transformation information system, and constructing an ICT transformation function tree based on the system function tree and the page component information; and generating a test case set corresponding to the ICT transformation function tree based on preset rules.
[0007] Furthermore, determining the target test configuration parameters based on the credible innovation transformation information system and the reference system corresponding to the credible innovation transformation information system includes: receiving the first test configuration parameters of the credible innovation transformation information system, wherein the first test configuration parameters include adaptation type, verification element, and compatible browser; receiving the functional configuration in the reference system corresponding to the credible innovation transformation information system, and determining the second test configuration parameters based on the functional configuration, wherein the second test configuration parameters include operation mode and step description; determining the target test configuration parameters based on the first test configuration parameters and the second test configuration parameters.
[0008] Furthermore, the page component information is the page program source code, and the page program source code includes multiple tags and code indentation rules. Constructing the trusted innovation transformation function tree based on the system function tree and the page component information includes: determining the label arrangement information of multiple levels corresponding to the page program source code based on multiple tags and code indentation rules; recombining the label arrangement information of multiple levels based on the system function tree to obtain multiple node data; receiving use case requirements, and constructing the trusted innovation transformation function tree based on the use case requirements and multiple node data.
[0009] Furthermore, the types of use case requirements include first-class use case requirements and second-class use case requirements. The first-class use case requirements include multiple first-class use case requirement contents and multiple node data corresponding to the first-class use case requirement contents. The second-class use case requirements include second-class use case requirement contents. Constructing the information and innovation transformation function tree based on the use case requirements and multiple node data includes: initializing the tree structure to obtain an initial tree; if the use case requirement corresponding to the node data is a first-class use case requirement, then adding the node data to the corresponding position in the initial tree, and adding the first-class use case requirement content corresponding to the node data to the child node of the node data in the initial tree; if the use case requirement corresponding to the node data is a second-class use case requirement, then directly adding the node data to the corresponding position in the initial tree; detecting the first-class use case requirement content in the initial tree after adding all node data, if the first-class use case requirement content of the child node is the same as that of the parent node, then deleting the first-class use case requirement content of the child node to obtain the information and innovation transformation function tree.
[0010] Furthermore, generating a test case set corresponding to the ICT transformation function tree according to preset rules includes: extracting all test case paths in the ICT transformation function tree, wherein each test case path includes all nodes from a root node to the corresponding end node; performing string concatenation on each test case path according to the second type of use case requirements to determine the corresponding test case; and determining a test case set based on all test cases.
[0011] Furthermore, after generating a set of test cases corresponding to the trusted innovation transformation function tree according to preset rules, the method also includes: detecting the code repository corresponding to the page component information, and determining the layout update data of the page component information; updating the trusted innovation transformation function tree according to the layout update data; and generating a new set of test cases using the updated trusted innovation transformation function tree and preset rules.
[0012] Furthermore, updating the credible innovation transformation function tree based on the layout update data includes: determining the target update path corresponding to the credible innovation transformation function tree based on the layout update data; updating the credible innovation transformation function tree based on the target update path to obtain an updated credible innovation transformation function tree.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a test case generation device is provided, including: a system parameter unit, used to determine the target test configuration parameters based on the credible innovation transformation information system and the reference system corresponding to the credible innovation transformation information system, and construct a system function tree based on the target test configuration parameters; a function extraction unit, used to obtain the page component information of the credible innovation transformation information system, and construct the credible innovation transformation function tree based on the system function tree and the page component information; a use case generation unit, used to generate a test case set corresponding to the credible innovation transformation function tree according to preset rules.
[0014] Furthermore, the system parameter unit includes: a first parameter module for receiving the first test configuration parameters of the information system for information innovation and transformation, wherein the first test configuration parameters include adaptation type, verification element, and compatible browser; a second parameter module for receiving the functional configuration in the reference system corresponding to the information system for information innovation and transformation, and determining the second test configuration parameters based on the functional configuration, wherein the second test configuration parameters include operation mode and step description; a parameter synthesis module for determining the target test configuration parameters based on the first test configuration parameters and the second test configuration parameters.
[0015] Furthermore, the page component information is the page program source code, which includes multiple tags and code indentation rules. The function extraction unit includes: an information extraction module, which is used to determine the label arrangement information of multiple levels corresponding to the page program source code based on multiple tags and code indentation rules; a node determination module, which is used to recombine the label arrangement information of multiple levels based on the system function tree to obtain multiple node data; a function tree generation module, which is used to receive use case requirements and construct a trusted innovation transformation function tree based on the use case requirements and multiple node data.
[0016] Furthermore, the types of use case requirements include first-class use case requirements and second-class use case requirements. The first-class use case requirements include multiple first-class use case requirement contents and multiple node data corresponding to the first-class use case requirement contents. The second-class use case requirements include second-class use case requirement contents. The function tree generation module includes: a first sub-module, used to initialize the tree structure to obtain an initial tree; a second sub-module, used to add the node data to the corresponding position in the initial tree if the use case requirement corresponding to the node data is a first-class use case requirement, and add the first-class use case requirement content corresponding to the node data to the child node of the node data in the initial tree; a third sub-module, used to directly add the node data to the corresponding position in the initial tree if the use case requirement corresponding to the node data is a second-class use case requirement; a fourth sub-module, used to detect the first-class use case requirement content in the initial tree after adding all node data. If the first-class use case requirement content of the child node is the same as that of the parent node, the first-class use case requirement content of the child node is deleted to obtain the information innovation transformation function tree.
[0017] Furthermore, the use case generation unit includes: a path extraction module, which is used to extract all test case paths in the ICT transformation function tree, wherein each test case path includes all nodes from a root node to the corresponding end node; a path splicing module, which is used to perform string splicing on each test case path according to the second type of use case requirements to determine the corresponding test case; and a set generation module, which is used to determine the test case set based on all test cases.
[0018] Furthermore, the device also includes: a warehouse detection unit, which is used to detect the code warehouse corresponding to the page component information after generating a set of test cases corresponding to the credible innovation transformation function tree according to preset rules, and determine the layout update data of the page component information; a tree update unit, which is used to update the credible innovation transformation function tree according to the layout update data; and a use case update unit, which is used to generate a new set of test cases using the updated credible innovation transformation function tree and preset rules.
[0019] Furthermore, the tree update unit includes: a target extraction module, which is used to determine the target update path corresponding to the ICT transformation function tree based on the layout update data; a node update module, which is used to update the ICT transformation function tree based on the target update path to obtain an updated ICT transformation function tree.
[0020] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, the storage medium including a stored program, wherein the program executes any one of the above-mentioned test case generation methods.
[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, which includes one or more processors and a memory, and the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned test case generation methods.
[0022] Through this application, the following steps are adopted: determine the target test configuration parameters based on the trusted innovation transformation information system and the reference system corresponding to the trusted innovation transformation information system, and build a system function tree based on the target test configuration parameters; obtain the page component information of the trusted innovation transformation information system, and build a trusted innovation transformation function tree based on the system function tree and the page component information; generate a set of test cases corresponding to the trusted innovation transformation function tree according to preset rules, and solve the problem of low efficiency in generating trusted innovation transformation test cases in related technologies. By generating a system function tree and generating a trusted innovation transformation function tree in combination with page components, the automatic generation of the trusted innovation transformation function tree is realized, and then a set of test cases corresponding to the trusted innovation transformation function tree is generated according to preset rules, which improves the generation efficiency of trusted innovation transformation test cases. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0024] Figure 1 This is a flow chart of a test case generation method according to an embodiment of the present application;
[0025] Figure 2 is a schematic diagram of a test case generation device provided according to an embodiment of the present application;
[0026] Figure 3 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation portals for users to choose to agree or refuse the automated decision-making results; if the user chooses to refuse, the expert decision-making process will be entered.
[0031] The present invention will be described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of a test case generation method according to an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps:
[0032] Step S101, determine the target test configuration parameters based on the trusted innovation transformation information system and the reference system corresponding to the trusted innovation transformation information system, and construct a system function tree based on the target test configuration parameters.
[0033] Optionally, the target test configuration parameters are used to cover the test scope generated by the test case. The reference system corresponding to the information system for information technology transformation introduces comprehensive functions. The system function specification of the information system for information technology transformation can be obtained, and compared and screened in the reference system according to the system function specification to obtain the target test configuration parameters. The target test configuration parameters may include functional modules, adaptation types, compatibility requirements, and verification element requirements for web page components at different levels. The system function tree is used to store the target test configuration parameters in a tree structure. The levels of the nodes in the tree structure are different, representing the target test configuration parameters at different levels.
[0034] For example, the system function tree can have multiple levels of web component verification element requirements. The first level consists of two nodes: Verification Element - Menu - Document Management and Verification Element - Menu - Backstage Management. Each node's child nodes can represent verification element requirements for web components at a deeper level. By progressively advancing through the nodes, it is possible to describe comprehensive target test configuration parameters within the system function tree. The child node of "Verification Element - Menu - Document Management" is "Verification Element - Menu - New Document," and the child node of "Verification Element - Menu - New Document" is "Verification Element - Page - Document Approval Form." "Verification Element - Page - Document Approval Form" can have two child nodes: "Verification Element - Button - Urgency" and "Verification Element - Button - Upload Text." "Verification Element - Menu - Document Management" and its child nodes implement verification element requirements for multiple levels of web components, extending from menus to pages and then to buttons.
[0035] Step S102: obtain the page component information of the information system for information innovation and transformation, and construct the information innovation and transformation function tree based on the system function tree and the page component information.
[0036] Optionally, the page component information can be the page program source code or web page source code of the trusted innovation transformation information system, and any front-end layout label in the page program source code represents a functional element of the trusted innovation transformation information system, and the page component information represents the complete functional element of the trusted innovation transformation information system. All page component information can be obtained, and the labels in the page component information can be associated with the system function tree to construct the trusted innovation transformation function tree. The above-mentioned label association method can be to find the relevant node according to the id of the label, and associate the label and the next layer of labels of the label to the relevant node; if the relevant node of the label is not found, the label is deleted. The parent node is the upper layer node of the child node, and the root node in the trusted innovation transformation function tree is the top node. The above-mentioned construction method of the trusted innovation transformation function tree can automatically and efficiently migrate the page component information to the system function tree, retain the information related to the system function tree in the page component information, and filter out the information in the page component information that is not related to the system function tree. The child nodes of each node in the ICT transformation function tree can also include use case type nodes, prerequisite nodes, priority nodes, step description nodes, expected result nodes and creator nodes. The contents of these nodes can be associated by reading preset configuration files (for example, part of the data in the preset configuration file is verification element-menu-document management: the priority is high, then a new child node can be added under the corresponding node "Verification element-menu-document management", and the child node data is "high priority").
[0037] For example, the node "Verification Element-Page-Document Approval Form" in the system function tree can have two child nodes, namely "Verification Element-Button-Urgency" and "Verification Element-Button-Upload Text"; the id information of a label in the page component information is Document Approval Form (the id information can be the English translation of Document Approval Form, and the label can be associated with the node based on the translation information), and the label with the id of Document Approval Form in the page component information includes three labels at the next level: Button-Urgency, Button-Upload Text, Button-Select Co-signing Unit; at this time, Button-Select Co-signing Unit can be associated with the node "Verification Element-Page-Document Approval Form" in the system function tree, and the number of child nodes of the node "Verification Element-Page-Document Approval Form" changes to 3: "Verification Element-Button-Urgency", "Verification Element-Button-Upload Text", and "Verification Element-Button-Select Co-signing Unit".
[0038] Step S103: Generate a set of test cases corresponding to the trusted innovation transformation function tree based on preset rules.
[0039] Optionally, the test case set includes multiple test cases, and the content of each test case may include the case name, case type, precondition, priority, step description, expected result and creator. The content in the test case can be obtained by splicing the nodes in the trust innovation transformation tree. The splicing method can be string splicing, and the splicing position can be splicing from the root node to the child node. Separators can also be set when splicing strings of different nodes, and duplicate strings can be deleted when splicing strings.
[0040] For example, the root node in the ICT transformation function tree is "Module-Document Management", and the child node of the root node is "Adaptation Type-System Function Page", the child node of "Adaptation Type-System Function Page" is "Verification Element-Menu-Document Management", the child node of "Verification Element-Menu-Document Management" is "Verification Element-Menu-New Document", the child node of "Verification Element-Menu-New Document" is "Verification Element-Page-Document Approval Form", and the child node of "Verification Element-Page-Document Approval Form" is "Verification Element-Button-Urgency". Strings can be concatenated starting from the root node in the direction of the node relationship to the lower-level child nodes. In the above concatenation process, "Adaptation Type" and "Verification Element" can be deleted, and ", normal function" can be added to the end of the concatenated string to obtain the test case name "Module-Document Management-System Function Page Adaptation-Menu-Document Management-Menu-New Document-Page-Document Approval Form-Button-Urgency, normal function", and the separator "-" can also be changed to other separators (for example, ":"). During the above splicing process, nodes containing "verification elements" can be screened out, and the content after the last delimiter of each node and the content between the last delimiter and the second-to-last delimiter can be reverse-spliced (for example, the node verification element - menu - official document management, after reverse splicing, the official document management menu is obtained). The "click" string is added before the reverse-spliced results of all nodes to obtain a single step. By combining all the single steps, a test case step description can be obtained, such as "click the official document management menu, click the new official document menu, click the official document approval form page, and click the urgency button." The "normal" string can also be added after the reverse-spliced results of all nodes to obtain a single expected result. By combining all the single expected results, the test case expected result "official document management menu is normal, new official document menu is normal, official document approval form page is normal, and urgency button is normal" can be obtained. Those skilled in the art can select appropriate strings to add to splice the content of the test case.
[0041] To sum up, by generating a system function tree and combining it with page components to generate a trusted innovation transformation function tree, the automatic generation of the trusted innovation transformation function tree is achieved, and then a set of test cases corresponding to the trusted innovation transformation function tree is generated according to preset rules, thereby improving the generation efficiency of trusted innovation transformation test cases.
[0042] In order to improve the efficiency of determining the test configuration parameters, optionally, determining the target test configuration parameters based on the trusted innovation transformation information system and the reference system corresponding to the trusted innovation transformation information system includes: receiving the first test configuration parameters of the trusted innovation transformation information system, wherein the first test configuration parameters include the adaptation type, verification elements, and compatible browsers; receiving the functional configuration in the reference system corresponding to the trusted innovation transformation information system, and determining the second test configuration parameters based on the functional configuration, wherein the second test configuration parameters include the operation mode and step description; determining the target test configuration parameters based on the first test configuration parameters and the second test configuration parameters.
[0043] For example, the adaptation type, verification element and compatible browser can be used as the first test configuration parameter. The adaptation type can include system function page adaptation, system interaction adaptation, scheduled task adaptation and data migration, which are used to characterize the types that need to be adapted in the information innovation transformation system; verification elements can include menus, pages, windows, buttons and links, which are used to characterize the functions to be tested; compatible browsers can be different browser types set by technical personnel in this field according to needs. Functional configurations can be extracted from the reference system (that is, the original system), and the operation mode and step description can be determined based on these functional configurations. The first test configuration parameters are used as a supplement to the first test configuration parameters to ensure the comprehensiveness of the test coverage. Based on the first test configuration parameters and the second test configuration parameters, the target test configuration parameters are determined, which can be a combination of the first test configuration parameters and the second test configuration parameters as the target test configuration parameters.
[0044] In summary, generating the target test configuration parameters through the first test configuration parameters and the second test configuration parameters not only covers the key functional adaptation, but also accurately maps the operation mode and step description of the original system, ensuring the comprehensiveness and effectiveness of the test and improving the efficiency of determining the test parameters.
[0045] In order to improve the efficiency of test case generation, optionally, the page component information is the page program source code, the page program source code includes multiple tags and code indentation rules, and constructing the trusted innovation transformation function tree based on the system function tree and the page component information includes: determining the label arrangement information of multiple levels corresponding to the page program source code based on multiple tags and code indentation rules; recombining the label arrangement information of multiple levels based on the system function tree to obtain multiple node data; receiving use case requirements, and constructing the trusted innovation transformation function tree based on the use case requirements and multiple node data.
[0046] For example, a regular expression can be used to analyze the page program source code to identify tags (such as div, span and other elements), and the hierarchical relationship and nested structure between tags can be determined through code indentation rules, and the hierarchical relationship and nested structure between tags can be used as tag arrangement information (for example, part of the tag arrangement information is that the button tag is nested in the div tag). Recombining the tag arrangement information of multiple levels according to the system function tree can be to filter the tag arrangement information according to the data of the system function tree. The filtering method can be tag association. The tag association can be to find the relevant node according to the tag id, and associate the tag and the next layer of tags to the relevant node; if the relevant node of the tag is not found, the tag is deleted, that is, if a tag exists in the system function tree, the tag and all the lower-level tags of the tag are all migrated to the system function tree (which can be mounted under the corresponding data). If a tag and all the upper-level tags of the tag do not exist in the system function tree, the tag is discarded, thereby obtaining multiple node data. Receive use case requirements. Test case requirements are used to add attributes to node data (for example, attributes may include preconditions, priorities, step descriptions, expected results, and creators) to ensure that the functional tree can fully cover the test requirements. The use case requirements and node data can be integrated together to obtain all trusted innovation transformation nodes, and all trusted innovation transformation nodes can be organized into a tree structure to realize the automated construction of the trusted innovation transformation functional tree.
[0047] In summary, by determining the label arrangement information based on the existing page program source code, filtering the label arrangement information according to the system function tree to determine the node data, and receiving the use case requirements to realize the attributes of the node data, the information innovation transformation function tree is quickly constructed, which improves the efficiency of test case generation.
[0048] In order to improve the efficiency of test case generation, optionally, the types of use case requirements include first-class use case requirements and second-class use case requirements, the first-class use case requirements include multiple first-class use case requirement contents and multiple node data corresponding to the first-class use case requirement contents, and the second-class use case requirements include second-class use case requirement contents. Constructing the information and innovation transformation function tree based on the use case requirements and multiple node data includes: initializing the tree structure to obtain the initial tree; if the use case requirement corresponding to the node data is the first-class use case requirement, then adding the node data to the corresponding position in the initial tree, and adding the first-class use case requirement content corresponding to the node data to the child node of the node data in the initial tree; if the use case requirement corresponding to the node data is the second-class use case requirement, then directly adding the node data to the corresponding position in the initial tree; detecting the first-class use case requirement content in the initial tree after adding all node data, if the first-class use case requirement content of the child node is the same as that of the parent node, then deleting the first-class use case requirement content of the child node to obtain the information and innovation transformation function tree.
[0049] Optionally, the first type of use case requirements is used to characterize personalized use case requirements, and the second type of use case requirements is used to characterize the system default use case requirements. For example, for the use case requirements of the creator, the default creator of the trusted transformation information system (for example, Zhang San) can be used as the default use case requirement. For example, if a node does not have a personalized use case requirement set, the default use case requirement (that is, Zhang San) is used as the creator. If the creator of the verification element-menu-document management node is Li Si, Li Si is a personalized use case requirement. That is, in the process of constructing the trusted transformation function tree, the default value of the use case requirement is set. If the use case requirement of the node is the default value, it does not need to be reflected in the trusted transformation function tree. It can be automatically filled in according to the content of the second type of use case requirement during the process of automatically generating the test case set; if the node data is not the default value, the node data with the same use case requirement is omitted, and the personalized use case requirement is only reflected in the top-level node. It can be automatically filled in according to the use case requirement content of the parent node during the process of automatically generating the test case set.
[0050] For example, the first type of use case requirement can be: "Creator - Li Si" - the corresponding node data is "Verification Element - Menu - Official Document Management", "Precondition - the current login role is the document issuer role" - the corresponding node data is "Verification Element - Menu - New Document". For any node data, if the node data has a matching result in the first type of use case requirement, then the use case requirement corresponding to the node data is the first type of use case requirement, and the first type of use case requirement content corresponding to the node data is determined based on the matching result. If the node data does not have a matching result in the first type of use case requirement, then the use case requirement corresponding to the node data is the second type of use case requirement. Therefore, according to the first type of use case requirement, a sub-node "Creator - Li Si" is established in the node "Verification Element - Menu - Official Document Management" in the function tree of the information innovation transformation. If the child node of the node "Verification Element-Menu-New Document" in the trusted innovation transformation function tree is "Verification Element-Page-Document Approval Form", and the prerequisites of these two nodes are that the current login role is the document issuer role, then the prerequisite child node of the node "Verification Element-Page-Document Approval Form" can be deleted, and only the prerequisite child node of the node "Verification Element-Menu-New Document" needs to be retained. The prerequisite of the parent node "Verification Element-Menu-New Document" can be used as the prerequisite of the child node "Verification Element-Page-Document Approval Form" to avoid displaying duplicate information in the trusted innovation transformation function tree.
[0051] To sum up, by distinguishing between the first type of use case requirements and the second type of use case requirements, and for the parent nodes and child nodes with the same content as the first use case, deleting the use case requirement content of the child nodes, the data volume of the ICT transformation function tree is reduced, thereby improving the construction efficiency of the ICT transformation function tree, and then improving the efficiency of test case generation.
[0052] In order to improve the accuracy of test case generation, a test case set corresponding to the trusted innovation transformation function tree is generated according to preset rules, including: extracting all test case paths in the trusted innovation transformation function tree, where each test case path includes all nodes from a root node to the corresponding end node; performing string concatenation on each test case path according to the second type of use case requirements to determine the corresponding test case; and determining the test case set based on all test cases.
[0053] For example, obtain all the lowest nodes in the ICT transformation function tree, and traverse the path from the root node to all the lowest nodes in the ICT transformation function tree to determine the test case path.
[0054] In order to improve the adaptability of test case generation, optionally, after generating a test case set corresponding to the trusted innovation transformation function tree according to preset rules, the method also includes: detecting the code repository corresponding to the page component information, and determining the layout update data of the page component information; updating the trusted innovation transformation function tree according to the layout update data; and generating a new test case set using the updated trusted innovation transformation function tree and preset rules.
[0055] For example, the code in the code repository corresponding to the page component information can be periodically obtained. When there is a code change in the code repository, the changed code is analyzed to determine whether the page component information has been updated. If there is an update, the updated data containing the label arrangement information (that is, the hierarchical relationship and nested structure between labels) is extracted from the code repository as the layout update data. Based on the layout update data, the node data corresponding to the layout update data in the ICT transformation function tree can be updated, and a set of test cases can be regenerated based on the preset rules according to the updated ICT transformation function tree.
[0056] In summary, by detecting the warehouse corresponding to the page component information and updating the trusted innovation transformation function tree according to the layout update data, the generation of test cases can automatically adapt to the code changes of the trusted innovation transformation information system, thereby improving the adaptability of the generated test cases.
[0057] In order to improve the updating efficiency of the credible innovation transformation function tree, the credible innovation transformation function tree is updated according to the layout update data, including: determining the target update path corresponding to the credible innovation transformation function tree according to the layout update data; updating the credible innovation transformation function tree according to the target update path to obtain an updated credible innovation transformation function tree.
[0058] Optionally, the layout update data can be analyzed to obtain the path of the nodes that need to be updated in the ICT transformation function tree, and all nodes below the highest-level node that needs to be updated in the path can be intercepted as the target update path. Based on the layout update data, the nodes in the target update path are updated to obtain the updated ICT transformation function tree.
[0059] For example, there are multiple paths in the ICT transformation function tree, namely node a1-node a2-node a3-node a4, node b1-node b2-node b3-node b4, node c1-node c2-node c3-node c4. The content of the original node a3 in the layout update data changes to x3. According to the layout update data, the target update path is node a1-node a2-node a3-node a4. By updating the nodes in the target update path, we can obtain node a1-node a2-node x3-node a4.
[0060] In summary, by obtaining the target update path, the accurate update of the ICT transformation function tree is achieved, which avoids the huge time-consuming process of comprehensive scanning of the ICT transformation function tree and improves the update efficiency of the ICT transformation function tree.
[0061] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] The embodiment of the present application also provides a test case generation device. It should be noted that the test case generation device of the embodiment of the present application can be used to execute the test case generation method provided in the embodiment of the present application. The test case generation device provided in the embodiment of the present application is introduced below.
[0063] Figure 2 Schematic diagram of a test case generation device according to an embodiment of the present application. Figure 2 As shown, the device includes: a system parameter unit 201, a function extraction unit 202 and a use case generation unit 203.
[0064] The system parameter unit 201 is used to determine the target test configuration parameters based on the trusted innovation transformation information system and the reference system corresponding to the trusted innovation transformation information system, and to construct a system function tree based on the target test configuration parameters.
[0065] The function extraction unit 202 is used to obtain the page component information of the information system for information innovation and transformation, and to construct the information innovation and transformation function tree based on the system function tree and the page component information.
[0066] The use case generation unit 203 is used to generate a set of test cases corresponding to the information innovation transformation function tree according to preset rules.
[0067] The test case generation device provided in the embodiment of the present application determines the target test configuration parameters according to the trusted innovation transformation information system and the reference system corresponding to the trusted innovation transformation information system through the system parameter unit 201, and constructs a system function tree according to the target test configuration parameters. The page component information of the trusted innovation transformation information system is obtained through the function extraction unit 202, and the trusted innovation transformation function tree is constructed according to the system function tree and the page component information. The test case generation unit 203 generates a set of test cases corresponding to the trusted innovation transformation function tree according to preset rules, which solves the problem of low generation efficiency of trusted innovation transformation test cases in related technologies. By generating a system function tree and generating a trusted innovation transformation function tree in combination with page components, the automatic generation of the trusted innovation transformation function tree is realized, and then the test case set corresponding to the trusted innovation transformation function tree is generated according to the preset rules, which improves the generation efficiency of trusted innovation transformation test cases.
[0068] Optionally, in the test case generation device provided in the embodiment of the present application, the system parameter unit 201 includes: a first parameter module, used to receive the first test configuration parameters of the information system for information innovation and transformation, wherein the first test configuration parameters include adaptation type, verification element, and compatible browser; a second parameter module, used to receive the functional configuration in the reference system corresponding to the information system for information innovation and transformation, and determine the second test configuration parameters based on the functional configuration, wherein the second test configuration parameters include operation mode and step description; a parameter synthesis module, used to determine the target test configuration parameters based on the first test configuration parameters and the second test configuration parameters.
[0069] Optionally, in the test case generation device provided in the embodiment of the present application, the page component information is the page program source code, the page program source code includes multiple tags and code indentation rules, and the function extraction unit 202 includes: an information extraction module, used to determine the label arrangement information of multiple levels corresponding to the page program source code based on multiple tags and code indentation rules; a node determination module, used to recombine the label arrangement information of multiple levels according to the system function tree to obtain multiple node data; a function tree generation module, used to receive use case requirements, and construct a trusted innovation transformation function tree based on the use case requirements and multiple node data.
[0070] Optionally, in the test case generation device provided in the embodiment of the present application, the types of use case requirements include first-class use case requirements and second-class use case requirements, the first-class use case requirements include multiple first-class use case requirement contents and multiple node data corresponding to the first-class use case requirement contents, and the second-class use case requirements include second-class use case requirement contents. The function tree generation module includes: a first sub-module, used to initialize the tree structure to obtain an initial tree; a second sub-module, used to add the node data to the corresponding position in the initial tree if the use case requirement corresponding to the node data is a first-class use case requirement, and add the first-class use case requirement content corresponding to the node data to the child node of the node data in the initial tree; a third sub-module, used to directly add the node data to the corresponding position in the initial tree if the use case requirement corresponding to the node data is a second-class use case requirement; a fourth sub-module, used to detect the first-class use case requirement content in the initial tree after adding all node data, and if the first-class use case requirement content of the child node is the same as that of the parent node, delete the first-class use case requirement content of the child node to obtain the information innovation transformation function tree.
[0071] Optionally, in the test case generation device provided in the embodiment of the present application, the use case generation unit 203 includes: a path extraction module, used to extract all test case paths in the information and communication technology transformation function tree, wherein each test case path includes all nodes from a root node to the corresponding end node; a path splicing module, used to perform string splicing on each test case path according to the second type of use case requirements to determine the corresponding test case; and a set generation module, used to determine the test case set based on all test cases.
[0072] Optionally, in the test case generation device provided in the embodiment of the present application, the device also includes: a warehouse detection unit, which is used to detect the code warehouse corresponding to the page component information after generating a test case set corresponding to the credible innovation transformation function tree according to preset rules, and determine the layout update data of the page component information; a tree update unit, which is used to update the credible innovation transformation function tree according to the layout update data; and a use case update unit, which is used to generate a new test case set using the updated credible innovation transformation function tree and preset rules.
[0073] Optionally, in the test case generation device provided in the embodiment of the present application, the tree update unit includes: a target extraction module, used to determine the target update path corresponding to the credible innovation transformation function tree based on the layout update data; a node update module, used to update the credible innovation transformation function tree based on the target update path to obtain an updated credible innovation transformation function tree.
[0074] The test case generation device includes a processor and a memory. The above-mentioned system parameter unit 201, function extraction unit 202 and use case generation unit 203 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0075] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and test cases can be generated by adjusting kernel parameters.
[0076] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0077] An embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, which implements the test case generation method when executed by a processor.
[0078] An embodiment of the present invention provides a processor, which is used to run a program, wherein the test case generation method is executed when the program is running.
[0079] like Figure 3 As shown, an embodiment of the present invention provides an electronic device, the electronic device 10 includes a processor, a memory, and a program stored in the memory and runnable on the processor. When the processor executes the program, the following steps are implemented: determining target test configuration parameters based on the credible innovation transformation information system and the reference system corresponding to the credible innovation transformation information system, and constructing a system function tree based on the target test configuration parameters; obtaining page component information of the credible innovation transformation information system, and constructing a credible innovation transformation function tree based on the system function tree and the page component information; and generating a test case set corresponding to the credible innovation transformation function tree based on preset rules.
[0080] When the processor executes the program, it also implements the following steps: receiving the first test configuration parameters of the information system for information innovation and transformation, wherein the first test configuration parameters include adaptation type, verification element, and compatible browser; receiving the functional configuration in the reference system corresponding to the information system for information innovation and transformation, and determining the second test configuration parameters based on the functional configuration, wherein the second test configuration parameters include operation mode and step description; determining the target test configuration parameters based on the first test configuration parameters and the second test configuration parameters.
[0081] When the processor executes the program, it also implements the following steps: determining the label arrangement information of multiple levels corresponding to the page program source code based on multiple labels and code indentation rules; recombining the label arrangement information of multiple levels based on the system function tree to obtain multiple node data; receiving use case requirements, and constructing the information innovation transformation function tree based on the use case requirements and multiple node data.
[0082] When the processor executes the program, it also implements the following steps: initialize the tree structure to obtain an initial tree; if the use case requirement corresponding to the node data is a first-class use case requirement, add the node data to the corresponding position in the initial tree, and add the first-class use case requirement content corresponding to the node data to the child node of the node data in the initial tree; if the use case requirement corresponding to the node data is a second-class use case requirement, directly add the node data to the corresponding position in the initial tree; detect the first-class use case requirement content in the initial tree after adding all node data, and if the first-class use case requirement content of the child node is the same as that of the parent node, delete the first-class use case requirement content of the child node to obtain the information innovation transformation function tree.
[0083] When the processor executes the program, it also implements the following steps: extracting all test case paths in the trusted innovation transformation function tree, where each test case path includes all nodes from a root node to the corresponding end node; performing string concatenation on each test case path according to the second type of use case requirements to determine the corresponding test case; and determining the test case set based on all test cases.
[0084] When the processor executes the program, it also implements the following steps: detecting the code repository corresponding to the page component information, determining the layout update data of the page component information; updating the trusted innovation transformation function tree based on the layout update data; and using the updated trusted innovation transformation function tree and preset rules to generate a new set of test cases.
[0085] When the processor executes the program, it also implements the following steps: determining the target update path corresponding to the ICT transformation function tree based on the layout update data; updating the ICT transformation function tree based on the target update path to obtain an updated ICT transformation function tree.
[0086] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: determining target test configuration parameters based on the credible innovation transformation information system and the reference system corresponding to the credible innovation transformation information system, and constructing a system function tree based on the target test configuration parameters; obtaining page component information of the credible innovation transformation information system, and constructing a credible innovation transformation function tree based on the system function tree and the page component information; and generating a set of test cases corresponding to the credible innovation transformation function tree based on preset rules.
[0087] When executed on a data processing device, it is also suitable for executing an initialization program with the following method steps: receiving the first test configuration parameters of the information system for information innovation and transformation, wherein the first test configuration parameters include adaptation type, verification element, and compatible browser; receiving the functional configuration in the reference system corresponding to the information system for information innovation and transformation, and determining the second test configuration parameters based on the functional configuration, wherein the second test configuration parameters include operation mode and step description; determining the target test configuration parameters based on the first test configuration parameters and the second test configuration parameters.
[0088] When executed on a data processing device, it is also suitable for executing an initialization program with the following method steps: determining the label arrangement information of multiple levels corresponding to the page program source code based on multiple labels and code indentation rules; recombining the label arrangement information of multiple levels based on the system function tree to obtain multiple node data; receiving use case requirements, and constructing the information innovation transformation function tree based on the use case requirements and multiple node data.
[0089] When executed on a data processing device, it is also suitable for executing an initialization program with the following method steps: initialize the tree structure to obtain an initial tree; if the use case requirement corresponding to the node data is a first-category use case requirement, then add the node data to the corresponding position in the initial tree, and add the first-category use case requirement content corresponding to the node data to the child node of the node data in the initial tree; if the use case requirement corresponding to the node data is a second-category use case requirement, then directly add the node data to the corresponding position in the initial tree; detect the first-category use case requirement content in the initial tree after adding all node data, and if the first-category use case requirement content of the child node is the same as the first-category use case requirement content of the parent node, then delete the first-category use case requirement content of the child node to obtain the information technology transformation function tree.
[0090] When executed on a data processing device, it is also suitable for executing an initialization program with the following method steps: extracting all test case paths in the information and innovation transformation function tree, wherein each test case path includes all nodes from a root node to the corresponding end node; performing string concatenation on each test case path according to the second type of use case requirements to determine the corresponding test case; and determining the test case set based on all test cases.
[0091] When executed on a data processing device, it is also suitable for executing an initialization program with the following method steps: detecting the code repository corresponding to the page component information, and determining the layout update data of the page component information; updating the credible innovation transformation function tree based on the layout update data; and using the updated credible innovation transformation function tree and preset rules to generate a new set of test cases.
[0092] When executed on a data processing device, it is also suitable for executing an initialization program with the following method steps: determining the target update path corresponding to the credible innovation transformation function tree based on the layout update data; updating the credible innovation transformation function tree based on the target update path to obtain an updated credible innovation transformation function tree.
[0093] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0097] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0098] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0099] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media 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 disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0100] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A test case generation method, characterized in that: include: Determine target test configuration parameters based on the credible innovation transformation information system and the reference system corresponding to the credible innovation transformation information system, and construct a system function tree based on the target test configuration parameters; Obtain page component information of the credible innovation transformation information system, and construct a credible innovation transformation function tree based on the system function tree and the page component information; Generate a set of test cases corresponding to the information technology transformation function tree based on preset rules.
2. The method according to claim 1, characterized in that Determining target test configuration parameters based on the trusted innovation transformation information system and the reference system corresponding to the trusted innovation transformation information system includes: Receive first test configuration parameters of the information system for the transformation of the trust and innovation, wherein the first test configuration parameters include an adaptation type, a verification element, and a compatible browser; Receive the functional configuration in the reference system corresponding to the information system for information innovation transformation, and determine the second test configuration parameters according to the functional configuration, wherein the second test configuration parameters include an operation method and a step description; The target test configuration parameter is determined according to the first test configuration parameter and the second test configuration parameter.
3. The method according to claim 1, characterized in that The page component information is the page program source code, which includes multiple tags and code indentation rules. Constructing the trust innovation transformation function tree based on the system function tree and the page component information includes: Determining label arrangement information of multiple levels corresponding to the page program source code based on the multiple labels and the code indentation rule; Recombining the label arrangement information of the multiple levels according to the system function tree to obtain multiple node data; Receive use case requirements and build the trusted innovation transformation function tree based on the use case requirements and the multiple node data.
4. The method according to claim 3, characterized in that The types of use case requirements include first-type use case requirements and second-type use case requirements, the first-type use case requirements include multiple first-type use case requirement contents and multiple node data corresponding to the first-type use case requirement contents, the second-type use case requirements include second-type use case requirement contents, and constructing the trust innovation transformation function tree based on the use case requirements and the multiple node data includes: Initialize the tree structure and obtain the initial tree; If the use case requirement corresponding to the node data is a first-category use case requirement, then adding the node data to a corresponding position in the initial tree, and adding the first-category use case requirement content corresponding to the node data to a child node of the node data in the initial tree; If the use case requirement corresponding to the node data is a second type use case requirement, directly adding the node data to the corresponding position in the initial tree; Detect the first-category use case requirement content in the initial tree after adding all the node data. If the first-category use case requirement content of the child node is the same as that of the parent node, delete the first-category use case requirement content of the child node to obtain the information technology transformation function tree.
5. The method according to claim 4, characterized in that The test case set corresponding to the trust innovation transformation function tree generated according to the preset rules includes: Extract all test case paths in the ICT transformation function tree, wherein each test case path includes all nodes passed from a root node to a corresponding end node; Perform string concatenation on each of the test case paths according to the second type of use case requirements to determine the corresponding test case; A test case set is determined based on all the test cases.
6. The method according to claim 1, characterized in that After generating a set of test cases corresponding to the trust innovation transformation function tree according to preset rules, the method further includes: Detecting a code repository corresponding to the page component information, and determining layout update data of the page component information; Update the ICT transformation function tree according to the layout update data; A new set of test cases is generated using the updated trusted innovation transformation function tree and the preset rules.
7. The method according to claim 6, characterized in that Updating the ICT transformation function tree according to the layout update data includes: Determine the target update path corresponding to the ICT transformation function tree based on the layout update data; The credible innovation transformation function tree is updated according to the target update path to obtain an updated credible innovation transformation function tree.
8. A test case generating device, characterized in that: include: A system parameter unit is used to determine target test configuration parameters based on the credible innovation transformation information system and the reference system corresponding to the credible innovation transformation information system, and to construct a system function tree based on the target test configuration parameters; A function extraction unit is used to obtain page component information of the information system for information innovation and transformation, and to construct an information innovation and transformation function tree based on the system function tree and the page component information; The use case generation unit is used to generate a set of test cases corresponding to the information innovation transformation function tree according to preset rules.
9. A computer-readable storage medium, characterized in that The storage medium includes a stored program, wherein the program executes the test case generation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The method comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the test case generation method described in any one of claims 1 to 7.
