Test report generation method and device and storage medium
By generating and merging sub-reports of multiple testing tools, the problem in the existing technology of being unable to intuitively obtain the test results of multiple testing tools is solved, and horizontal comparison of test results and comprehensiveness and efficiency of reporting are achieved.
Patent Information
- Application Number
- CN202310352182.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, it is difficult to intuitively learn the test results of multiple test tools from the test report, resulting in the inability to achieve horizontal comparison of the test results of multiple test tools.
By generating a sub-report corresponding to each test tool based on the test log and preset template of each test tool, and merging the sub-reports into the test report, the test report contains the test results of multiple test tools.
It achieves horizontal comparison of test results of multiple testing tools, improves the comprehensiveness and generation efficiency of test reports, and ensures the accuracy and rationality of test reports.
Smart Images

Figure CN118733428A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a test report generating method, device and storage medium. Background Art
[0002] A test report is a record of the test process and results, which helps testers find problems in the system or site for further correction and maintenance. In related technologies, the generated test report often only contains the test results of a single test tool on the test object, and it is impossible to intuitively obtain the test results of multiple test tools from the test report at the same time. Summary of the invention
[0003] In view of the above, it is necessary to provide a test report generation method, device and storage medium, which can solve the technical problem that the test results of multiple test tools cannot be intuitively obtained from the test report at the same time.
[0004] On the one hand, the present application proposes a test report generation method, which includes: generating a sub-report corresponding to each test tool based on the test log of each test tool and a first preset template; writing the sub-report into a second preset template to obtain a test report.
[0005] According to an embodiment of the present application, the generation of a sub-report corresponding to each test tool based on the test log of each test tool and the first preset template includes: if the test log is in the first preset format, filtering out the target log line from the test log based on the second preset format; extracting field information from the target log line; if the first preset template contains a data field corresponding to the field information, filling the field information into the field position corresponding to the data field in the first preset template, until all test logs in each test tool are processed and a sub-report corresponding to each test tool is obtained.
[0006] According to an embodiment of the present application, filling the field information into the field position corresponding to the data field in the first preset template includes: when the display mode of the field position is text form, if there are multiple field information, based on the first preset template, detecting whether the data field is set with data statistical attributes; if the data field is not set with the data statistical attributes, and the fill information of the field position is not empty, expanding the field position and adding a new extended position; filling the multiple field information into the extended position.
[0007] According to an embodiment of the present application, filling the field information into the field position corresponding to the data field in the first preset template includes: when the display mode of the field position is in the form of a chart, if there are multiple field information, detecting whether the multiple field information depends on other field information; if the multiple field information depends on the other field information, drawing a field chart according to the multiple field information and the other field information; converting the field chart into a chart image, and filling the chart image into the field position.
[0008] According to an embodiment of the present application, filling the field information into the field position corresponding to the data field in the first preset template includes: when the display mode of the field position is a picture form, if the field information is a file name, obtaining a target file matching the field information from the test log; if the target file is in a picture format, filling the target file into the field position.
[0009] According to an embodiment of the present application, the sub-report is written into a second preset template to obtain a test report, including: if the sub-report contains an unprocessed page, detecting whether the second preset template contains the parent page name corresponding to the unprocessed page; if the second preset template contains the parent page name corresponding to the unprocessed page, writing the unprocessed page into the page position corresponding to the parent page name in the second preset template until the sub-report does not contain an unprocessed page, thereby obtaining the test report.
[0010] According to an embodiment of the present application, the method further includes: generating the test report based on a third preset template and the sub-report.
[0011] According to an embodiment of the present application, generating the test report based on the third preset template and the sub-report includes: if the sub-report contains an unprocessed page, detecting whether the third preset template contains a parent node corresponding to the unprocessed page; if the third preset template contains a parent node corresponding to the unprocessed page, locating a leaf node corresponding to the parent node; filling the unprocessed page into the page corresponding to the leaf node until the sub-report does not contain an unprocessed page, thereby obtaining the test report.
[0012] On the other hand, the present application also proposes a test report generating device, which includes: a generating unit, used to generate a sub-report corresponding to each test tool based on the test log of each test tool and a first preset template; a writing unit, used to write the sub-report into a second preset template to obtain a test report.
[0013] On the other hand, the present application further proposes an electronic device, comprising: a memory storing computer-readable instructions; and a processor executing the computer-readable instructions stored in the memory to implement the test report generating method.
[0014] On the other hand, the present application further proposes a computer-readable storage medium, in which computer-readable instructions are stored. The computer-readable instructions are executed by a processor in an electronic device to implement the test report generating method.
[0015] It can be seen from the above technical solution that the embodiment of the present application can generate corresponding sub-reports on demand by combining the test logs of multiple test tools, and then merge the sub-reports corresponding to each test tool into the test report through the second preset template, so that the test report contains the test results of multiple test tools, thereby realizing horizontal comparison of the test results of multiple test tools. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural schematic diagram of an electronic device for implementing a test report generating method provided in an embodiment of the present application.
[0017] Figure 2 It is a flowchart of the test report generation method provided in an embodiment of the present application.
[0018] Figure 3 It is a schematic diagram of the first preset template provided in an embodiment of the present application.
[0019] Figure 4 It is a flowchart of the field information filling method provided in an embodiment of the present application.
[0020] Figure 5 This is a flowchart of a method for filling field information provided by another embodiment of the present application.
[0021] Figure 6 This is a flowchart of a method for filling field information provided by another embodiment of the present application.
[0022] Figure 7 This is a flowchart of a test report generating method provided by another embodiment of the present application.
[0023] Figure 8 It is a functional module diagram of the test report generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0026] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. The following embodiments and features in the embodiments may be combined with each other without conflict.
[0027] like Figure 1 , which is a schematic diagram of the structure of an electronic device for implementing a test report generating method provided in an embodiment of the present application.
[0028] In an embodiment of the present application, the test report generation method is applied to one or more electronic devices 1. The electronic device 1 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored computer-readable instructions, and its hardware includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.
[0029] The electronic device 1 can be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.
[0030] The electronic device 1 may include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of multiple network electronic devices, or a cloud consisting of a large number of hosts or network electronic devices based on cloud computing.
[0031] The network where the electronic device 1 is located includes, but is not limited to: the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
[0032] In the embodiment of the present application, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions stored in the memory 12 and executable on the processor 13, such as a test report generation program.
[0033] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.
[0034] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1, and execute the operating system of the electronic device 1 and various installed applications, program codes, etc.
[0035] The memory 12 may be an external memory and / or an internal memory of the electronic device 1. Furthermore, the memory 12 may be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and the like.
[0036] Combination Figure 2 The memory 12 in the electronic device 1 stores computer-readable instructions, and the processor 13 can execute the computer-readable instructions stored in the memory 12 to implement the following Figure 2The test report generation method shown.
[0037] like Figure 2 FIG. 1 is a flowchart of a test report generation method provided in an embodiment of the present application. The test report generation method is applied to an electronic device (eg Figure 1 In the electronic device 1), according to different requirements, the order of the steps in the flowchart can be changed and some steps can be omitted.
[0038] 101. Generate a sub-report corresponding to each test tool based on the test log of each test tool and a first preset template.
[0039] In at least one embodiment of the present application, the testing tool may be a third-party program or a program written by the testing staff themselves.
[0040] The test log may be a log file generated after the test tool tests the test object, and the test log records the test results of the test tool on the test object, wherein the test object may be an application. When the test tool is a current test module, the test log may be a test log of the current test module.
[0041] The field names in the first preset template are related to the test tool. For example, when the test tool is a current test module, the first preset template contains relevant test items of the current test module. For example, the first preset template may include information such as test current. Figure 3 The first preset template of the embodiment of the present application is described. The first preset template stores field names that need to be displayed in the test report, for example, Figure 3 The field names stored in the first preset template shown include: reading speed, writing speed. The setting information of the first preset template may include, but is not limited to: a test tool identification code, a display method of a specific position in the first preset template, a field name, data statistical attributes, and an extension method, etc. Among them, the test tool identification code indicates the test tool related to the fill information in the sub-report, the display method indicates the presentation form of the fill information in the sub-report, and the display methods include: text form, chart form, and picture form. The field name indicates the field name of the fill information in the sub-report, and the data statistical attributes include: the average value, maximum value, minimum value, and index information of the field information. The index information indicates the specific item number filled in the field information to the first preset template, and the extension method includes column extension and row extension.
[0042] The sub-report contains relevant information of all test logs (i.e., target test logs) in the corresponding test tool that conform to the first preset format, and the sub-report contains field information of all log lines in the target test log that conform to the second preset format. The first preset format and the second preset format can be set according to actual needs. For example, the first preset format can be: "#!log" format, and the second preset format can be: "key:value" format. The sub-report can include multiple pages, for example, a sheet page.
[0043] In at least one embodiment of the present application, the electronic device generates a sub-report corresponding to each test tool based on the test log of each test tool and the first preset template, including: if the test log is in the first preset format, the electronic device filters out the target log line from the test log based on the second preset format, and then extracts the field information from the target log line; if the first preset template contains a data field corresponding to the field information, the electronic device fills the field information into the field position corresponding to the data field in the first preset template until all test logs in each test tool are processed to obtain a sub-report corresponding to each test tool.
[0044] The target log line may be a log line conforming to the second preset format, for example, the target log line may be: "Rand_Rd_Spd:50,51,49,50,55". The electronic device extracts information located after the preset identifier from the target log line as field information, wherein the preset identifier may be ":", for example, the target log line is: "Rand_Rd_Spd:50,51,49,50,55", and the field information includes: 50, 51, 49, 50, 55. The data field refers to the field name corresponding to the field information.
[0045] By filtering target log lines from test logs that conform to the first preset format, the test logs containing test results can be accurately identified. At the same time, by filtering the log lines in the test logs through the second preset format, it is possible to doubly avoid storing redundant interference information in the sub-report, thereby improving the rationality of sub-report generation. Furthermore, by detecting whether the first preset template contains data fields, incorrect filling of field information can be avoided, thereby improving the accuracy of sub-report generation.
[0046] In other embodiments, if the test log is not in the first preset format, the electronic device ignores processing of the test log. Similarly, the electronic device ignores processing of log lines that are not in the second preset format. In this embodiment, the first preset template does not include a data field corresponding to the field information, and the processing of the field information is ignored, which can avoid including redundant field information in the sub-report.
[0047] In at least one embodiment of the present application, the specific process of the electronic device filling the field information into the field position can be referred to below. Figures 3 to 5 Detailed description of the process shown.
[0048] 102. Write the sub-report into the second preset template to obtain a test report.
[0049] In at least one embodiment of the present application, the second preset template stores the parent page name that needs to be displayed in the test report, for example, the parent page name may include: speed. The second preset template may include specific test items in the test tool, for example, when the test tool is a current test module, the second preset template may include specific test items of the current test module at high frequency, and the parent page name may be the specific test item of the current test module at high frequency, for example, the parent page name may include information such as startup current, idle current, low load current, high load current and full load current.
[0050] The test report stores test results of multiple test tools on the test object. The fields of the test results stored in the test report can usually be set according to user requirements, wherein the field of the test result can be the parent page name.
[0051] In at least one embodiment of the present application, the electronic device writes the sub-report into the second preset template, and the test report obtained includes: if the sub-report contains an unprocessed page, the electronic device detects whether the second preset template contains the parent page name corresponding to the unprocessed page, if the second preset template contains the parent page name corresponding to the unprocessed page, the electronic device writes the unprocessed page into the page position corresponding to the parent page name in the second preset template, until the sub-report does not contain the unprocessed page, and the test report is obtained. Among them, the unprocessed page can be a sheet page for which the electronic device has not detected whether the second preset template contains the corresponding parent page name.
[0052] By detecting whether the sub-report contains unprocessed pages, it is possible to avoid missing the writing of the unprocessed pages in the sub-report into the second preset template, thereby improving the comprehensiveness of the test report. By detecting whether the second preset template contains the parent page name corresponding to the unprocessed page, it is possible to avoid including unnecessary interference information in the test report. At the same time, since there is no need to write unnecessary interference information into the test report, the efficiency of test report generation can be improved.
[0053] In other embodiments, if the second preset template does not include the parent page name corresponding to the unprocessed page, the electronic device ignores writing to the unprocessed page.
[0054] The embodiment of the present application combines the test logs of multiple test tools to generate corresponding sub-reports on demand, and then merges the sub-reports corresponding to each test tool into the test report through a second preset template, so that the test report contains the test results of multiple test tools, thereby enabling horizontal comparison of the test results of multiple test tools.
[0055] like Figure 4 As shown, it is a flow chart of a method for filling field information provided by an embodiment of the present application, and the method for filling field information is applied to an electronic device. Figure 4 As shown, the specific steps include:
[0056] 1041, when the display mode of the field position is text form, detect whether there are multiple field information.
[0057] In at least one embodiment of the present application, the fill information of the text form indication field position is written in text form.
[0058] 1042, if the field information does not contain multiple, write the field information into the field position.
[0059] In at least one embodiment of the present application, when there is only one field information, it is determined that the field information does not contain multiple fields.
[0060] 1043. If there are multiple field information, based on the first preset template, detect whether the data field is set with data statistical attributes.
[0061] In at least one embodiment of the present application, when the number of field information is greater than or equal to 2, it is determined that there are multiple field information, and the data statistical attributes may include: the average value, maximum value, minimum value, and index information of the field information, and the index information indicates the specific item number in the field information that is filled into the first preset template.
[0062] In at least one embodiment of the present application, the electronic device detects whether the data field is set with data statistical attributes based on the first preset template, including: the electronic device obtains setting information for the field position corresponding to the data field in the first preset template, and detects whether the setting information contains attribute information of the data statistical attributes; if the setting information contains attribute information of the data statistical attributes, it is determined that the data field is set with data statistical attributes.
[0063] 1044, if the data field is set with a data statistical attribute, determine the target information according to the data statistical attribute and multiple field information, and write the target information into the field position.
[0064] 1045. If the data statistical attribute is not set for the data field, check whether the filling information of the field position is empty.
[0065] In at least one embodiment of the present application, the electronic device detects whether the field position contains information. If the field position contains information, it determines that the fill information of the field position is not empty. If the field position does not contain information, it determines that the fill information of the field position is empty.
[0066] 1046. If the filling information of the field position is empty, the field position is extended, an extended position is added, and the field information is written into the field position and the extended position.
[0067] In this embodiment, the extension mode is acquired from the field position, and the field position is extended based on the extension mode to generate an extended position.
[0068] 1047, if the filling information of the field position is not empty, the field position is extended and a new extended position is added.
[0069] In at least one embodiment of the present application, the setting information of the field position may include, but is not limited to: display mode, field name, attribute information of data statistical attributes, and expansion mode, etc. Among them, the display mode indicates the presentation form of the information filled in the field position, and the display mode includes: text form, chart form, and picture form. The field name indicates the field name of the information filled in the field position. The attribute information of the data statistical attributes includes: the average value, maximum value, minimum value, and index information of the field information. The index information indicates the specific item number filled in the first preset template in the field information. The expansion mode includes column expansion and row expansion of the field position. The extended position includes the newly added position after the column expansion or row expansion of the field position.
[0070] 1048, fill multiple field information into the extended position.
[0071] In at least one embodiment of the present application, the electronic device locates the position number of the extended position and calls a fill instruction to write the field information into the position number.
[0072] In the embodiment of the present application, when there are multiple field information, by detecting whether the data statistical attributes are set at the field position, the field information can be filled in reasonably according to the needs. By detecting whether the filled information at the field position is not empty, it is possible to avoid overwriting the information at the field position, thereby improving the filling accuracy.
[0073] like Figure 5 As shown, it is a flow chart of a method for filling field information provided by another embodiment of the present application, and the method for filling field information is applied to electronic equipment. Figure 5 As shown, the specific steps include:
[0074] 1051. When the display mode of the field position is in the form of a chart, if there are multiple field information, detect whether the multiple field information depends on other field information.
[0075] In at least one embodiment of the present application, the chart form includes a curve chart, a bar chart, etc.
[0076] In at least one embodiment of the present application, the electronic device detects whether the configuration field contains a field name corresponding to the field information, and if the configuration field contains a field name corresponding to the field information, determines that the multiple field information depends on other field information, and if the configuration field does not contain a field name corresponding to the field information, determines that the multiple field information does not depend on other field information. The configuration field is a field associated with other field information, for example, the configuration field can be speed.
[0077] In at least one embodiment of the present application, if the field information does not contain multiple fields, the processing of the field information is ignored.
[0078] 1052, if the plurality of field information does not depend on other field information, draw a field chart according to the plurality of field information, convert the field chart into a chart image, and fill the chart image into the field position.
[0079] 1053, if multiple field information depends on other field information, draw a field chart based on the multiple field information and other field information.
[0080] In at least one embodiment of the present application, when multiple field information depends on other field information, the dimension of the field chart has multiple dimensions, and the dimension of the field chart is related to the number of field names corresponding to other field information. The dimension of the field chart can be equal to the sum of the number of field names corresponding to other field information and 1. For example, when the number of field names of other field information is 2, the dimension of the field chart can be 3-dimensional. The dimension of the field chart can also be 2-dimensional, that is, a relationship diagram between field information and other information.
[0081] 1054, convert the field chart into a chart image, and fill the chart image into the field position.
[0082] In at least one embodiment of the present application, the electronic device can fill the chart image into the field position by referring to the following Figure 4 The method of filling multiple field information into the extended position will not be repeated here.
[0083] By detecting whether field information is dependent on other field information, the drawing accuracy of field charts can be improved, thereby improving the generation accuracy of sub-reports.
[0084] like Figure 6 As shown, it is a flow chart of a method for filling field information provided by another embodiment of the present application, and the method for filling field information is applied to electronic equipment. Figure 6 As shown, the specific steps include:
[0085] 1061, when the display mode of the field position is in the form of a picture, if the field information is a file name, obtain the target file matching the field information from the test log.
[0086] In at least one embodiment of the present application, the target file is a specific file in the test log corresponding to the file name. If the field information is not a file name, the processing of the field information is ignored.
[0087] 1062, detect whether the target file is in picture format.
[0088] In at least one embodiment of the present application, the file attribute of the target file is detected, and if the file attribute is a picture attribute, it is determined that the target file is in a picture format.
[0089] 1063, if the target file is in picture format, fill the target file into the field position.
[0090] In at least one embodiment of the present application, the electronic device can fill the target file into the field position by referring to the following Figure 4 The method of filling multiple field information into the extended position will not be repeated here.
[0091] 1064, if the target file is not in image format, ignore the processing of the target file.
[0092] The embodiment of the present application can avoid the situation where the target file cannot be extracted from the test log by detecting whether the field information is a file name. By detecting whether the target file is in a picture format, it can avoid the situation where the information filled into the field position is inconsistent with the display method of the field position, thereby improving the generation accuracy of the sub-report.
[0093] like Figure 7 , which is a flow chart of a test report generating method provided in another embodiment of the present application.
[0094] 701. Generate a sub-report corresponding to each test tool based on the test log of each test tool and a first preset template.
[0095] The details of step 701 can be found above. Figure 2 The detailed description of step 101 is not repeated here.
[0096] 702. Generate a test report based on the third preset template and sub-report.
[0097] In at least one embodiment of the present application, the third preset template is in a tree format, and the third preset template includes a root node, a parent node, and a leaf node. The third preset template stores the parent page name that needs to be displayed in the test report. For example, the parent page name may include: speed. The format of the test report is in a tree format. The third preset template may include specific test items of the test tool. For example, when the test tool is a current test module, the third preset template may include specific test items of the current test module at high frequency. The parent node may be the current of the current test module at high frequency, and the leaf node may be the starting current, idle current, low load current, high load current and full load current of the current test module at high frequency.
[0098] In at least one embodiment of the present application, the electronic device generates a test report based on a third preset template and a sub-report, including: if the sub-report contains an unprocessed page, the electronic device detects whether the third preset template contains a parent node corresponding to the unprocessed page; if the third preset template contains a parent node corresponding to the unprocessed page, the electronic device locates a leaf node corresponding to the parent node, and fills the unprocessed page into the page corresponding to the leaf node until the sub-report does not contain the unprocessed page, thereby obtaining a test report.
[0099] By detecting whether the sub-report contains unprocessed pages, the comprehensiveness of test report generation can be improved. By detecting whether the third preset template contains the parent node corresponding to the unprocessed page, it is possible to avoid filling the sub-reports that do not need to be displayed into the third preset template, thereby avoiding the inclusion of redundant information in the test report.
[0100] In at least one embodiment of the present application, the electronic device detects that the third preset template contains the parent page name corresponding to the unprocessed page. If the third preset template contains the parent page name corresponding to the unprocessed page, it determines that the third preset template contains the parent node corresponding to the unprocessed page.
[0101] In other embodiments, if the third preset template does not include a parent node corresponding to the unprocessed page, the electronic device ignores processing of the unprocessed page.
[0102] like Figure 8 , which is a functional module diagram of a test report generating device provided in an embodiment of the present application. The test report generating device 11 includes a generating unit 110 and a writing unit 112. The module / unit referred to in the present application refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and can perform fixed functions, which are stored in the memory 12.
[0103] The generating unit 110 is used to generate a sub-report corresponding to each test tool based on the test log of each test tool and the first preset template; the writing unit 111 is used to write the sub-report into the second preset template to obtain a test report. The generating unit 110 is also used to generate a test report based on the third preset template and the sub-report.
[0104] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the steps of the above-mentioned method embodiments can be implemented.
[0105] The computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable files, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction codes, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM).
[0106] The memory 12 can be used to store computer-readable instructions and / or modules. The processor 13 implements various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12, and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. The memory 12 can include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other storage devices.
[0107] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, one or more modules / units are stored in the memory 12, and are executed by the processor 13 to complete the present application. One or more modules / units may be a series of computer-readable instruction segments capable of completing a specific function, and the computer-readable instruction segments are used to describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into a generation unit 110 and a writing unit 112.
[0108] For details on the functions of each module / unit, please refer to the above Figure 2 The detailed description is not repeated here.
[0109] It can be seen from the above technical solution that the embodiment of the present application can generate corresponding sub-reports on demand by combining the test logs of multiple test tools, and then merge the sub-reports corresponding to each test tool into the test report through the second preset template, so that the test report contains the test results of multiple test tools, thereby realizing horizontal comparison of the test results of multiple test tools.
[0110] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.
[0111] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0112] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0113] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present application is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present application. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0114] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A test report generation method, characterized in that: The test report generating method comprises: Based on the test log of each test tool and the first preset template, generate a sub-report corresponding to each test tool; The sub-report is written into the second preset template to obtain a test report.
2. The test report generating method according to claim 1, characterized in that: The generating of a sub-report corresponding to each test tool based on the test log of each test tool and the first preset template includes: If the test log is in the first preset format, filter out target log lines from the test log based on the second preset format; Extracting field information from the target log line; If the first preset template contains a data field corresponding to the field information, fill the field information into the field position corresponding to the data field in the first preset template until all test logs in each test tool are processed to obtain a sub-report corresponding to each test tool.
3. The test report generating method according to claim 2, characterized in that: The step of filling the field information into the field position corresponding to the data field in the first preset template comprises: When the display mode of the field position is in text form, if there are multiple field information, based on the first preset template, detecting whether the data field is set with a data statistical attribute; If the data statistical attribute is not set for the data field and the filling information of the field position is not empty, the field position is extended and a new extended position is added; Fill the plurality of field information into the extended position.
4. The test report generating method according to claim 2, characterized in that: The step of filling the field information into the field position corresponding to the data field in the first preset template comprises: When the display mode of the field position is in the form of a chart, if there are multiple field information, detecting whether the multiple field information depends on other field information; If the plurality of field information depends on the other field information, drawing a field chart according to the plurality of field information and the other field information; The field chart is converted into a chart image, and the chart image is filled into the field position.
5. The test report generating method according to claim 2, characterized in that: The step of filling the field information into the field position corresponding to the data field in the first preset template comprises: When the display mode of the field position is in the form of a picture, if the field information is a file name, obtaining a target file matching the field information from the test log; If the target file is in picture format, fill the target file into the field position.
6. The test report generating method according to claim 1, characterized in that: Writing the sub-report into the second preset template to obtain a test report includes: If the sub-report contains an unprocessed page, detecting whether the second preset template contains a parent page name corresponding to the unprocessed page; If the second preset template contains the parent page name corresponding to the unprocessed page, the unprocessed page is written into the page position corresponding to the parent page name in the second preset template until the sub-report does not contain the unprocessed page, thereby obtaining the test report.
7. The test report generating method according to claim 1, characterized in that: The method further comprises: The test report is generated based on the third preset template and the sub-report.
8. The test report generating method according to claim 7, characterized in that: The generating the test report based on the third preset template and the sub-report includes: If the sub-report contains an unprocessed page, detecting whether the third preset template contains a parent node corresponding to the unprocessed page; If the third preset template contains a parent node corresponding to the unprocessed page, locate a leaf node corresponding to the parent node; The unprocessed pages are filled into the pages corresponding to the leaf nodes until the sub-report contains no unprocessed pages, thereby obtaining the test report.
9. An electronic device, characterized in that: The electronic device comprises: a memory storing computer-readable instructions; and A processor executes computer-readable instructions stored in the memory to implement the test report generating method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the test report generating method according to any one of claims 1 to 8.
