A test report generation method, device, equipment, electronic medium and product
By automatically identifying and structuring the target report template, an editable test report is generated, solving the problems of poor template adaptability and cumbersome content modification. This enables efficient generation and convenient editing of custom reports, improving the adaptability and efficiency of test reports.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2026-03-23
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, test report generation templates cannot flexibly adapt to customized needs, resulting in low matching degree between the generated report content and the actual test scenario, and the modification of report content is cumbersome and inefficient.
By automatically identifying the target report template, a dynamic target template is generated that retains only the template structure, and the populated data is processed into editable structured data, allowing testers to easily edit and modify the report during the report generation process.
It achieves high efficiency and flexibility in the report generation process, simplifies content modification and structural adjustment, improves the efficiency of report generation and revision, and enhances the practicality and maintainability of test reports.
Smart Images

Figure CN122364072A_ABST
Abstract
Description
Technical Field
[0001] This disclosure generally relates to the field of data processing technology, and more particularly to a method, apparatus, device, electronic medium, and product for generating test reports. Background Technology
[0002] With the rapid development of the software testing industry and the increasing complexity of software products, test reports, which are documents used to describe the test results of software and hardware systems, have become key factors affecting the progress of software testing.
[0003] In related technologies, fixed or semi-fixed report templates are typically used, supporting only a limited number of chapter modules. This lack of flexibility in adapting to customized report template styles leads to low relevance between the generated report content and the actual testing scenarios. Furthermore, testers cannot easily edit or modify the content during report generation. If adjustments are needed, the original data source must be modified and the entire report regenerated, or manual modifications must be made to the final generated report. This results in cumbersome operations and low efficiency. Summary of the Invention
[0004] This disclosure addresses some deficiencies mentioned in the background art by providing a method, apparatus, device, electronic medium, and product for generating test reports.
[0005] In a first aspect, embodiments of this disclosure provide a method for generating a test report, comprising: Determine the target report template and test data corresponding to the target test; The target report template is identified to obtain the target dynamic template for the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; Based on the test data and the target dynamic template, fill data with a format and content that match the actual fill content is generated; Based on the target dynamic template, the filling data is processed in a structured manner to obtain the editable target structured data corresponding to the actual filling content. The target structured data is combined with the target dynamic template to obtain a target test report, and the target test report is displayed on the display interface.
[0006] In one embodiment of the first aspect, identifying the target report template to obtain the target dynamic template for the target test includes: The target report template is read to determine its chapter framework and chapter structure. The chapter content in the chapter structure is identified to obtain the actual content to be filled in the target report template; Based on the content format type corresponding to the actual content being filled, placeholders are generated for each of the content format types. Based on the chapter framework, the chapter structure, and the placeholders, a target dynamic template for the target test is determined; wherein, the placeholders are used to replace the actual filled content.
[0007] In one embodiment of the first aspect, generating fill data that matches the format and content of the actual fill content based on the test data and the target dynamic template includes: A test domain knowledge base is determined to belong to the target test; wherein, the test domain knowledge base includes the key indicators of the target test and the calculation methods corresponding to each key indicator; Based on the content format type corresponding to each of the actual fill contents, determine the corresponding data processing strategy for each actual fill content location; Based on the data processing and measurement, the test domain knowledge base, and the test data, fill data with a format and content that matches the actual fill content is obtained.
[0008] In one embodiment of the first aspect, the step of processing the data based on the data processing strategy, the test domain knowledge base, and the test data to obtain filling data with a structure and content consistent with the actual filling content includes: The data processing strategy is used to perform text processing on the test domain knowledge base and the test data to obtain the filling data corresponding to the actual filling content; wherein, the text processing includes, but is not limited to: text imitation and indicator calculation.
[0009] In one embodiment of the first aspect, the step of performing structured processing on the fill data based on the target dynamic template to obtain the target structured data corresponding to the actual fill content includes: The filling data is structured according to the chapter hierarchy and content order in the target dynamic template to obtain the initial structure data; The initial structure data is visualized and rendered to obtain target structured data that can be edited on the front end.
[0010] In one embodiment of the first aspect, the step of combining the target structured data with the target dynamic template to obtain a target test report, and controlling the display of the target test report on the display interface, includes: Traverse the target structured data to generate a data index for the target dynamic template; Traverse the target dynamic template to determine the content elements within it; The content of the target file is determined in the data index by the content elements; The target file content is visualized to obtain the target test report, and the target test report is displayed on the display interface.
[0011] In a second aspect, embodiments of this disclosure provide a test report generation apparatus, comprising: The determination module is used to determine the target report template and test data corresponding to the target test; The identification module is used to identify the target report template to obtain the target dynamic template of the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; The generation module is used to generate filling data with a format and content that matches the actual filling content, based on the test data and the target dynamic template. The processing module is used to perform structured processing on the filling data based on the target dynamic template to obtain editable target structured data corresponding to the actual filling content. The module combines the target structured data with the target dynamic template to obtain a target test report, and controls the display of the target test report on the display interface.
[0012] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement a method for generating a test report.
[0013] In a fourth aspect, a computer-readable storage medium is provided having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of a method for generating a test report.
[0014] In a fifth aspect, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement steps of a method for generating a test report.
[0015] As will be described in detail below, a method, apparatus, device, electronic medium, and product for generating test reports according to embodiments of this disclosure are disclosed. By automatically identifying a target report template and generating a dynamic target template that retains only the template structure, various custom report styles can be flexibly adapted. This solves the problem in related technologies where fixed templates cannot adapt to diverse needs, improving the adaptability and flexibility of report generation. Simultaneously, by processing the fill data into editable target structured data, the convenience of manual editing and modification during report generation is achieved, avoiding the tedious operation of regenerating the entire report after modifying the original data or manually modifying the physical report, thus improving the efficiency of report generation and revision.
[0016] This disclosure specifically addresses the problems of poor report template adaptability, cumbersome content modification, and low generation efficiency in related technologies. It can efficiently adapt to the custom report format requirements of different testing scenarios, and supports testers to easily complete content correction and structural adjustment during the report generation process. It effectively makes up for the problems of traditional test report generation methods that rely on manual labor, have weak adaptability, and low efficiency, and improves the practicality and maintainability of test reports. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a method for generating a test report as provided in this embodiment of the disclosure; Figure 2 A schematic diagram of a target dynamic template for a test report generation method provided in this embodiment of the disclosure; Figure 3 A schematic diagram illustrating the display of target structured data on a webpage for a test report generation method provided in this embodiment of the present disclosure; Figure 4 A schematic diagram of a test report generation apparatus provided in an embodiment of this disclosure; Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0018] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present disclosure and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the drawings, not the entire structure.
[0019] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0020] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0021] Research has found that with the rapid development of the software testing industry and the increasing complexity of software products, test reports, which are documents used to describe the test results of software and hardware systems, have become key factors affecting the progress of software testing.
[0022] In related technologies, fixed or semi-fixed report templates are typically used, supporting only a limited number of chapter modules. This lack of flexibility in adapting to customized report template styles leads to low relevance between the generated report content and the actual testing scenarios. Furthermore, testers cannot easily edit or modify the content during report generation. If adjustments are needed, the original data source must be modified and the entire report regenerated, or manual modifications must be made to the final generated report. This results in cumbersome operations and low efficiency.
[0023] Based on the above research, this disclosure provides a method for generating test reports. By automatically identifying the target report template and generating a dynamic target template that retains only the template structure, it can flexibly adapt to various custom report styles. This solves the problem in related technologies where fixed templates cannot adapt to diverse needs, improving the adaptability and flexibility of report generation. Simultaneously, by processing the fill data into editable target structured data, it enables convenient manual editing and modification during report generation, avoiding the tedious operation of regenerating the entire report after modifying the original data or manually modifying the entity report, thus improving the efficiency of report generation and revision.
[0024] This disclosure specifically addresses the problems of poor report template adaptability, cumbersome content modification, and low generation efficiency in related technologies. It can efficiently adapt to the custom report format requirements of different testing scenarios, and supports testers to easily complete content correction and structural adjustment during the report generation process. It effectively makes up for the problems of traditional test report generation methods that rely on manual labor, have weak adaptability, and low efficiency, and improves the practicality and maintainability of test reports.
[0025] To facilitate understanding of this embodiment, a method for generating a test report disclosed in this disclosure will first be described in detail. The execution entity of the test report generation method provided in this disclosure is generally an electronic device with a certain computing capability. In some possible implementations, the test report generation method can be implemented by a processor calling computer-readable instructions stored in memory.
[0026] Figure 1 The diagram shows a flowchart of a test report generation method provided in this embodiment of the present disclosure. The method includes steps S101 to S105, wherein: S101. Determine the target report template and test data corresponding to the target test.
[0027] In the embodiments of this disclosure, the target report template is a Word format test report template corresponding to the target test, which can be determined based on historical experience.
[0028] Here, the test data includes information such as the test plan, functional requirements, and test tasks corresponding to the target test.
[0029] S102. Identify the target report template to obtain the target dynamic template for the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content.
[0030] In the embodiments of this disclosure, when the processing platform is a Java platform, the target report template can be identified through the Apache POI library to obtain the target dynamic template for the target test.
[0031] Here, the Apache POI library can be used to convert the target report template into a dynamic target template with placeholders. The placeholders are positioned where the actual content of the target report template would be filled.
[0032] The actual content to be filled in here includes, but is not limited to: text content, table content, and image content.
[0033] S103. Based on the test data and the target dynamic template, generate fill data with a format and content that match the actual fill content.
[0034] In the embodiments of this disclosure, the test data includes static data and dynamic data. The static data does not change as the target test progresses, while the dynamic data changes as the target test progresses.
[0035] Here, static information (i.e., the textual information of the target test) can be determined through the test plan, such as the background, purpose, test environment, test tools, and test methods of the target test.
[0036] Here, dynamic data can be determined through test tasks, such as test case execution data, test defect data, and other data generated during the testing process.
[0037] Here, based on the test data, fill data can be generated to fill the placeholder positions (i.e., the actual fill content positions) in the target dynamic template mentioned above.
[0038] S104. Based on the target dynamic template, perform structured processing on the fill data to obtain editable target structured data corresponding to the actual fill content.
[0039] In embodiments of this disclosure, the aforementioned filler data can be assembled into target structured data according to a tree structure. The target structured data can be JSON-formatted structured data.
[0040] Here, the target structured data can be displayed on the webpage in an editable format. Testers can proofread, modify, and add attachments to the target structured data to obtain the modified structured data. The modified structured data can be persistently stored using the page's save function.
[0041] S105. Combine the target structured data with the target dynamic template to obtain the target test report, and control the display of the target test report on the display interface.
[0042] In the embodiments of this disclosure, target structured data can be filled into the placeholder positions of the target dynamic template according to the actual filling content, so as to replace the placeholders to generate the target test report.
[0043] Here, after the target test report is determined, it can be visualized and then displayed on the display interface.
[0044] Testers can modify, save, or export the target test report based on the test data in the real-world interface.
[0045] In the embodiments of this disclosure, firstly, the target report template and test data corresponding to the target test are determined; secondly, the target report template is identified to obtain the target dynamic template of the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; secondly, based on the test data and the target dynamic template, fill data that matches the structure and content corresponding to the actual fill content is generated; secondly, based on the target dynamic template, the fill data is structured to obtain editable target structured data corresponding to the actual fill content; finally, the target structured data is combined with the target dynamic template to obtain the target test report, and the target test report is controlled to be displayed on the display interface.
[0046] In the above embodiments, by automatically identifying the target report template and generating a dynamic target template that retains only the template structure, various custom report styles can be flexibly adapted. This solves the problem in related technologies where fixed templates cannot adapt to diverse needs, improving the adaptability and flexibility of report generation. Simultaneously, by processing the fill data into editable target structured data, the process of manual editing and modification during report generation is made convenient, avoiding the tedious operation of regenerating the entire report after modifying the original data or manually modifying the physical report, thus improving the efficiency of report generation and revision.
[0047] This disclosure specifically addresses the problems of poor report template adaptability, cumbersome content modification, and low generation efficiency in related technologies. It can efficiently adapt to the custom report format requirements of different testing scenarios, and supports testers to easily complete content correction and structural adjustment during the report generation process. It effectively makes up for the problems of traditional test report generation methods that rely on manual labor, have weak adaptability, and low efficiency, and improves the practicality and maintainability of test reports.
[0048] In one optional implementation, the target report template is identified to obtain a dynamic target template for the target test, specifically including the following steps: First, the target report template is read to determine its chapter framework and chapter structure; Secondly, the chapter content in the chapter structure is identified to obtain the actual content to be filled in the target report template; Secondly, based on the content format type corresponding to the actual content being filled, placeholders for each content format type are generated; Finally, based on the chapter framework, chapter structure, and placeholders, the target dynamic template for the target test is determined; among them, placeholders are used to replace the actual content to be filled.
[0049] In the embodiments of this disclosure, the chapter framework and chapter structure of the target report template can be obtained by identifying the chapter title style and extracting the title text at each level.
[0050] Here, by reading the chapter paragraphs in the chapter structure, the content format type of each paragraph can be identified to obtain the actual content to be filled in the target report template and the position index of the actual content within the target report template. The content format types include, but are not limited to: text, tables, and images.
[0051] Here, the position of the actual content to be filled in the target report template can be identified by the chapter position index. For example, the position index of the actual content to be filled can be determined by the chapter number of the actual content to be filled in the target report template, that is, by using the chapter title + node number.
[0052] Here, a unique placeholder can be generated at the corresponding position of each actual fill content based on the content format type of each actual fill content.
[0053] The placeholders for different content format types have different suffixes. For example, placeholder keyword = chapter identifier + node number + type suffix; placeholder = {{placeholder keyword}}. The type suffix indicates the content format type corresponding to the placeholder.
[0054] Here, placeholders can be used to replace the actual content in the chapter structure, and combined with the chapter framework and the replaced chapter structure, a target dynamic template for the target test can be generated.
[0055] Reference Figure 2 The diagram shown is a schematic representation of a target dynamic template for a test report generation method provided in this embodiment of the present disclosure, wherein: "4. Summary and Analysis", "4.1 Test Conclusions", and "4.2 Improvement Suggestions" are chapter titles within the chapter framework. Among them, "4. Summary and Analysis" is a first-level chapter title; "4.1 Test Conclusions" and "4.2 Improvement Suggestions" are second-level chapter titles.
[0056] The content within “{{}}” is a placeholder.
[0057] Here, such as " As shown in the figure, “Test Conclusion” is the chapter identifier, 1 is the node number, and text is the type suffix.
[0058] Among them, text corresponds to the content format type of text, table corresponds to the content format type of table, and pic corresponds to the content format type of image.
[0059] In an optional implementation, based on test data and the target dynamic template, fill data with a format and content that matches the actual fill content is generated, specifically including the following steps: First, determine the test domain knowledge base of the target test domain; the test domain knowledge base includes the key indicators of the target test and the calculation methods for each key indicator; Secondly, based on the content format type corresponding to each actual content to be filled, determine the corresponding data processing strategy for each actual content to be filled. Finally, based on data processing and measurement, the test domain knowledge base, and test data, the filling data is processed to obtain filling data that matches the format and content of the actual filling content.
[0060] In the embodiments of this disclosure, key metrics of the testing domain to which the target test belongs can be determined. These key metrics include, but are not limited to, defect density, test coverage, and throughput.
[0061] Then, the calculation methods for the key indicators can be determined. For example, defect density = number of defects / number of function points, test coverage = (tested function points / total function points) × 100%, etc.
[0062] Afterwards, the key indicators and their corresponding calculation methods can be classified and organized to obtain a test domain knowledge base for the target test domain.
[0063] Here, when the actual content to be filled is text, the data processing strategy meets the following conditions: preprocess the text, perform feature extraction and model training, and fine-tune the pre-trained model on the dataset of specific nouns for the target test to identify paragraph keywords, and then combine the test results to perform content imitation.
[0064] Here, when the actual content to be filled is in the form of indicator data, the data processing strategy meets the following conditions: based on the indicator definition identified above, the data is recalculated in combination with the test domain knowledge base and the test situation.
[0065] Here, when the actual content to be filled is in a table format, the data processing strategy meets the following conditions: extract the header content, and then determine whether each cell content is text or data.
[0066] Here, based on data processing strategies, a test domain knowledge base, and test data, the data is processed to obtain filling data with a structure and content that matches the actual filling content. Specifically, the steps include: By using data processing strategies to perform text processing on the test domain knowledge base and test data, the corresponding fill data at the actual fill content locations is obtained; among which, text processing includes, but is not limited to: text paraphrasing and indicator calculation.
[0067] In one optional implementation, the data to be filled is structured based on the target dynamic template to obtain the target structured data corresponding to the actual content to be filled. This includes the following steps: First, the data to be filled is structured according to the chapter hierarchy and content order in the target dynamic template to obtain the initial structure data; Then, the initialized structured data is visualized and rendered to obtain the target structured data that can be edited on the front end.
[0068] In the embodiments of this disclosure, firstly, a tree-structured Module data model can be created using the chapter hierarchy of the target dynamic template as the skeleton, so as to perform structured processing on the fill data and obtain the initial structure data.
[0069] Here, each chapter in the target dynamic template can be mapped to an independent Module node. Each Module node contains a name field to represent the chapter title, a content field to store the content to be filled in under the chapter, and a children field to store the sub-chaps.
[0070] The name field is the chapter title of the target dynamic template.
[0071] The `content` field contains chapter content. It is an array type, and each array element can store one paragraph of content. The content can be set to text, table, image, or file type, etc.
[0072] The `children` field represents the sub-chaps, which are arrays, with each array element being a Module, forming a tree structure.
[0073] Here, according to the hierarchical relationship of chapters in the target dynamic template, the Module node of the child chapter can be attached to the children field of the parent chapter Module node to build a chapter hierarchy tree that is completely consistent with the target dynamic template.
[0074] Specifically, the populated data can be encapsulated according to the display order of the content nodes in each chapter of the target dynamic template, and stored in the content field of the corresponding chapter Module node in sequence to obtain the initial structure data.
[0075] Here, the initialization structure data is in a standardized JSON format, which fully preserves the chapter structure and content order of the target dynamic template, only replacing the placeholders with the corresponding fill data.
[0076] Here, the initialization structure data can be parsed into a Module tree structure, and then visualized and rendered in the front-end interface according to the chapter hierarchy: the first-level chapters are displayed in the form of a top-level directory, the second-level and lower-level chapters are displayed in the form of indented subdirectories, and the content objects under each chapter are rendered as interactive elements such as text paragraphs, tables, and image placeholders in the order of the content field.
[0077] Here, after rendering is complete, editing and interactive entry points can be provided for each chapter's module nodes and content objects: testers can directly modify text content, edit table cell data, replace image files, add or delete chapters, adjust chapter order, or add / delete content objects within chapters and adjust the display order of content objects. (Refer to...) Figure 3 The diagram shown illustrates the display of target structured data on a webpage in a test report generation method provided by an embodiment of this disclosure.
[0078] Here, when testers complete editing and trigger the save operation, the edited Module tree structure can be reserialized into standardized JSON format data, which is the target structured data. The target structured data inherits the tree structure and format specifications of the initial structured data, and also includes the manually edited content and structural information. It can be persistently stored in the database, supporting subsequent version rollback and entity report generation.
[0079] In an optional implementation, the target structured data is combined with the target dynamic template to obtain a target test report, and the target test report is controlled to be displayed on the display interface, specifically including the following steps: First, traverse the target structured data to generate a data index for the target dynamic template; Secondly, traverse the target dynamic template to determine the content elements within the target dynamic template; Secondly, the content of the target file is determined by the content elements in the data index; Finally, the target file content is visualized to obtain the target test report, and the target test report is displayed on the display interface.
[0080] In the embodiments of this disclosure, the tree-like module structure of the target structured data can be traversed, and a data index in the form of key-value pairs can be constructed using the unique identifier of each placeholder in the target dynamic template as the key and the corresponding filling content in the target structured data as the value.
[0081] Here, you can use a document manipulation library (such as Apache POI) to traverse all content nodes of the target dynamic template, identify and locate all content elements in the form of placeholders enclosed in double brackets {{}}.
[0082] This allows recording the position information of each content element in the target dynamic template, the corresponding placeholder identifier, and the content type suffix (such as _text, _table, _pic), ensuring that subsequent replacement operations can accurately locate the target position and execute the corresponding visual rendering logic according to the content type.
[0083] Here, the placeholder identifier corresponding to each content element can be extracted. Using this identifier as the query key, a matching query can be performed in the generated data index to obtain the target file content corresponding to the content element.
[0084] Here, if the placeholder identifier has a match in the data index, the corresponding value is extracted as the content of the target file; if no match is found, the placeholder is retained or the default content is filled in to ensure the structural integrity of the target dynamic template.
[0085] Here, the target file content corresponding to each content element can be replaced with the original placeholders according to their position information in the target dynamic template, while retaining the original format style of the target dynamic template (such as font, line spacing, table style, chapter level, etc.), and a target test report can be generated after visualization processing.
[0086] The generated target test report can be rendered to the front-end display interface, displaying the complete report content in a "what you see is what you get" format, and supporting testers to perform operations such as viewing, partial modification, saving or exporting on the interface.
[0087] Here, the target test report is linked to the target structured data. If the tester modifies the report content in the display interface, the modified information can be synchronously updated to the target structured data and persistently stored, realizing closed-loop management of the report.
[0088] The above-described implementation method has the following technical effects in actual implementation: (1) By identifying the uploaded target report template, performing chapter structure analysis, chapter content understanding, and generating new text in combination with test data, dynamic and flexible dynamic templates are realized.
[0089] (2) By generating structured data in the report, testers can interact in the intermediate stages to update the test report, correct the content, and backtrack the version.
[0090] Based on the same inventive concept, this disclosure also provides a test report generation device corresponding to the test report generation method. Since the principle of the device in this disclosure for solving the problem is similar to the test report generation method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0091] Reference Figure 4 The diagram shown is a schematic of a test report generation device provided in an embodiment of this disclosure, including: a determining module 41, an identifying module 42, a generating module 43, a processing module 44, and a combining module 45; wherein: The determination module is used to determine the target report template and test data corresponding to the target test; The identification module is used to identify the target report template to obtain the target dynamic template of the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; The generation module is used to generate filling data with a format and content that matches the actual filling content, based on the test data and the target dynamic template. The processing module is used to perform structured processing on the filling data based on the target dynamic template to obtain editable target structured data corresponding to the actual filling content. The module combines the target structured data with the target dynamic template to obtain a target test report, and controls the display of the target test report on the display interface.
[0092] This embodiment automatically identifies the target report template and generates a dynamic target template that retains only the template structure, allowing for flexible adaptation to various custom report styles. This solves the problem in related technologies where fixed templates cannot adapt to diverse needs, improving the adaptability and flexibility of report generation. Simultaneously, by processing the fill data into editable target structured data, it facilitates manual editing and modification during report generation, avoiding the tedious operation of regenerating the entire report after modifying the original data or manually modifying the physical report, thus improving the efficiency of report generation and revision.
[0093] This disclosure specifically addresses the problems of poor report template adaptability, cumbersome content modification, and low generation efficiency in related technologies. It can efficiently adapt to the custom report format requirements of different testing scenarios, and supports testers to easily complete content correction and structural adjustment during the report generation process. It effectively makes up for the problems of traditional test report generation methods that rely on manual labor, have weak adaptability, and low efficiency, and improves the practicality and maintainability of test reports.
[0094] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0095] Corresponding to Figure 1 The present disclosure also provides an electronic device 500, such as a method for generating test reports. Figure 5The diagram shown is a structural schematic of an electronic device 500 provided in an embodiment of this disclosure, including: The system includes a processor 51, a memory 52, and a bus 53. The memory 52 stores execution instructions and includes main memory 521 and external memory 522. The main memory 521, also called internal memory, temporarily stores the computational data in the processor 51, as well as data exchanged with external memory such as a hard disk. The processor 51 exchanges data with the external memory 522 through the main memory 521. When the electronic device 500 is running, the processor 51 communicates with the memory 52 through the bus 53, causing the processor 51 to execute the following instructions: Determine the target report template and test data corresponding to the target test; The target report template is identified to obtain the target dynamic template for the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; Based on the test data and the target dynamic template, fill data with a format and content that match the actual fill content is generated; Based on the target dynamic template, the filling data is processed in a structured manner to obtain the editable target structured data corresponding to the actual filling content. The target structured data is combined with the target dynamic template to obtain a target test report, and the target test report is displayed on the display interface.
[0096] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0097] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0098] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.
[0099] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.
[0100] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.
[0101] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0102] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for generating a test report, characterized in that, include: Determine the target report template and test data corresponding to the target test; The target report template is identified to obtain the target dynamic template for the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; Based on the test data and the target dynamic template, fill data with a format and content that match the actual fill content is generated; Based on the target dynamic template, the filling data is processed in a structured manner to obtain the editable target structured data corresponding to the actual filling content. The target structured data is combined with the target dynamic template to obtain a target test report, and the target test report is displayed on the display interface.
2. The method as described in claim 1, characterized in that, The step of identifying the target report template to obtain the target dynamic template for the target test includes: The target report template is read to determine its chapter framework and chapter structure. The chapter content in the chapter structure is identified to obtain the actual content to be filled in the target report template; Based on the content format type corresponding to the actual content being filled, placeholders are generated for each of the content format types. Based on the chapter framework, the chapter structure, and the placeholders, a target dynamic template for the target test is determined; wherein, the placeholders are used to replace the actual filled content.
3. The method as described in claim 1, characterized in that, The step of generating fill data that matches the format and content of the actual fill content based on the test data and the target dynamic template includes: A test domain knowledge base is determined to belong to the target test; wherein, the test domain knowledge base includes the key indicators of the target test and the calculation methods corresponding to each key indicator; Based on the content format type corresponding to each of the actual fill contents, determine the corresponding data processing strategy for each actual fill content location; Based on the data processing and measurement, the test domain knowledge base, and the test data, fill data with a format and content that matches the actual fill content is obtained.
4. The method as described in claim 3, characterized in that, The process of processing data based on the data processing strategy, the test domain knowledge base, and the test data to obtain filling data with a structure and content that matches the actual filling content includes: The data processing strategy is used to perform text processing on the test domain knowledge base and the test data to obtain the filling data corresponding to the actual filling content; wherein, the text processing includes, but is not limited to: text imitation and indicator calculation.
5. The method as described in claim 1, characterized in that, The step of performing structured processing on the fill data based on the target dynamic template to obtain the target structured data corresponding to the actual fill content includes: The filling data is structured according to the chapter hierarchy and content order in the target dynamic template to obtain the initial structure data; The initial structure data is visualized and rendered to obtain target structured data that can be edited on the front end.
6. The method as described in claim 1, characterized in that, The step of combining the target structured data with the target dynamic template to obtain a target test report, and controlling the display of the target test report on the display interface, includes: Traverse the target structured data to generate a data index for the target dynamic template; Traverse the target dynamic template to determine the content elements within it; The content of the target file is determined in the data index by the content elements; The target file content is visualized to obtain the target test report, and the target test report is displayed on the display interface.
7. A test report generation apparatus, characterized in that, include: The determination module is used to determine the target report template and test data corresponding to the target test; The identification module is used to identify the target report template to obtain the target dynamic template of the target test; wherein, the target dynamic template is used to indicate the template structure in the target report template that does not contain actual fill content; The generation module is used to generate filling data with a format and content that matches the actual filling content, based on the test data and the target dynamic template. The processing module is used to perform structured processing on the filling data based on the target dynamic template to obtain editable target structured data corresponding to the actual filling content. The module combines the target structured data with the target dynamic template to obtain a target test report, and controls the display of the target test report on the display interface.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 6.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 6.