Test report generation method and device, equipment and medium
By constructing preset indicator templates and automatically filtering and filling data, the problem of manual intervention under static template structures is solved, and efficient and accurate test report generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CSC FINANCIAL CO LTD
- Filing Date
- 2025-12-01
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the test report generation method based on static template structures requires a large amount of manual intervention, resulting in high testing time costs, increased repetitive work, and reduced report generation efficiency and accuracy of conclusions.
Build test report templates, preset multiple indicator templates and scenario identifiers, identify scenario identifiers through preset test cases, automatically filter and populate indicator data, and generate target test reports.
It improved the accuracy and reliability of test results, reduced labor costs and overall testing time, decreased repetitive work, and improved report generation efficiency.
Smart Images

Figure CN121958085A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of system testing technology, and more specifically, to a test report generation method, apparatus, equipment, and medium. Background Technology
[0002] In the field of system testing, test reports are often generated using static template structures and manually filled indicator placeholders. Due to the lack of structural flexibility of static templates and the fixed nature of indicator placeholders, manual intervention is required to truncate test data, fill in a large amount of indicator data and charts, and manually modify test report data. This leads to some foreseeable risks and problems. For example, manually filling in indicator data, images, and tables in the test report template increases the overall testing time cost, increases repetitive work for testers, and reduces report generation efficiency. Modifying existing templates often requires the intervention of technical personnel to redesign the report layout and adjust the code; this process is tedious and time-consuming, and it's impossible to adjust indicators according to the actual test content, reducing the accuracy and reliability of test conclusions.
[0003] Therefore, it is necessary to find a method to reduce the cost of manual intervention and generate test reports efficiently and quickly. Summary of the Invention
[0004] In view of the above situation, this application provides a test report generation method, apparatus, device and medium, which aims to solve the above problems or at least partially solve the above problems.
[0005] Firstly, this application provides a method for generating a test report, including: A test report template is constructed, which includes multiple preset indicator templates, including scenario indicators and scenario identifiers; Based on preset test cases, the scenario identifier of the scenario to be tested in the test cases is identified, and the indicator template in the test report template is filtered according to the scenario identifier of the scenario to be tested to obtain an initial test report; Based on the test results obtained from the preset test cases, the scene identifiers, scene indicators and their corresponding indicator data in the test results are identified, and the indicator data is filled into the initial test report to generate the target test report.
[0006] For example, the indicator template is constructed based on the jinja2 placeholder format.
[0007] For example, the scenario identifier in the indicator template and the scenario identifier of the scenario to be tested in the test case are set to correspond one-to-one.
[0008] For example, based on the scenario identifier of the scenario to be tested, the indicator templates in the test report template are filtered to obtain an initial test report, including: The scene identifier of the scene to be tested is compared with the scene identifier in the indicator template. An initial indicator template is selected based on the comparison result and is retained in the initial test report.
[0009] For example, based on the scenario identifier of the scenario to be tested, the indicator templates in the test report template are filtered to obtain an initial test report, including: Identify the maximum value of the scene identifier of the scene to be tested, and crop the indicator templates in the indicator templates whose scene identifiers are greater than the maximum value of the scene identifier of the scene to be tested to obtain the initial test report.
[0010] For example, based on preset test cases, test results are obtained, scenario identifiers, scenario metrics, and their corresponding metric data in the test results are identified, and the metric data is filled into the initial test report to generate a target test report, including: Identify the scene identifiers, scene metrics, and their corresponding metric data in the test results; The scene identifiers and scene indicators in the test results are compared with the scene identifiers and scene indicators in the initial test report, and the target indicator template is obtained based on the comparison results. The indicator data is populated into the target indicator template to generate the target test report.
[0011] For example, a target indicator template is obtained based on the comparison results, including: Find the target scene identifier that corresponds to the scene identifier in the test results in the initial test report; The target indicator template is obtained by finding the indicator template that includes the target scene identifier and the scene indicators in the test results in the initial test report.
[0012] Secondly, this application provides a test report generation apparatus, comprising: A construction module is used to build a test report template. The test report template has multiple preset indicator templates, and the indicator templates include scenario indicators and scenario identifiers. The first testing module is used to identify the scene identifier of the scene to be tested in the test cases based on the preset test cases, and to filter the indicator template in the test report template according to the scene identifier of the scene to be tested to obtain an initial test report. The second testing module is used to obtain test results based on preset test cases, identify scene identifiers, scene indicators and their corresponding indicator data in the test results, and fill the indicator data into the initial test report to generate a target test report.
[0013] Thirdly, this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the test report generation method as described in the first aspect.
[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the test report generation method described in the first aspect.
[0015] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: This application allows for the personalized setting of indicators required in each scenario by pre-setting indicator templates. During the testing process, indicators can be removed or removed according to the actual test content, which improves the accuracy and reliability of test conclusions. Moreover, the data filling process is completed automatically, reducing labor costs, reducing the overall testing time cost, alleviating the repetitive work of testers, and improving report generation efficiency. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of an application environment for a test report generation method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a test report generation method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a test report generation device in one embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. 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.
[0018] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the term "comprising" and its variations should be interpreted as open-ended terms meaning "including but not limited to."
[0019] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0020] As mentioned earlier, manually filling in the indicator data, images, and tables in the test report template increases the overall testing time cost, adds repetitive work for testers, and reduces report generation efficiency; it also prevents the removal of indicators according to the actual test content, reducing the accuracy and reliability of test conclusions. To solve this technical problem, this application provides a test report generation method.
[0021] The test report generation method provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the device communicates with the server via a network. The server can construct a test report template from the device. This template includes multiple preset indicator templates, each containing scenario indicators and scenario identifiers. Based on preset test cases, the server identifies the scenario identifiers of the scenarios under test within these test cases and filters the indicator templates in the test report templates according to these identifiers to obtain an initial test report. Based on the test results obtained from the preset test cases, the server identifies the scenario identifiers, scenario indicators, and their corresponding indicator data in the test results and fills the indicator data into the initial test report to generate a target test report. This application, by pre-setting indicator templates, allows for personalized settings of the indicators needed in each scenario. During testing, indicators can be reduced or removed according to the actual test content, improving the accuracy and reliability of test conclusions. Furthermore, the data filling process is automated, reducing manual labor costs, overall testing time costs, and the repetitive work of testers, thus improving report generation efficiency.
[0022] The device side can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server side can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will now be described in detail through specific embodiments.
[0023] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a test report generation method provided in an embodiment of the present invention includes the following steps: S10: Construct a test report template, which includes multiple preset indicator templates, including scenario indicators and scenario identifiers.
[0024] In one embodiment, the indicator template is constructed based on the jinja2 placeholder format.
[0025] In one embodiment, the scenario identifier in the indicator template and the scenario identifier of the scenario to be tested in the test case are set to correspond one-to-one.
[0026] In one embodiment, it is first necessary to determine the maximum number of scenarios in the system test and all possible metrics for each scenario. This allows for initial trimming based on the actual scenarios during subsequent testing, followed by a second trimming based on the metrics, to obtain the final test report. During the subsequent trimming process, the metrics for each scenario are automatically adjusted, allowing for the reduction of metrics according to the actual test content, thus improving the accuracy and reliability of the test conclusions.
[0027] In one embodiment, the metric template uses the Jinja2 placeholder format, standardizing the metrics in the test report with the placeholder "{{metric_i}}", where "{{}}" is the placeholder format, "_" is the separator, "metric" is the specific scenario metric name, "i" is the specific scenario identifier, and "i" is the loop variable. The test report template embeds a metric context structure with a loop variable, including data from tables, test image data, combined text content from the test report, etc., such as {{test duration_1}}, {{test duration_2}}, {{interface test cases_2}}, ..., {{CPU average utilization_i}}, etc. This can be understood as: {{test duration_1}} represents the test duration of scenario 1, {{test duration_2}} represents the test duration of scenario 2, {{interface test cases_2}} represents the interface test cases of scenario 2, and {{CPU average utilization_i}} represents the CPU average utilization of scenario i.
[0028] S20: Based on preset test cases, identify the scene identifier of the scene to be tested in the test cases, and filter the indicator template in the test report template according to the scene identifier of the scene to be tested to obtain an initial test report.
[0029] In one embodiment, during system testing, test cases are parsed based on preset test cases to obtain the scene identifier of the scenario to be tested in the test cases.
[0030] In one embodiment, an initial test report is obtained by filtering the indicator templates in the test report template based on the scene identifier of the scene to be tested. This includes comparing the scene identifier of the scene to be tested with the scene identifiers in the indicator templates, filtering out the initial indicator templates based on the comparison results, and retaining the initial indicator templates in the initial test report. Thus, the test report is first-stage pruning based on the scene identifiers.
[0031] Specifically, the scenarios in the test cases are named "Scenario 1", "Scenario 2", ..., "Scenario i", and the scenario identifiers are "1", "2", ..., "i", which are consistent with the scenario identifiers in the indicator template. The scenario identifiers of the scenario to be tested are compared with the scenario identifiers in the indicator template. For example, if the scenario identifiers of the scenario to be tested are identified as "1", "2", "3", and "4", then "1", "2", "3", and "4" are matched in the indicator template. The matched indicator templates "{{Indicator_1}}", "{{Indicator_2}}", "{{Indicator_3}}", and "{{Indicator_4}}" are retained, while indicator templates containing other scenario identifiers are deleted, resulting in the initial test report. It is understood that the "indicator" in the indicator template is not specifically limited at this time. For example, "{{Indicator_1}}" represents all indicators in Scenario 1, such as "{{Indicator1_1}}", "{{Indicator2_1}}", and "{{Indicator3_1}}".
[0032] In another embodiment, based on the scene identifier of the scene to be tested, the indicator templates in the test report template are filtered to obtain an initial test report. This includes: identifying the maximum value of the scene identifier of the scene to be tested; and cropping the indicator templates whose scene identifiers are greater than the maximum value of the scene identifier of the scene to be tested to obtain the initial test report. Thus, the test report is cropped based on the scene identifier.
[0033] Specifically, the scenarios in the test cases are named "Scenario 1", "Scenario 2",..., "Scenario i", and the scenario identifiers are "1", "2",..., "i", which are consistent with the scenario identifiers in the metric template. Moreover, the scenarios in the test cases are arranged in ascending order of the scenario identifiers. Thus, as long as the maximum value of the scenario identifier of the scenario to be tested is identified, the scenario identifiers to be retained in the test report can be determined. For example, if the scenario identifier of the scenario to be tested in the test case is N (N < i), then only the metric templates corresponding to the first N scenario identifiers need to be retained, and other metric templates are deleted to obtain the initial test report.
[0034] In one embodiment, it can be understood that the scenario identifier i is the scenario loop variable in system testing. Thus, the metric template is a nested loop structure. By presetting the metric context structure, all test requirements are covered. Only automatic pruning during use can meet the actual test requirements, achieving personalized setting of the metrics required in each scenario. During the test process, metrics can be deleted according to the actual test content, improving the accuracy and reliability of the test conclusion. Moreover, the data filling process is automatically completed, reducing the labor cost, reducing the overall test time cost, alleviating the repetitive work of testers, and improving the report generation efficiency.
[0035] S30: Obtain a test result based on a preset test case, identify the scenario identifier, scenario metrics, and their corresponding metric data in the test result, and fill the metric data into the initial test report to generate a target test report.
[0036] In one embodiment, step S30 obtains a test result based on a preset test case, identifies the scenario identifier, scenario metrics, and their corresponding metric data in the test result, and fills the metric data into the initial test report to generate a target test report, including: S31: Identify the scenario identifier, scenario metrics, and their corresponding metric data in the test result.
[0037] In one embodiment, the system is tested according to the actual preset test rules, and the test data is analyzed and calculated to obtain a test result, which includes various metrics, the data corresponding to the metrics, test pictures, combined text content in paragraph texts, etc.
[0038] S32: Compare the scenario identifier and scenario metrics in the test result with the scenario identifiers in the initial test report, and obtain a target metric template according to the comparison result.
[0039] In one embodiment, the initial indicator template in the initial test report includes all scenarios in this test and all test indicators for each scenario. However, in actual testing, the test indicators generated for each scenario in the test results are only a part of them. Therefore, it is necessary to trim the scenario indicators that do not appear in the test results to improve the accuracy and reliability of the test conclusions.
[0040] In one embodiment, the initial test report is used to find a target scene identifier that corresponds to the scene identifier in the test results; the initial test report is used to find an indicator template that includes the target scene identifier and the scene indicators in the test results to obtain the target indicator template.
[0041] Specifically, the scenario identifiers in the test results are matched with the scenario identifiers in the initial test report. The scenario identifiers that match successfully in the initial test report are used as the target scenario identifiers. Then, the scenario metrics in the test results under the scenario are matched with the scenario metrics in the initial test report. The metric templates corresponding to the successfully matched scenario metrics (i.e., the target metric templates) are retained, while the metric templates corresponding to the unmatched scenario metrics are deleted. This achieves the second trimming of the test report.
[0042] S33: Fill the target indicator template with the indicator data and generate the target test report.
[0043] In one embodiment, the docxtpl library is used to populate the target metric template with metric context data in one go. This application uses a nested loop structure to generate relevant metric content for each test scenario. The metrics specifically include metric data in tables, test images in test reports, and combined text content in paragraphs.
[0044] In a specific embodiment, the process is as follows: First, the indicator template in the test report template includes “{{Indicator 1_1}}”, “{{Indicator 2_1}}”, “{{Indicator 3_1}}”, “{{Indicator 1_2}}”, “{{Indicator 2_2}}”, “{{Indicator 3_2}}”, “{{Indicator 4_2}}”, “{{Indicator 1_3}}”, “{{Indicator 2_3}}”, “{{Indicator 1_4}}”, “{{Indicator 2_4}}”, and “{{Indicator 3_4}}”. That is, the test report template includes 4 test scenarios: scenario 1 corresponds to 3 indicators, scenario 2 corresponds to 4 indicators, scenario 3 corresponds to 2 indicators, and scenario 4 corresponds to 3 indicators.
[0045] Second, if the maximum value of the scenario identifier in the test case is 2, then delete the indicator templates corresponding to scenario 3 and scenario 4 in the test report template. The indicator templates in the initial test report include “{{Indicator 1_1}}”, “{{Indicator 2_1}}”, “{{Indicator 3_1}}”, “{{Indicator 1_2}}”, “{{Indicator 2_2}}”, “{{Indicator 3_2}}”, and “{{Indicator 4_2}}”.
[0046] Third, test results are obtained based on preset test cases. The test results include Scenario 1, scenario metrics for Scenario 1, and data for each scenario metric in Scenario 1; Scenario 2, scenario metrics for Scenario 2, and data for each scenario metric in Scenario 2. First, based on scenario 1 in the test results, the initial test report is matched with the metric templates "{{metric1_1}}", "{{metric2_1}}", and "{{metric3_1}}" containing the scenario metric of Scenario 1; based on scenario 2 in the test results, the initial test report is matched with the metric templates "{{metric1_2}}", "{{metric2_2}}", "{{metric3_2}}", and "{{metric4_2}}" containing the scenario metric of Scenario 2. Secondly, the target indicator template is obtained by matching the indicator templates in each scenario based on the scenario indicators in the test results. For example, if the scenario indicators of scenario 1 in the test results include indicator 1 and indicator 2, and the scenario indicators of scenario 2 include indicator 1, then the target indicator templates obtained are “{{indicator 1_1}}”, “{{indicator 2_1}}”, and “{{indicator 1_2}}”.
[0047] Fourth, based on the target indicator data for each scenario in scenario 1 and the target indicator template for each scenario in scenario 2, the target indicator template is populated in one go using the docxtpl library.
[0048] In one embodiment, the method further includes using the win32com document manipulation interface to open the test report document populated with indicator data and update the test report directory. Finally, the test report document content is saved and the test report document is closed.
[0049] This application standardizes the metrics in the test report using the placeholder "{{metric_i}}", and injects multi-dimensional test report content such as text, tables, images, and directories in one go through multi-level loops using jinja2 +docxtpl + win32com, which increases the consistency and completeness of the test report content in multiple scenarios.
[0050] As can be seen, in the above solution, this application pre-sets indicator templates to personalize the indicators required in each scenario. During the testing process, indicators can be reduced or removed according to the actual test content, which improves the accuracy and reliability of test conclusions. Moreover, the data filling process is completed automatically, which reduces labor costs, reduces the overall testing time cost, reduces the repetitive work of testers, and improves the efficiency of report generation.
[0051] This application automatically populates the indicator data, images, and tables in the test report template, reducing overall testing time costs, minimizing repetitive work for testers, and improving report generation efficiency. Modifications to the test template do not require technical expertise, reducing the investment costs associated with redesigning report layouts and adjusting code. The process is intelligent and efficient, and indicators can be adjusted according to the actual test content, improving the accuracy and reliability of test conclusions.
[0052] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0053] In one embodiment, a test report generation apparatus is provided, which corresponds one-to-one with the test report generation method described in the above embodiments. For example... Figure 3 As shown, the test report generation device includes a construction module 101, a first test module 102, and a second test module 103. Detailed descriptions of each functional module are as follows: Module 101 is used to build a test report template. The test report template has multiple preset indicator templates, and the indicator templates include scenario indicators and scenario identifiers. The first test module 102 is used to identify the scene identifier of the scene to be tested in the test cases based on the preset test cases, and to filter the indicator template in the test report template according to the scene identifier of the scene to be tested to obtain an initial test report. The second test module 103 is used to obtain test results based on preset test cases, identify scene identifiers, scene indicators and their corresponding indicator data in the test results, and fill the indicator data into the initial test report to generate a target test report.
[0054] The construction module 101 is also used to construct the indicator template based on the jinja2 placeholder format.
[0055] The construction module 101 is also used to set a one-to-one correspondence between the scene identifier in the indicator template and the scene identifier of the scene to be tested in the test case.
[0056] The first test module 102 is further configured to compare the scene identifier of the scene to be tested with the scene identifier in the indicator template, and filter out the initial indicator template based on the comparison result, and the initial indicator template is retained in the initial test report.
[0057] The first test module 102 is further configured to identify the maximum value of the scene identifier of the scene to be tested, and to crop the indicator templates in the indicator templates whose scene identifiers are greater than the maximum value of the scene identifier of the scene to be tested, so as to obtain the initial test report.
[0058] The second test module 103 is also used to identify the scene identifier, scene index and its corresponding index data in the test results; The scene identifiers and scene indicators in the test results are compared with the scene identifiers and scene indicators in the initial test report, and the target indicator template is obtained based on the comparison results. The indicator data is populated into the target indicator template to generate the target test report.
[0059] The second test module 103 is also used to find the target scene identifier corresponding to the scene identifier in the test result in the initial test report; The target indicator template is obtained by finding the indicator template that includes the target scene identifier and the scene indicators in the test results in the initial test report.
[0060] This invention provides a test report generation device. By pre-setting indicator templates, the required indicators for each scenario can be customized. During the test, indicators can be reduced or removed according to the actual test content, which improves the accuracy and reliability of test conclusions. Moreover, the data filling process is completed automatically, which reduces labor costs, reduces the overall test time cost, reduces the repetitive work of testers, and improves the efficiency of report generation.
[0061] Specific limitations regarding the test report generation device can be found in the limitations of the test report generation method described above, and will not be repeated here. Each module in the aforementioned test report generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0062] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used for communication with external devices via a network connection. When executed by the processor, the computer program implements the functions or steps of a test report generation method on the server side.
[0063] In one embodiment, a computer device is provided, which may be a device terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a test report generation method on the device side.
[0064] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: A test report template is constructed, which includes multiple preset indicator templates, including scenario indicators and scenario identifiers; Based on preset test cases, the scenario identifier of the scenario to be tested in the test cases is identified, and the indicator template in the test report template is filtered according to the scenario identifier of the scenario to be tested to obtain an initial test report; Based on the test results obtained from the preset test cases, the scene identifiers, scene indicators and their corresponding indicator data in the test results are identified, and the indicator data is filled into the initial test report to generate the target test report.
[0065] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: A test report template is constructed, which includes multiple preset indicator templates, including scenario indicators and scenario identifiers; Based on preset test cases, the scenario identifier of the scenario to be tested in the test cases is identified, and the indicator template in the test report template is filtered according to the scenario identifier of the scenario to be tested to obtain an initial test report; Based on the test results obtained from the preset test cases, the scene identifiers, scene indicators and their corresponding indicator data in the test results are identified, and the indicator data is filled into the initial test report to generate the target test report.
[0066] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and device side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0067] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0068] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0069] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for generating test reports, characterized in that, include: A test report template is constructed, which includes multiple preset indicator templates, including scenario indicators and scenario identifiers; Based on preset test cases, the scenario identifier of the scenario to be tested in the test cases is identified, and the indicator template in the test report template is filtered according to the scenario identifier of the scenario to be tested to obtain an initial test report; Based on the test results obtained from the preset test cases, the scene identifiers, scene indicators and their corresponding indicator data in the test results are identified, and the indicator data is filled into the initial test report to generate the target test report.
2. The method according to claim 1, characterized in that, The indicator template is constructed based on the jinja2 placeholder format.
3. The method according to claim 1, characterized in that, The scenario identifiers in the indicator template and the scenario identifiers of the scenarios to be tested in the test cases are set to correspond one-to-one.
4. The method according to claim 1, characterized in that, Based on the scenario identifier of the scenario to be tested, the indicator templates in the test report template are filtered to obtain an initial test report, including: The scene identifier of the scene to be tested is compared with the scene identifier in the indicator template. An initial indicator template is selected based on the comparison result and is retained in the initial test report.
5. The method according to claim 1, characterized in that, Based on the scenario identifier of the scenario to be tested, the indicator templates in the test report template are filtered to obtain an initial test report, including: Identify the maximum value of the scene identifier of the scene to be tested, and crop the indicator templates in the indicator templates whose scene identifiers are greater than the maximum value of the scene identifier of the scene to be tested to obtain the initial test report.
6. The method according to claim 1, characterized in that, Based on preset test cases, test results are obtained. Scene identifiers, scene metrics, and their corresponding metric data in the test results are identified, and the metric data is filled into the initial test report to generate a target test report, including: Identify the scene identifiers, scene metrics, and their corresponding metric data in the test results; The scene identifiers and scene indicators in the test results are compared with the scene identifiers and scene indicators in the initial test report, and the target indicator template is obtained based on the comparison results. The indicator data is populated into the target indicator template to generate the target test report.
7. The method according to claim 6, characterized in that, Based on the comparison results, a target indicator template is obtained, including: Find the target scene identifier that corresponds to the scene identifier in the test results in the initial test report; The target indicator template is obtained by finding the indicator template that includes the target scene identifier and the scene indicators in the test results in the initial test report.
8. A test report generation device, characterized in that, include: A construction module is used to build a test report template. The test report template has multiple preset indicator templates, and the indicator templates include scenario indicators and scenario identifiers. The first testing module is used to identify the scene identifier of the scene to be tested in the test cases based on the preset test cases, and to filter the indicator template in the test report template according to the scene identifier of the scene to be tested to obtain an initial test report. The second testing module is used to obtain test results based on preset test cases, identify scene identifiers, scene indicators and their corresponding indicator data in the test results, and fill the indicator data into the initial test report to generate a target test report.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the test report generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the test report generation method as described in any one of claims 1 to 7.