Document generation method and device, electronic equipment and medium
By using target mind maps and document templates to generate test documents in the nuclear power instrumentation and control system, the problem of weak correlation between test design documents and test case documents was solved, achieving more efficient control of test coverage and higher document generation accuracy.
Patent Information
- Application Number
- CN202511582296.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-17
AI Technical Summary
In nuclear power instrumentation and control systems, the correlation between test design documents, test case documents, and requirements documents is weak, making it difficult for testers to accurately grasp the test coverage, resulting in low accuracy in writing test cases and difficulty in efficiently tracking them.
By responding to editing operations, a target mind map of the configuration software is obtained. Test documents, including test design documents and test case documents, are generated using the node arrangement of the editing window. The target hierarchy and test cases are filled in using document templates, and a requirements traceability table is generated to ensure a strong correlation between test design, test cases, and test requirements.
It improves the accuracy of test coverage control, reduces the risk of missing test cases, and enables efficient tracking of test design documents and test case documents, avoiding the information fragmentation problem of traditional scattered documents.
Smart Images

Figure CN121543556A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of nuclear power instrumentation and control technology, and in particular to a document generation method, apparatus, electronic device and medium. Background Technology
[0002] With the development of nuclear power plant instrumentation and control systems, the configuration software for these systems is becoming increasingly complex, leading to a surge in the number of test cases and test designs. Generating test case documents and test design documents for this configuration software has become a pressing technical problem.
[0003] Currently, qualified testers typically write test case documents and test design documents using templates that meet the requirements. However, due to limitations in document display and the difficulty for testers to accurately grasp the test coverage of specific test objects, the accuracy of the written test cases is low. Furthermore, the current test design documents, test case documents, and requirements documents have weak connections, making it difficult for testers to efficiently track test cases. Summary of the Invention
[0004] This application provides a document generation method, apparatus, electronic device, and medium that can solve the problem that testers have difficulty accurately grasping the test coverage of specific test objects, as well as the problem that the correlation between current test design documents, test case documents, and requirement documents is weak.
[0005] In a first aspect, embodiments of this application provide a document generation method, which includes:
[0006] In response to editing operations in the editing window, obtain the target mind map of the configuration software;
[0007] The editing window includes a root node, first-level child nodes, second-level child nodes, and an end node. The name of the current test project is edited in the root node, the test requirements of the current test project are edited in the first-level child nodes, the test points of the test requirements are edited in the second-level child nodes, and the test design and test cases corresponding to the test points are edited in the end node.
[0008] Based on the target mind map and the pre-imported document template, generate test documents; the test documents include test design documents and test case documents, and the test design documents include a test requirement traceability table;
[0009] The document template includes a first fill position, a second fill position, and a third fill position. In the first fill position, the target hierarchy relationship in the target mind map is filled in, and the target hierarchy relationship indicates the hierarchical relationship between test requirements, test points decomposed from the test requirements, test designs corresponding to the test points, and test cases. In the second fill position, test cases in the target mind map are filled in. In the third fill position, test designs in the target mind map are filled in.
[0010] Optionally, if the test point is split into a higher-level sub-test point, the higher-level sub-test point is split into a current-level sub-test point, and the current-level sub-test point is split into a lower-level sub-test point; the editing window further includes a higher-level three-level child node, a current-level three-level child node, and a lower-level three-level child node, and the method further includes:
[0011] The target mind map includes edited sub-points at the parent level, edited sub-points at the current level, and populated with sub-points at the lower level.
[0012] The step of editing the test design and test cases corresponding to the test point at the end node includes: editing the test design and test cases corresponding to the lower-level sub-test points at the end node, wherein one lower-level sub-test point corresponds to one test design and one test case.
[0013] Optionally, if the document template includes the locations of the tracking table identifier, the use case table identifier, the design table identifier, and the statistics table identifier, the step of generating the test document based on the target mind map and the pre-imported document template includes:
[0014] Based on the target mind map, determine the test case requirement relationship between test cases and test requirements; and generate a requirement traceability table based on the test case requirement relationship.
[0015] Count the number of test cases in the target mind map; generate a statistical table based on the count.
[0016] Fill the demand tracking table at the marked position;
[0017] At the designated location in the test case table, populate the table with the test cases;
[0018] Fill the test design table at the designated location in the design table;
[0019] Fill the statistical table at the designated location;
[0020] The test document was obtained.
[0021] Optionally, the method further includes:
[0022] Based on the hierarchical relationship between test requirements, test points, subtest points, test cases, and test design in the target mind map, adjust the order of document chapters to ensure that the chapter logic of the adjusted document is consistent with the test process.
[0023] Optionally, the method further includes:
[0024] The target mind map is stored, and the saved test cases include the project name, hierarchical relationship, test points, test design, test cases, expected execution results, execution defects, and actual execution results.
[0025] Optionally, if the document template includes the locations of the tracking table identifier, the use case table identifier, the design table identifier, and the statistics table identifier, the step of generating the test document based on the target mind map and the pre-imported document template includes:
[0026] From the saved test cases, obtain the test case requirement relationship between the test case and the test requirements, and obtain the requirement traceability table; wherein, the requirement traceability table includes test item description, category, requirement traceability number and requirement item description;
[0027] Count the number of test cases in the saved test cases; generate a statistical table based on the count; the statistical table includes the function corresponding to the test cases, the total number of test cases, the number of executed test cases, the number of passed test cases, the number of failed test cases, and the number of unexecuted test cases;
[0028] Fill the demand tracking table at the marked position;
[0029] At the designated location in the test case table, populate the table with the test cases;
[0030] Fill the test design table at the designated location in the design table;
[0031] Fill the statistical table at the designated location;
[0032] Generate the test document.
[0033] Optionally, the step of counting the number of test cases in the target mind map includes:
[0034] If a test case has a single child node following its corresponding node, the test case is considered not executed.
[0035] If a test case has two child nodes after its corresponding node, the test case is considered executed and passed.
[0036] If a test case has three child nodes after its corresponding node, the test case is considered executed but failed.
[0037] If a test case has n child nodes after its corresponding node, the test case is considered to have a test case writing error; where n is an integer greater than 3.
[0038] Secondly, embodiments of this application provide a document generation apparatus, the apparatus comprising:
[0039] The editing unit is used to respond to editing operations in the editing window and obtain the target mind map of the configuration software;
[0040] The editing window includes a root node, first-level child nodes, second-level child nodes, and an end node. The name of the current test project is edited in the root node, the test requirements of the current test project are edited in the first-level child nodes, the test points of the test requirements are edited in the second-level child nodes, and the test design and test cases corresponding to the test points are edited in the end node.
[0041] The generation unit is used to generate test documents based on the target mind map and the pre-imported document template; the test documents include test design documents and test case documents, and the test design documents include a test requirement traceability table;
[0042] The document template includes a first fill position, a second fill position, and a third fill position. In the first fill position, the target hierarchy relationship in the target mind map is filled in, and the target hierarchy relationship indicates the hierarchical relationship between test requirements, test points decomposed from the test requirements, test designs corresponding to the test points, and test cases. In the second fill position, test cases in the target mind map are filled in. In the third fill position, test designs in the target mind map are filled in.
[0043] Thirdly, embodiments of this application provide a computer program product, the computer program product comprising: a computer program (also referred to as code or instructions), which, when the computer program is run, causes a computer to perform a method in any of the possible implementations of any of the above aspects.
[0044] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program (also referred to as code or instructions) that, when run on a computer, causes the computer to perform the method in any of the possible implementations of any of the above aspects.
[0045] Fifthly, embodiments of this application provide a chip system including one or more processors for calling and executing instructions stored in memory, causing the methods in any of the above aspects or possible implementations to be executed. The chip system may be composed of chips or may include chips and other discrete devices.
[0046] This application provides a document generation method and apparatus. The method specifically includes: in response to an editing operation in an editing window, acquiring a target mind map of configuration software; wherein the editing window includes a root node, first-level child nodes, second-level child nodes, and an end node; editing the name of the current test project at the root node; editing the test requirements of the current test project at the first-level child nodes; editing the test points of the test requirements at the second-level child nodes; and editing the test design and test cases corresponding to the test points at the end nodes; generating a test document based on the target mind map and a pre-imported document template; the test document includes a test design document and a test case document, the test design document including a test requirement tracking table; wherein the document template includes a first fill position, a second fill position, and a third fill position; at the first fill position, filling in the target hierarchy relationship in the target mind map, the target hierarchy relationship indicating the hierarchy relationship between test requirements, the test points of the test requirements, the test designs and test cases corresponding to the test points; at the second fill position, filling in the test cases in the target mind map; and at the third fill position, filling in the test designs in the target mind map. Therefore, by arranging the nodes of the mind map provided in the editing window, test projects can be hierarchically broken down. This helps testers to more clearly control the test coverage, reduce the risk of missing test cases, and improve the accuracy of document generation. Based on the document template and the target mind map, test design documents and test case documents are generated, with a requirement traceability table generated in the test design document. Since both the test design document and the test case document originate from the same target mind map, this method avoids the information fragmentation problem of traditional scattered documents, making test design, test requirements, and test cases strongly related, thus facilitating efficient traceability. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1A flowchart of a document generation method provided in this application embodiment;
[0049] Figure 2 A schematic diagram of the structure of a target mind map provided in an embodiment of this application;
[0050] Figure 3 This is a schematic diagram of another target mind map provided in an embodiment of this application;
[0051] Figure 4 A schematic diagram of the structure of another target mind map provided in the embodiments of this application;
[0052] Figure 5 A flowchart of a document generation method provided in this application embodiment;
[0053] Figure 6 This is a diagram showing a single test case after it has been saved.
[0054] Figure 7 A schematic diagram of a demand tracking form provided in an embodiment of this application;
[0055] Figure 8 This is a schematic diagram of a data statistics table for a test case provided in an embodiment of this application;
[0056] Figure 9 This is a schematic diagram of a document generation device provided in an embodiment of this application. Detailed Implementation
[0057] To enable those skilled in the art to better understand the present application, the technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0058] As mentioned earlier, currently, qualified testers typically write test case documents and test design documents using compliant templates. However, due to document display limitations and the difficulty for testers to accurately grasp the test coverage of specific test objects, the accuracy of the documents is low. Furthermore, the current test design document, test case document, and requirement document are three separate documents with weak correlation, making it difficult for testers to efficiently track test cases. In addition, while using document templates can reduce the probability of errors during document writing, the risk of document formatting errors and human error increases significantly as the test scope expands, the number of test cases and test designs increases.
[0059] In view of this, this application provides a document generation method, which, in response to an editing operation in an editing window, obtains a target mind map of configuration software; wherein, the editing window includes a root node, first-level child nodes, second-level child nodes, and an end node, wherein the name of the current test project is edited at the root node, the test requirements of the current test project are edited at the first-level child nodes, the test points of the test requirements are edited at the second-level child nodes, and the test designs and test cases corresponding to the test points are edited at the end nodes; a test document is generated based on the target mind map and a pre-imported document template; the test document includes a test design document and a test case document, wherein the test design document includes a test requirement tracking table; wherein, the document template includes a first fill position, a second fill position, and a third fill position; at the first fill position, the target hierarchy relationship in the target mind map is filled, the target hierarchy relationship indicating the hierarchy relationship between test requirements, the test points of the test requirements, the test designs and test cases corresponding to the test points; at the second fill position, the test cases in the target mind map are filled; at the third fill position, the test designs in the target mind map are filled. Therefore, by arranging the nodes of the mind map provided in the editing window, test projects can be hierarchically broken down. This helps testers to more clearly control the test coverage, reduce the risk of missing test cases, and improve the accuracy of document generation. Based on the document template and the target mind map, test design documents and test case documents are generated, with a requirement traceability table generated in the test design document. Since both the test design document and the test case document originate from the same target mind map, this method avoids the information fragmentation problem of traditional scattered documents, making test design, test requirements, and test cases strongly related, thus facilitating efficient traceability.
[0060] The document generation method provided in this application is described below with reference to the accompanying drawings. It should be noted that the executing entity of the document generation method provided in this application can be an electronic device such as a desktop computer, laptop computer, mobile phone, or server, or a cloud server, etc. This application does not specifically limit the implementation. For ease of explanation, an electronic device will be used as an example below.
[0061] Appendix Figure 1 This is a flowchart illustrating a document generation method provided in an embodiment of this application. Figure 1 As shown, the generation method includes:
[0062] S110, in response to editing operations in the editing window, retrieves the target mind map of the configuration software.
[0063] The editing window includes a root node, first-level child nodes, second-level child nodes, and a terminal node. The root node is used to edit the project name of the current test project, the first-level child nodes are used to edit the test requirements of the current test project, the second-level child nodes are used to edit the test points that are broken down from the test requirements, and the terminal node is used to edit the test design and test cases corresponding to the test points.
[0064] For example, such as Figure 2 This is a schematic diagram of the structure of a target mind map provided in an embodiment of this application. For example... Figure 2 As shown, the root node of this target mind map is the project name of the current test project. Since the project contains itemized requirements, these requirements are listed as first-level child nodes after the root node. For example, as... Figure 2 As shown, a project includes n itemized requirements. The first-level child nodes include n test requirement nodes, specifically test requirement 1 to test requirement n. Here, n is a positive integer.
[0065] Each test requirement is broken down into different test points based on the testable points. For example, such as... Figure 2 As stated, test requirement 1 can be divided into n1 different nodes. After the test requirement 1 node are second-level child nodes, which include n1 test point nodes, specifically test point 1 to test point n1. Here, n1 is a positive integer.
[0066] Each test point corresponds to one test case and test design. Specifically, such as... Figure 2 As shown, after test point node 1 is the end node, which is used to fill in the test cases and test designs corresponding to test point node 1.
[0067] In one specific implementation, each test point can be split into different sub-test points according to actual testing needs. In this embodiment, the editing window also includes three-level child nodes, which are used to populate sub-test points. For example, as shown... Figure 2 As shown, test point n1 is divided into n2 sub-test points. Then, after test point node n1, there are three levels of child nodes, which include sub-test point 1 to sub-test point n2. Here, n2 is a positive integer.
[0068] In another example, the test points can be further subdivided. In this embodiment, the test points are subdivided into hierarchical test points: superior test points, current test points, and subordinate test points. The current test point can be further subdivided into current test points, and the current test point can be further subdivided into subordinate test points. In this embodiment, the editing window also includes superior third-level sub-nodes, current third-level sub-nodes, and subordinate third-level sub-nodes. The superior test point is edited at the superior third-level sub-node, the current test point is edited at the current third-level sub-node, and the subordinate test point is populated at the subordinate third-level sub-node. The target mind map also includes the edited third-level sub-nodes. Editing the test design and test cases corresponding to the test points at the end nodes includes: editing the test design and test cases corresponding to the subordinate test points at the end nodes, wherein one subordinate test point corresponds to one test design and one test case.
[0069] For example, such as Figure 3 The diagram shown is a schematic representation of another target mind map provided in this embodiment. In this embodiment, test point n1 can be divided into higher-level sub-test points. The higher-level sub-test points are further divided into n3 local-level test points, and local-level test point n1 can be further divided into n4 lower-level sub-test points. The higher-level three-tier child nodes are then used to fill the higher-level sub-test points. The local-level three-tier child nodes include...
[0070] This level's test point node 1 through n3. n3 is a positive integer. Following this level's test point node 1, specifically including the next-level sub-test point nodes 1 through n4. n4 is a positive integer.
[0071] It should be noted that in practical use, testers can use a depth-first search approach to perform unlimited hierarchical identification of test points in the mind map. Furthermore, testers can further refine the classification of test points according to actual needs. This application's embodiments are not specifically limited.
[0072] In this embodiment of the application, for the final test point, test design, test cases, and effect writing are completed according to the requirements of the current test point. The effect node is used to fill in the expected execution effect, the actual execution effect, and whether there are any defects. Each final test point corresponds to one indivisible test point. For example, as shown... Figure 4 The diagram shown is a structural schematic of another target mind map provided in an embodiment of this application. In this mind map, after the final test point 1 node is the test design node, after the test design node is the test case node, and after the test case node are the expected execution effect, the actual execution effect, and whether there are defects.
[0073] S120 generates test documents based on the target mind map and pre-imported document templates.
[0074] The document template includes a first fill position, a second fill position, and a third fill position. In the first fill position, the target hierarchy relationship in the target mind map is filled in. The target hierarchy relationship indicates the hierarchical relationship between test requirements, test points broken down from test requirements, test designs corresponding to test points, and test cases. In the second fill position, test cases in the target mind map are filled in. In the third fill position, test designs in the target mind map are filled in.
[0075] In this embodiment, the document template can be one or more of a test case document template and a test design document template. Specifically, if the document template is a test case document template, the generated test document is a test case document. If the document template is a test design document template, the generated test document is a test design document.
[0076] It is understandable that test case documents and test design documents are generated based on document templates and target mind maps, with the test design document including a requirements traceability table. Since both the test design document and the test case document originate from the same target mind map, this approach avoids the information fragmentation problem of traditional scattered documents, ensuring a strong connection between test requirements, test cases, and test design. Therefore, this approach facilitates efficient traceability.
[0077] In one specific implementation, the first filling position is the traceability table identifier position, the second filling position is the test case table identifier position, and the third filling position is the design table identifier position. Additionally, the document template includes a statistics table identifier position. In this embodiment, the electronic device can determine the test case requirement relationship between test cases and test requirements based on the target mind map; generate a requirement traceability table based on the test case requirement relationship; count the number of test cases in the target mind map; generate a statistics table based on the counted number; fill the requirement traceability table at the traceability table identifier position; fill the test case table at the test case table identifier position; fill the test design table at the design table identifier position; and fill the statistics table at the statistics table identifier position. In this way, the requirement traceability table, test case table, test design table, and statistics table all originate from the same target mind map data and are bound to the same document template through identifier positions. This method ensures that when requirements change, all tables are updated synchronously simply by modifying the mind map. This avoids the disconnect between test requirements and test cases, and the discrepancy between statistical data and actual test cases, which is common in traditional scattered documents, thus improving the accuracy of the data in the document.
[0078] In one specific implementation, symbols are added at designated locations. When generating the document, the corresponding content can be generated based on these symbols. For example, a traceability table identifier (e.g., $requirmentForm$) is added to the traceability table identifier location; a test case table identifier (e.g., $testcaseForm$) is added to the test case table identifier location; a design table identifier (e.g., $testDesignForm$) is added to the design table identifier location; and a statistics table identifier (e.g., $statisticsForm$) is added to the statistics table identifier location. When generating the test document, a requirement traceability table will be generated at the location marked $requirmentForm$ in the template; a test case table will be generated at the location marked $testcaseForm$ in the document template; a test design table will be generated at the location marked $testDesignForm$ in the document template; and a statistics table for the test case data will be generated at the location marked $statisticsForm$ in the document template.
[0079] Furthermore, the electronic device can also adjust the document chapter order according to the hierarchical relationship of test requirements, test points, sub-test points, test cases, and test design in the target mind map, so that the chapter logic of the adjusted document is the same as the test process.
[0080] In summary, the mind map node arrangement provided in the editing window allows for hierarchical breakdown of test projects. This approach helps testers better control the test coverage, reduces the risk of missed test cases, and improves the accuracy of document generation. Based on the document template and the target mind map, test design documents and test case documents are generated, with a requirement traceability table generated within the test design document. Since both the test design and test case documents originate from the same target mind map, this method avoids the information fragmentation problem of traditional scattered documents, creating a strong correlation between test design, test requirements, and test cases, thus facilitating efficient traceability.
[0081] The document generation method provided in this application embodiment will be further explained below with reference to specific implementation. In this embodiment, the document generation method is divided into five stages, namely the first stage to the fifth stage. The first stage is the graphical test case writing stage, the second stage is the data serialization management node, the third stage is the test case data processing stage, the fourth stage is the document template import stage, and the fifth stage is the data document output stage. The specific implementation will be described in detail below.
[0082] Appendix Figure 5 A flowchart illustrating a document generation method provided in this application embodiment. The method includes:
[0083] S510, graphical test case writing.
[0084] Specifically, testers edit the text in the editing window according to the set node arrangement to complete the test design and test case writing, thus obtaining the target mind map. The specific method for obtaining the target mind map is described above and will not be discussed further here.
[0085] S520, Data Serialization Management.
[0086] Specifically, this step is mainly used to serialize the target mind map. After serialization, the target mind map is stored as test cases.
[0087] In one specific implementation, the electronic device can store standardized data as a JSON file or store it in a target database.
[0088] The JSON file is saved by traversing each node from the root node of the project name in depth, and constructing and saving the JSON file according to the relationship between the parent and child nodes and the parallel relationship of the sibling nodes.
[0089] Standardized data is stored in the target database. Specifically, the entire data storage process for a single test case is completed according to the path taken from the root node to the test case, test design, and expected results. The target database can be a MySQL database, or other databases; this application embodiment does not specifically limit the specific database used.
[0090] For example, Appendix Figure 6 This is a diagram showing a single, saved test case. (Example) Figure 6 As shown, the test cases include the following fields: projectName, relationship, testpoint, testDesign, testCase, expected result, DefectNum, and actual result. The projectName field is used to fill in the project name, the relationship field is used to fill in the hierarchical relationship, the testpoint field is used to fill in the test point, the testDesign field is used to fill in the test design, the testCase field is used to fill in the test case, the expected result field is used to fill in the expected result, the defectNum field is used to fill in the defect, and the actual result field is used to fill in the actual result.
[0091] For example, such as Figure 6 As shown, for a single test case, the following fields are filled in: Project Name: The project name field is filled with the "New Nuclear Power Plant Instrumentation and Control System Configuration Software Project"; Relationship: The relationship field is filled with "SRS-REDACE-145," representing the hierarchical relationship between the algorithm configuration interface, algorithm block, and addition operation. Test Point: The addition algorithm icon can be selected and moved to a specified coordinate using the left mouse button. Test Design: The accuracy of the addition algorithm icon's movement is tested. Test Case: In the configuration interface, the addition algorithm block is selected with the left mouse button, and the icon's movement is tested by moving it 50, 100, or 200 pixels up, down, left, or right. Expected Result: The icon's movement in the configuration interface is accurate and error-free. Defect Number: "null" indicates no defect. Actual Result: The icon's movement in the configuration interface is accurate and error-free.
[0092] Single Test Case Information 2: The "Project Name" field is filled with the project name of the new nuclear power plant instrumentation and control system configuration software. The "Relationship" field is filled with "SRS-REDACE-145," representing the hierarchical relationship between the algorithm configuration interface, algorithm block, and subtraction operation. The "Test Point" field is filled with the subtraction algorithm icon, which can be selected and moved to a specified coordinate using the left mouse button. The "Test Design" field is filled with the accuracy of the subtraction algorithm icon's movement. The "Test Case" field is used to fill in the configuration interface by selecting the subtraction algorithm block with the left mouse button and attempting to move it 50, 100, or 200 pixels up, down, left, or right to check the accuracy of the icon's movement in the configuration interface. The "Expected Result" field is filled with accurate and error-free icon movement in the configuration interface, and the "Defect Number" field is filled with "ctec00001," indicating a defect. The "Actual Result" field is filled with accurate icon movement in the configuration interface but with some offset.
[0093] Thus, during document generation, there's no need to reorganize test case data. The hierarchical relationship of "requirement-test point-test case" can be directly extracted from JSON to divide document chapters, or the hierarchical order can be obtained from the database's relationship field to quickly populate templates and generate requirement tracking tables and test case tables (e.g., the relationship field of the test case in the example, "hierarchical relationship between algorithm configuration interface, algorithm block, and addition operation," can be directly used for document chapter sorting). During test case management, test cases can be easily "queried, added, and deleted" based on the database (e.g., quickly filtering defective test cases based on the DefectNum field; in the example, the defective test case "ctec00001" can be accurately located), eliminating the need for manual review of numerous documents. This seamless integration of "storage-subsequent application" significantly reduces the time spent on repetitive data processing and improves the efficiency of the entire testing process.
[0094] S530, Test Case Data Processing.
[0095] In this embodiment of the application, the electronic device is mainly used for data processing of test cases, specifically including requirement tracking of test cases and data statistics of test cases.
[0096] In this context, requirement tracing for test cases refers to tracking the relationship between test cases and test requirements. In one example, the electronic device can trace the relationship between test cases and test requirements based on a JSON file containing the data. This tracing follows a single directed acyclic topological sequence from requirement nodes to test case nodes, and the requirement tracing is completed sequentially. In another example, the electronic device can read test cases from a database. From the relational fields in the database, the device can use regular expressions to split the requirement tracing number and requirement item description from the first node information. For example, as shown... Figure 6As shown, the first node information of the relationship byte in the saved test case is the SRS-REDACE-145 interface. Based on the SRS-REDACE-145 interface, this application embodiment can use regular expression matching to split the requirement tracking number and requirement item description to obtain the requirement tracking table.
[0097] In this embodiment of the application, the requirements traceability table includes a test item description, a category, a requirements traceability number, and a requirements item description. For example, see attached... Figure 7 This is a schematic diagram of a demand tracking form provided in an embodiment of this application. Figure 7 As shown, the table includes fields for Test Item Number, Test Item Description, Category, Requirement Tracking Number, and Requirement Item Description. The Test Item Number field is used to populate the test item, the Test Item Description field is used to populate the test item (e.g., the main software interface), and the Category field is used to categorize the test item (e.g., functionality). The Requirement Tracking Number field is used to populate the requirement tracking number (e.g., SRS-REDACE-45), and the Requirement Item Description field is used to populate the requirement item, such as interface components and interface area composition.
[0098] The number of test cases in the saved test cases is counted; based on the counted number, a statistical table is generated. In this embodiment of the application, the statistical table includes the function corresponding to the test cases, the total number of test cases, the number of executed test cases, the number of passed test cases, the number of failed test cases, and the number of unexecuted test cases.
[0099] For example, such as Figure 8 The diagram shown is a schematic of a test case data statistics table provided in an embodiment of this application. This statistics table includes a function / performance field, a total number of test cases, a number of executed test cases, a number of passed test cases, a number of failed test cases, and a number of unexecuted test cases. The function / performance field is used to populate the function or performance of the test cases, for example... Figure 7 As shown, the software main interface includes solutions and functions, and operators. The "Total Test Cases" field is used to populate the total number of test cases. The "Executed Test Cases" field is used to populate the number of executed test cases. The "Passed Test Cases" field is used to populate the number of executed and passed test cases. The "Failed Test Cases" field is used to populate the number of executed but failed test cases, and the "Unexecuted Test Cases" field is used to populate the number of test cases that were not executed.
[0100] Test case quantity statistics. In this embodiment, the following principles can be used to count the number of test cases: If a test case has a single child node after its corresponding node, i.e., the "actual result" node and the "defect number" node do not exist, the test case is counted as not executed; if a test case has two child nodes after its corresponding node, i.e., the "expected result" node and the "actual result" node exist, the test case is counted as executed and passed; if a test case has three child nodes after its corresponding node, i.e., the "expected result" node, the "actual result" node, and the "defect number" node exist, the test case is counted as executed but failed; if a test case has m child nodes after its corresponding node, the test case is counted as a test case writing error, where m is an integer greater than 3.
[0101] S540, Import document template.
[0102] Specifically, the electronic device includes an import document template interface, which can receive test case document templates that conform to the rules, thereby enabling the import of document templates.
[0103] S550, Data Document Output Stage.
[0104] In this embodiment, the electronic device can generate test documents. Specifically, the requirement traceability table is filled at the marked position of the traceability table; the test case table is filled at the marked position of the test case table; the test design table is filled at the marked position of the design table; and the statistics table is filled at the marked position of the statistics table. The test requirement document is obtained based on the requirement traceability table; and the test case document and the test design document are obtained based on the test case table, the statistics table, and the requirement traceability table.
[0105] Furthermore, the electronic device can adjust the document chapter order according to the hierarchical relationship of test requirements, test points, sub-test points, test cases, and test design in the target mind map, so that the chapter logic of the adjusted document is the same as the test process.
[0106] In one implementation, the document, saved as a JSON file, is divided into chapters based on the hierarchical relationships between test points in the "Test Requirements" and "Test Design" nodes. Alternatively, generated test cases can be retrieved from the database, and the chapters in the test document can be divided using the order of the list information in "relationship".
[0107] This application embodiment utilizes a built-in mind map writing window, allowing testers to graphically write test cases and test designs based on the invention's test case writing rules. Testers can also manage test cases by querying, adding, and deleting them through a database. For test designs and test cases stored in the database, company-specified document templates can be imported to generate corresponding documents. Testers can then set specified symbols and identifiers in the document templates to achieve requirements tracing, test design statistics, test case statistics, and test case data statistics.
[0108] In addition, embodiments of this application also provide a document generation apparatus.
[0109] Appendix Figure 9 This is a schematic diagram of a document generation apparatus provided in an embodiment of this application. The apparatus 900 includes:
[0110] Editing unit 901 is used to obtain the target mind map of the configuration software in response to editing operations in the editing window;
[0111] The editing window includes a root node, first-level child nodes, second-level child nodes, and an end node. The name of the current test project is edited in the root node, the test requirements of the current test project are edited in the first-level child nodes, the test points of the test requirements are edited in the second-level child nodes, and the test design and test cases corresponding to the test points are edited in the end node.
[0112] The generation unit 902 is used to generate test documents based on the target mind map and the pre-imported document template; the test documents include test design documents and test case documents, and the test design documents include a test requirement traceability table;
[0113] The document template includes a first fill position, a second fill position, and a third fill position. In the first fill position, the target hierarchy relationship in the target mind map is filled in, and the target hierarchy relationship indicates the hierarchical relationship between test requirements, test points decomposed from the test requirements, test designs corresponding to the test points, and test cases. In the second fill position, test cases in the target mind map are filled in. In the third fill position, test designs in the target mind map are filled in.
[0114] Optionally, if the test point is split into a higher-level sub-test point, the higher-level sub-test point is split into a current-level sub-test point, and the current-level sub-test point is split into a lower-level sub-test point; the editing window further includes a higher-level three-level child node, a current-level three-level child node, and a lower-level three-level child node, and the method further includes:
[0115] The target mind map includes edited sub-points at the parent level, edited sub-points at the current level, and populated with sub-points at the lower level.
[0116] The step of editing the test design and test cases corresponding to the test point at the end node includes: editing the test design and test cases corresponding to the lower-level sub-test points at the end node, wherein one lower-level sub-test point corresponds to one test design and one test case.
[0117] Optionally, if the document template includes the identification positions of the tracking table, the use case table, the design table, and the statistics table, the generation unit 902 is specifically used for:
[0118] Based on the target mind map, determine the test case requirement relationship between test cases and test requirements; and generate a requirement traceability table based on the test case requirement relationship.
[0119] Count the number of test cases in the target mind map; generate a statistical table based on the count.
[0120] Fill the demand tracking table at the marked position;
[0121] At the designated location in the test case table, populate the table with the test cases;
[0122] Fill the test design table at the designated location in the design table;
[0123] Fill the statistical table at the designated location;
[0124] The test document was obtained.
[0125] Optionally, the generation unit 902 is further configured to: adjust the document chapter order according to the hierarchical relationship of test requirements, test points, subtest points, test cases and test designs in the target mind map, so that the chapter logic of the adjusted document is the same as the test process.
[0126] Optionally, the device 900 further includes a storage unit for storing the target mind map. The saved test cases include the project name, hierarchical relationship, test points, test design, test cases, expected execution results, execution defects, and actual execution results.
[0127] If the document template includes the identification positions of the tracking table, the use case table, the design table, and the statistics table, the generation unit 902 is specifically used for:
[0128] From the saved test cases, obtain the test case requirement relationship between the test case and the test requirements, and obtain the requirement traceability table; wherein, the requirement traceability table includes test item description, category, requirement traceability number and requirement item description;
[0129] Count the number of test cases in the saved test cases; generate a statistical table based on the count; the statistical table includes the function corresponding to the test cases, the total number of test cases, the number of executed test cases, the number of passed test cases, the number of failed test cases, and the number of unexecuted test cases;
[0130] Fill the demand tracking table at the marked position;
[0131] At the designated location in the test case table, populate the table with the test cases;
[0132] Fill the test design table at the designated location in the design table;
[0133] Fill the statistical table at the designated location;
[0134] Generate the test document.
[0135] Optionally, the step of counting the number of test cases in the target mind map includes:
[0136] If a test case has a single child node following its corresponding node, the test case is considered not executed.
[0137] If a test case has two child nodes after its corresponding node, the test case is considered executed and passed.
[0138] If a test case has three child nodes after its corresponding node, the test case is considered executed but failed.
[0139] If a test case has n child nodes after its corresponding node, the test case is considered to have a test case writing error; where n is an integer greater than 3.
[0140] In summary, this device, through the mind map node arrangement provided in the editing window, can hierarchically break down test projects. This approach helps testers more clearly control the test coverage, reduces the risk of missing test cases, and improves the accuracy of document generation. Based on the document template and the target mind map, test design documents and test case documents are generated, with a requirement traceability table generated within the test design document. Since both the test design document and the test case document originate from the same target mind map, this method avoids the information fragmentation problem of traditional scattered documents, creating a strong correlation between test design, test requirements, and test cases, thus facilitating efficient traceability.
[0141] According to the method provided in the embodiments of this application, this application also provides a chip system, which includes one or more processors for calling and executing instructions stored in memory, thereby causing the method described in the embodiments of this application to be executed. The chip system may be composed of chips or may include chips and other discrete devices.
[0142] The chip system may include input circuits or interfaces for transmitting information or data, and output circuits or interfaces for receiving information or data.
[0143] According to the method provided in the embodiments of this application, this application also provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to execute the various steps or processes executed by the network device or terminal device in any of the foregoing method embodiments.
[0144] According to the method provided in the embodiments of this application, this application also provides a computer-readable storage medium storing program code, which, when run on a computer, causes the computer to execute the various steps or processes executed by the network device or terminal device in any of the foregoing method embodiments.
[0145] The computer-readable storage medium may be the aforementioned volatile memory or non-volatile memory, or it may include both volatile memory and non-volatile memory.
[0146] In the embodiments of this application, the terms and English abbreviations are exemplary examples given for ease of description and should not be construed as limiting the application in any way. This application does not preclude the possibility of defining other terms that can achieve the same or similar functions in existing or future agreements.
[0147] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated.
[0148] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
Claims
1. A method of generating a document, characterized by, The generation method comprises: In response to an editing operation in an editing window, a target mind map of configuration software is acquired; The editing window comprises a root node, a first-level child node, a second-level child node, and a terminal node, a name of a current test item is edited in the root node, test requirements of the current test item are edited in the first-level child node, test points split from the test requirements are edited in the second-level child node, and test design and test cases corresponding to the test points are edited in the terminal node; According to the target mind map and a pre-imported document template, a test document is generated; the test document comprises a test design document and a test case document, and the test design document comprises a test requirement tracking table; The document template comprises a first filling position, a second filling position, and a third filling position; in the first filling position, a target hierarchical relationship in the target mind map is filled, the target hierarchical relationship indicating a hierarchical relationship between test requirements, test points split from the test requirements, test design corresponding to the test points, and test cases; in the second filling position, test cases in the target mind map are filled; and in the third filling position, test design in the target mind map is filled.
2. The generation method of claim 1, wherein, If the test points are split into upper-level sub-test points, the upper-level sub-test points are split into current-level sub-test points, and the current-level sub-test points are split into lower-level sub-test points, the editing window further comprises upper-level third-level child nodes, current-level third-level child nodes, and lower-level third-level child nodes, and the method further comprises: The upper-level sub-test points are edited in the upper-level third-level child nodes, the current-level sub-test points are edited in the current-level third-level child nodes, and the lower-level sub-test points are filled in the lower-level third-level child nodes; and the target mind map further comprises edited third-level child nodes; The editing, in the terminal node, of test design and test cases corresponding to the test points comprises editing, in the terminal node, test design and test cases corresponding to the lower-level sub-test points, wherein one lower-level sub-test point corresponds to one test design and one test case.
3. The generation method of claim 1, wherein, If the document template comprises a tracking table identifier position, a test case table identifier position, a design table identifier position, and a statistical table identifier position, the generation of the test document according to the target mind map and the pre-imported document template comprises: A test case requirement relationship between test cases and test requirements is determined according to the target mind map, and a requirement tracking table is generated according to the test case requirement relationship; The number of test cases in the target mind map is counted, and a statistical table is generated according to the counted number; The requirement tracking table is filled in the tracking table identifier position; The table of test cases is filled in the test case table identifier position; The table of test design is filled in the design table identifier position; The statistical table is filled in the statistical table identifier position; The test document is obtained.
4. The generation method of claim 3, wherein, The method further comprises: According to the hierarchical relationship of test requirements, test points, sub-test points, test cases, and test design in the target mind map, the order of chapters of the document is adjusted, so that the logical order of chapters of the adjusted document is the same as a test flow.
5. The generation method of claim 1, wherein, The method further comprises: The target mind map is stored, and the saved test case includes a project name, a hierarchical relationship, a test point, a test design, a test case, an expected execution result, an execution defect, and an actual execution result.
6. The generation method of claim 5, wherein, If the document template includes a tracking table identification position, a use case table identification position, a design table identification position, and a statistical table identification position, the test document is generated according to the target mind map and the pre-imported document template, and includes: From the saved test case, the use case requirement relationship between the test case and the test requirement is obtained, and a requirement tracking table is obtained; wherein the requirement tracking table includes test item description, classification, requirement tracking number, and requirement item description; The number of test cases in the saved test case is counted; and a statistical table is generated according to the counted number; the statistical table includes the corresponding function of the test case, the total number of test cases, the number of executed cases, the number of passed cases, the number of failed cases, and the number of unexecuted cases; The requirement tracking table is filled in the tracking table identification position; The table of the test case is filled in the use case table identification position; The table of the test design is filled in the design table identification position; The statistical table is filled in the statistical table identification position; The test document is generated.
7. The generation method according to claim 3 or 6, characterized in that, The number of test cases in the target mind map is counted, including: If there is a single child node after the node corresponding to the test case, the test case is counted as unexecuted; If there are two child nodes after the node corresponding to the test case, the test case is counted as executed and passed; If there are three child nodes after the node corresponding to the test case, the test case is counted as executed and failed; If there are n child nodes after the node corresponding to the test case, the test case is counted as a use case writing error; n is an integer greater than 3.
8. A document generating apparatus characterized by comprising: The device includes: An editing unit for obtaining a target mind map of configuration software in response to an editing operation in an editing window; The editing window includes a root node, a first-level child node, a second-level child node, and a terminal node. The name of the current test project is edited in the root node, the test requirement of the current test project is edited in the first-level child node, the test point split from the test requirement is edited in the second-level child node, and the test design and test case corresponding to the test point are edited in the terminal node; A generation unit for generating a test document according to the target mind map and a pre-imported document template; the test document includes a test design document and a test case document, and the test design document includes a test requirement tracking table; The document template includes a first filling position, a second filling position, and a third filling position; the target hierarchical relationship in the target mind map is filled in the first filling position, the target hierarchical relationship indicating the hierarchical relationship between the test requirement, the test point split from the test requirement, the test design corresponding to the test point, and the test case; the test case in the target mind map is filled in the second filling position; and the test design in the target mind map is filled in the third filling position.
9. An electronic device, comprising: A memory for storing a computer program; a processor for executing the computer program to implement the method of any of claims 1-7.
10. A readable storage medium, characterized by, a computer program product for saving a computer program, wherein the computer program, when executed by a processor, implements the method of any of claims 1-7.
Citation Information
Patent Citations
Method for converting test case based on Xmind mind map
CN113094288A
Method and device for automatically generating test case based on mind mapping tool paradigm and medium
CN117407306A
Method and system for creating and executing test case in mind mapping mode and electronic equipment
CN117472728A
Method and apparatus for batch generation of test cases and computing device
WO2025107595A1