Test report generation method, device and equipment

By overwriting the original instructions for the test operation in the automated test tool, generating the test operation overwrite instructions and assisting in recording data, the problems of low efficiency, unstable quality and poor flexibility in the existing technology are solved, and high-quality and automated test report generation are achieved.

CN119759794AActive Publication Date: 2025-04-04ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510087401.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-04-04
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

The prior art has low efficiency, unstable quality when generating test reports, and poor flexibility and scalability, making it difficult to meet the requirements of efficiency, quality and scalability.

Method used

By overwriting the original instructions for the test operation in the automated test tool, generating test operation overwrite instructions, executing test cases and assisting in recording related data, and automatically generating high-quality test reports.

Benefits of technology

It realizes efficient generation of automated test reports, improves the quality and flexibility of reports, reduces manual intervention and error rates, and is highly adaptable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759794A_ABST
    Figure CN119759794A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a test report generation method, device and equipment. According to the scheme, the method comprises the steps of determining an automatic test tool with multiple test operation original instructions; a test case containing a test operation overwriting instruction corresponding to the test operation original instruction is determined, and the test operation overwriting instruction is obtained through overwriting by conducting instrumentation operation according to the test operation original instruction; executing a to-be-tested target operation in the test operation overwriting instruction contained in the test case by executing the test case, and performing auxiliary recording on execution related conditions of the to-be-tested target operation based on an instrumentation code introduced by the instrumentation operation; and automatically generating a test report according to an execution result of the to-be-tested target operation and the data of the auxiliary record.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a method, device and equipment for generating a test report. Background Art

[0002] For products such as software applications, their quality is closely related to the testing before delivery, the updates and iterative testing that may be carried out after delivery. In order to reflect the test situation, it is necessary to generate corresponding test reports for R&D use or for customer review. For example, unit test reports, integration test reports, etc. In addition, product acceptance reports are also a kind of test reports provided to customers to show that the products currently to be delivered to users have been tested and meet the requirements.

[0003] At present, there are two main ways to generate test reports. The first way is to manually write, where testers record the executed test cases and test results by themselves, and then summarize the test reports. The disadvantages of this method are low efficiency, uneven quality, and easy distortion or omissions. The second way is to use report plug-ins such as Mochawesome to automatically summarize the test case results and then automatically generate test reports. The disadvantages of this method are coarse granularity, with only test case title information and execution results; poor flexibility and scalability, and inconvenient to meet personalized needs.

[0004] Based on this, a better solution for generating test reports is needed to meet the requirements of efficiency, quality, scalability, etc. Summary of the invention

[0005] One or more embodiments of the present specification provide a test report generation method, apparatus, device, and storage medium to solve the following technical problems: A better solution for forming a test report is needed to meet the requirements of efficiency, quality, scalability, etc.

[0006] To solve the above technical problems, one or more embodiments of this specification are implemented as follows:

[0007] One or more embodiments of this specification provide a test report generation method, including:

[0008] Identify automated test tools with multiple test operation primitives;

[0009] Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction;

[0010] By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution-related situation of the target operation to be tested;

[0011] A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0012] One or more embodiments of this specification provide a test report generating device, including:

[0013] A test tool determination module determines an automated test tool having a plurality of test operation primitive instructions;

[0014] An overwriting instruction case module determines a test case including a test operation overwriting instruction corresponding to the test operation original instruction, wherein the test operation overwriting instruction is overwritten by performing a stub operation on the test operation original instruction;

[0015] A test auxiliary recording module executes the test case to execute the target operation to be tested in the test operation overwriting instruction contained therein, and the plugging code introduced based on the plugging operation, so as to assist in recording the execution related conditions of the target operation to be tested;

[0016] The test report generation module automatically generates a test report according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0017] One or more embodiments of this specification provide a test report generating device, including:

[0018] at least one processor; and,

[0019] a memory communicatively connected to the at least one processor; wherein,

[0020] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute:

[0021] Identify automated test tools with multiple test operation primitives;

[0022] Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction;

[0023] By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution-related situation of the target operation to be tested;

[0024] A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0025] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to:

[0026] Identify automated test tools with multiple test operation primitives;

[0027] Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction;

[0028] By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution-related situation of the target operation to be tested;

[0029] A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0030] At least one of the above-mentioned technical solutions adopted in one or more embodiments of the present specification can achieve the following beneficial effects: by overwriting and inserting the original test operation instructions of the automated testing tool, during the execution of the test case, the introduced insertion code will be executed along with the test target operation, and targeted auxiliary recording will be performed while testing, thereby automatically and efficiently generating higher quality test reports with low implementation costs and less prone to errors and omissions; the overwriting and insertion can be performed according to actual needs, and the focus and granularity of the auxiliary records can be adjusted, with higher flexibility and scalability, and can assist in recording more detailed and more practical test-related data to be presented in the generated test report. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0032] Figure 1 A flowchart of a test report generation method provided for one or more embodiments of this specification;

[0033] Figure 2 A flowchart of a solution for overwriting original instructions of a test operation of an automated test tool provided in one or more embodiments of the present specification;

[0034] Figure 3 A flowchart of a rapid response solution to abnormal problems based on misoperation simulation logic provided in one or more embodiments of this specification;

[0035] Figure 4 A code schematic diagram of a test operation overwrite instruction provided for one or more embodiments of this specification;

[0036] Figure 5 One or more embodiments of this specification provide a method based on Figure 1 A schematic diagram of part of the contents of an acceptance report generated by a method;

[0037] Figure 6 A schematic diagram of the structure of a test report generating device provided for one or more embodiments of this specification;

[0038] Figure 7 A schematic diagram of the structure of a test report generating device provided in one or more embodiments of this specification. DETAILED DESCRIPTION

[0039] The embodiments of this specification provide a test report generation method, apparatus, device, and storage medium.

[0040] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0041] In order to solve the problems in the background technology, the applicant considered using instrumentation to collect additional test-related information for automatically generating higher-quality test reports. Instrumentation is a technology used in software development to refer to adding additional instructions to the code to collect information. It can be used for performance monitoring, debugging, test coverage analysis, etc. For example, by instrumenting, information such as which code blocks the program runs, the running frequency, and the running time can be collected. In the fields of front-end testing or performance monitoring, instrumentation can be used to understand how the application interacts with the server and how the user interface responds to user operations.

[0042] However, in actual operation, it is found that the burden on developers is still heavy, and the code of each test case needs to be modified separately, and the insertion position is prone to errors. In order to solve such problems, this application considers overwriting some original instructions for executing test operations that come with the automated testing tool in the scenario of a specified automated testing tool, thereby achieving unified insertion of all test cases involving these original instructions, and basically no need to modify the test cases themselves, and new input parameters can be introduced for these original instructions to meet flexible expansion needs. In this way, during the test case process, the corresponding test-related data will naturally be automatically recorded in a timely manner as the test operation is executed. The data is more comprehensive and complete, and it also reflects the test operation timeline in detail, so that a better test report can be efficiently generated.

[0043] Based on this general idea, the solution of this application will be further described below.

[0044] Figure 1 A flowchart of a test report generation method provided for one or more embodiments of the present specification. The execution subject of the process may include a test device, and if the test data is processed on another device connected to the test device, the execution subject may also include the other device.

[0045] Figure 1 The process in includes the following steps:

[0046] S102: Determine an automated testing tool having a plurality of test operation original instructions.

[0047] Automated testing tools come with some instructions, called primitive instructions, which are used to call pre-packaged logic. Test cases are written based on the framework of automated testing tools, which is more concise and standardized. These primitive instructions are frequently used in test cases to indicate what test operations need to be performed in what order in the test case.

[0048] For ease of understanding, the following embodiments are mainly described using Cypress, an existing automated testing tool, as an example. Cypress is a front-end automated testing tool that can be used to write various automated end-to-end tests. Cypress is designed for modern network applications. It runs test code directly in the browser and can be used to test any web application built on JavaScript. Cypress provides an easy-to-use API, supports synchronous and asynchronous testing, and provides a rich interactive test running interface.

[0049] Several test operation primitive instructions of Cypress are given as examples: cy.visit(), used to visit the link address; cy.type(), used to enter content information; cy.click(), used to click on the content; cy.check(), used to select a single / check box; cy.select(), used to select a drop-down box.

[0050] S104: Determine a test case that includes a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing an instrumentation operation on the test operation original instruction.

[0051] In one or more embodiments of the present specification, some test operation original instructions are overwritten, and stub codes are introduced therein to obtain corresponding test operation overwrite instructions. The test operation overwrite instructions may be consistent with the test operation original instructions in name form (for example, function name). In this way, there is no need to modify the original code that calls these test operation original instructions, such as the code blocks in the test cases. Furthermore, it is even possible to directly use the test cases previously written based on the test operation original instructions. After overwriting, the test operation original instructions in these test cases have essentially become test operation overwrite instructions.

[0052] Furthermore, according to actual needs, new input parameters may be added to the original instruction of the test operation during overwriting, so as to support some stub codes introduced by the overwriting that need to be run based on the new input parameters.

[0053] S106: executing the test case to execute the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation, so as to assist in recording the execution related conditions of the target operation to be tested.

[0054] In the test operation override instruction, in addition to instructing the execution of the original test operation, the stub code also instructs how to perform auxiliary recording, such as how to describe the current operation or step, what fields need to be recorded, when to record, whether screenshot recording is needed, the specific screenshot object, the output layout of the recorded content, etc.

[0055] In one or more embodiments of the present specification, the auxiliary records include at least: recording the actual executed target operation to be tested itself (which may be recording the operation process, and may also include additional descriptions adapted to the reporting requirements for easy understanding); for the test operation override instructions corresponding to the target operation to be tested, if the stub code in the test operation override instructions also indicates a screenshot operation, then the screenshot of the page targeted by the target operation to be tested may also be recorded, which is more intuitive and more substantial as reporting material.

[0056] S108: Automatically generate a test report according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0057] If the auxiliary record data itself contains the execution result of the target operation to be tested, the test report can be automatically generated directly based on the auxiliary record data. If the auxiliary record data does not contain the execution result, the execution result can be obtained in other ways, such as reading the output data of the function in the original instruction of the corresponding test operation, or obtaining the execution result through the capabilities that the automated testing tool may have, and even preliminarily organizing the execution result (for example, adding time stamps, structuring into a specified data format, etc.). The auxiliary record data can be output in chronological order and filled into the set test report template to automatically generate a test report. Of course, these data can also be laid out more finely according to the needs of ease of use and aesthetics.

[0058] In one or more embodiments of the present specification, the data of the corresponding auxiliary records are arranged in series according to the operation time sequence of each target operation to be tested that is actually executed (they can be arranged in time sequence before the same test case, and can also be arranged in order according to dimensions other than time between different test cases), so as to obtain a report content set consisting of multiple ordered content blocks; if the data of the auxiliary record itself does not contain the execution result of the corresponding target operation to be tested, the execution result is arranged in the ordered content block to which it belongs or in the next ordered content block; according to the laid out report content set, the automatically generated test report is obtained.

[0059] The specific size of the ordered content block can be pre-defined according to actual needs. For example, multiple steps can be divided in the test case in advance, and then the data recorded for each step can be divided into an ordered content block; for another example, multiple test cases can be divided into multiple use case sets according to the test dimensions they focus on, so that each use case set corresponds to an ordered content block; for another example, according to the target population of the test report to be generated, if the target population is internal personnel, the ordered content blocks can be carefully divided according to the normal functional performance dimensions to facilitate problem location and improved debugging. If the target population is the customers of the product to be delivered (i.e. the object to be tested), the focus can be on selecting the data recorded for the outstanding advantages and integrating them into ordered content blocks, while the relatively unimportant or mediocre data can be processed more simply.

[0060] In one or more embodiments of the present specification, the automatically generated test report can be an editable document, so as to realize the reverse iterative overwrite intuitively and efficiently, specifically including: after the test report is automatically generated, receiving the user's editing operation on the test report; determining the test operation overwrite instruction corresponding to the content or layout targeted by the editing operation; automatically converting the result of the editing operation into the overwrite correction logic, and re-overwriting the test operation overwrite instruction using the overwrite correction logic. The re-overwritten logic can be used as a new processing branch in the test operation overwrite instruction, and another test operation overwrite instruction can also be generated separately based on it.

[0061] For the automatic conversion in the previous paragraph, a mapping relationship can be established in advance between the area, content, and the code block, function, and parameter of the stub code in the test operation overwrite instruction, so that the document area and content involved in the operation result can be reversely located to the details in the stub code, and based on the coordinate positioning of the document area and content, semantic understanding, ORC and other processing methods, the details can be automatically modified to achieve automatic conversion.

[0062] In one or more embodiments of the present specification, the above scheme can be used for test report products within the product development stage; it can also be used for test reports provided to customers when the product is ready for delivery, generally referred to as acceptance reports. More specifically, the acceptance report, taking software products as an example, is a document written during the software testing process, especially at the end of the acceptance test phase. The purpose of the acceptance test is to confirm that the software meets business and user requirements. The acceptance report can include a series of acceptance criteria and test results to indicate whether the software is accepted by the customer (usually the business party or end user); the acceptance report can also include discovered defects, unresolved issues, and some suggestions and feedback. This report helps the project team and the customer to understand whether the software is ready to be deployed and used in a production environment.

[0063] The applicant focused on the acceptance report in this solution, so it attaches great importance to the improvement of usability. In the applicant's actual business scenario, during the website construction process, after the product deployment is completed, the test acceptance personnel will test and verify the product functions to ensure that there are no problems with the delivered product. After the acceptance is completed, an acceptance report needs to be issued for the site owner to review. The acceptance report will include product acceptance use case information, acceptance operation descriptions and related step screenshots, etc. Previously, the generation of the report was basically done manually, which is not only time-consuming and labor-intensive, but also has uneven styles and is difficult to form unified management. Therefore, the applicant has proposed the solution of this application, which specifically includes an automatic generation solution for acceptance reports based on Cypress original instruction stubs, so as to achieve the purpose of manpower saving, efficiency improvement and unified management.

[0064] pass Figure 1 The method overwrites the original test operation instructions of the automated testing tool, so that during the execution of the test case, the introduced plug-in code will be executed along with the test target operation, and the test will be carried out while assisting the recording in a targeted manner. Therefore, a higher quality test report can be automatically and efficiently generated, and the implementation cost is low and it is not easy to have errors and omissions; the plug-in can be overwritten according to actual needs, and the focus and granularity of the auxiliary recording can be adjusted, so that the flexibility and scalability are higher, and more detailed and more practical test-related data can be assisted in recording to be presented in the generated test report.

[0065] based on Figure 1 This specification also provides some specific implementation plans and extension plans of the method, which will be described below.

[0066] One or more embodiments of this specification provide a flowchart of a solution for overwriting the original instruction of the test operation of an automated test tool, see Figure 2 .

[0067] Figure 2 The process in includes the following steps:

[0068] S202: Before determining the test case including the test operation overwriting instruction corresponding to the test operation original instruction, obtaining a preset report automatic generation switch logic.

[0069] S204: Using the switch state corresponding to the switch logic (referred to as switch) automatically generated by the report as a selection condition, generate selection logic including a first processing branch and a second processing branch, wherein the second processing branch includes normal execution logic for the original instruction of the test operation.

[0070] The switch includes at least two optional states, one for selecting the first processing branch, and the other for selecting the second processing branch. In order to be consistent with intuition, it can be made that: when the report automatic generation switch logic is in the on state, it means that the test report needs to be automatically generated, then the first processing branch can be selected to continue execution, and not only the corresponding test operation will be performed in the first processing branch, but also the above-mentioned auxiliary records will be performed; and when the report automatic generation switch logic is in the off state, it means that the test report does not need to be automatically generated, then the second processing branch can be selected to continue execution, and only the corresponding test operation can be performed normally, without executing additional logic to generate the test report. In this way, the switch can be placed in the desired state through methods such as pre-configuration or immediate indication. The operation is flexible and efficient, and the degree of decoupling is good. When there is no need to automatically generate a test report, it will not affect the normal execution of the test case, especially the execution efficiency.

[0071] S206: In the first processing branch, the test operation original instruction is converted into a main object that is convenient for chain processing, and an auxiliary recording logic corresponding to the operation in the test operation original instruction is generated according to the characteristics of the operation, and the auxiliary recording logic is integrated into the main object.

[0072] In one or more embodiments of the present specification, the operation logic in the original instruction of the test operation can be disassembled in the first processing branch, and then the stubs can be inserted in it more carefully. This method is especially used in the case where the original test operation needs to be adjusted. In this way, not only auxiliary recording can be achieved, but also a deeper intervention can be made on the test operation itself, which can achieve more complex test operations, thereby increasing the flexibility of the test. If there is no need to intervene in the test operation itself, in order to prevent the test operation itself from being affected by the auxiliary record, the solution in step S206 can be adopted to convert the original instruction of the test operation into a main object that is convenient for chain processing. This also helps to improve the efficiency of subsequent recording. In this case, it is also convenient to reuse the auxiliary recording logic for other original instructions of the test operation.

[0073] Furthermore, as mentioned above, the switch has at least two states, and more optional states can be set. For example, a third processing branch is set specifically for intervening in the test operation itself. In the third processing branch, the operation logic in the original instruction of the test operation itself is modified to a certain extent. For example, a simulated erroneous operation is added. It is assumed that the operation logic itself is to long press button A, and the modified operation logic is to long press button A, or to click button A and button B next to button A at the same time.

[0074] According to the idea of ​​the third processing branch mentioned above, one or more embodiments of this specification also provide a flowchart of a rapid response solution for abnormal problems based on misoperation simulation logic, see Figure 3.exist Figure 3 In the scenario, the third processing branch mentioned above has multiple branches, corresponding to different misoperation simulation logics.

[0075] Figure 3 The process in includes the following steps:

[0076] S302: Acquire a test case set, and determine the third processing branches corresponding to different test cases in the test case set.

[0077] The test case set may include a large number of test cases. The larger the number of test cases, the more the advantages of this solution can be reflected. It should be noted that it is not required that all test cases include the third processing branch, nor is it required that all test operation overwrite instructions include the third processing branch. New test operation overwrite instructions can be generated based on existing test operation overwrite instructions.

[0078] S304: Calculate the operation habit matching degree between the misoperation simulation logics respectively included in each of the third processing branches.

[0079] The erroneous operation simulation logic can reflect different error ideas according to its operation characteristics. Some error ideas have different degrees of commonality. For the same user, the more consistent their operation habits (similarly, other factors such as equipment conditions and preferences) are, the higher the consistency of the corresponding error ideas is, and the more likely they are to make different erroneous operations with consistent ideas. Here, by matching operation habits, the erroneous operation simulation logic corresponding to the erroneous operations that may be made by the same user is gathered together to simulate the possible errors of the user in a more targeted manner.

[0080] S306: extracting multiple test case sub-sets from the test case set according to the operation habit matching degree.

[0081] If the operation habit matching degree is high enough, the corresponding test cases can be extracted to form a test case set to represent the operation behavior of a virtual user. Similarly, multiple test case sets are formed, and the test cases in different test case sets can be partially repeated.

[0082] S308: When a user reports an abnormal problem, matching is performed among the multiple test case sets according to the historical data of the user collected in advance, and a test case set is determined as a target subset.

[0083] Most of the erroneous operation simulation logics involved in the determined test case set are relatively consistent with the user's own operating habits. Therefore, the operations performed in the test case set can be approximately regarded as operations that the user is likely to perform in actual applications.

[0084] In one or more embodiments of the present specification, if the match fails, a new error operation simulation logic can be generated based on the user operations corresponding to the abnormal problem and / or other historical data of the user to better reflect the error operations that the user may make. According to the new error operation simulation logic, at least part of the test operation overwrite instructions are supplemented and overwritten to add a new third processing branch, thereby making up for the blind spots that may exist in the current test cases. This method is highly targeted and efficient, and helps to prevent abnormal problems that have not yet occurred from causing bad user withdrawals to the user in the future.

[0085] S310: Execute the test cases in the target subset to quickly respond to the abnormal problem.

[0086] In this case, since the scope of the iterative test is more accurately converged to the target subset, on the one hand, the execution efficiency is high, and on the other hand, it helps to discover test cases with higher practical value.

[0087] In one or more embodiments of the present specification, error operation simulation logic can be generated (for example, adaptively generated based on a large model) according to the operating habits of different users (for example, personality, hand size, preferences, etc.), or operations that are theoretically possible to be combined, and multiple processing branches containing error operation simulation logic can be set accordingly, thereby efficiently and more realistically simulating a large number of testers performing differentiated testing on the same test case.

[0088] Analyze the characteristics of the operations in the original instructions of the test operation to determine the dimensions on which these operations will be performed, and then focus on auxiliary records for these dimensions. For example, assuming that the operation is to access a link address, since this operation will result in a new page being opened or a page being redirected, the focus is on the dimension of dynamic page changes, and the content of the auxiliary records may include screenshots of page change status; for another example, if the operation is to add a large number of business threads, the focus is on the dimension of system pressure, and the content of the auxiliary records may include CPU and content occupancy status change data.

[0089] S208: Generate a test operation overwrite instruction corresponding to the test operation original instruction according to the selection logic.

[0090] The test operation overwrite instruction at least includes the selection logic, and may optionally include some description content and layout content, so as to better present the auxiliary recorded data in the subsequently generated test report.

[0091] pass Figure 2 The obtained test operation overwrite instruction can be conveniently switched back to execute the original test operation instruction by controlling the switch state, or flexibly switched to execute one or more auxiliary recording schemes, and can even directly intervene in the test operation itself, and has good decoupling and basically does not affect other original test operation instructions.

[0092] In one or more embodiments of the present specification, additional step-distinguishing custom instructions may be pre-written to better connect the auxiliary recorded data. In this case, the test case may be modified so that it also contains step-distinguishing custom instructions. Based on this, for example, the ordered content blocks are divided according to the position of the step-distinguishing custom instructions in the test case to represent different test steps; the step information generated by executing the step-distinguishing custom instructions is obtained; and the ordered content blocks are described as a whole using the step information as the complete content in the automatically generated test report. This helps to make the content in the test report more organized and easy to read and understand, which is especially friendly to customers who do not have enough knowledge of the technical details of the product.

[0093] It should be noted that you can also call the step distinction custom instructions directly in the test operation override instruction. In this case, you may not need to modify the test case, just intervene in some framework contents of the automated testing tool. For example, modify the implementation of the underlying original instructions of the test operation to the override content. For another example, install a plug-in customized based on this solution for the automated testing tool to intercept the call request for the original instructions of the test operation and replace them with the test operation override instructions, and so on.

[0094] According to the above description, in order to facilitate understanding and be more intuitive, one or more embodiments of this specification also provide a code schematic diagram of a test operation overwrite instruction, see Figure 4 .

[0095] exist Figure 4 In the example, the original instruction cy.visit() of the test operation for accessing the link address of Cypress is overwritten. It can be understood from the comments in the code that the parameters and function names involved are exemplary.

[0096] exist Figure 4 In the example, an environment variable parameter "flag" is used as the switch mentioned above. Then, by controlling the state value of "flag" as needed, the original instruction of the test operation is formally executed, while the main part of the inserted stub code is actually executed.

[0097] When "flag" is in the "true" state, the main components of the overwritten stub code will be selected for execution, so as to perform the original test operation on the one hand, and automatically generate step descriptions on the other hand to implement corresponding auxiliary records. The auxiliary records include the defined "stepName", "stepDescription", "operateType", "operateInfo" and other field contents (the meaning can be understood by referring to the literal meaning of the fields). To improve the description of the test operation, the defined function "cy.screenshot" is also included to automatically take screenshots of the corresponding content. When "flag" is not in the "true" state, "originalFn" will be returned, indicating that the original instruction of the test operation is executed normally.

[0098] Of course, according to the previous description, more selection branches can be added to directly intervene in the test operation itself to achieve more flexible and complex new test operations. In this case, "flag" may not be a Boolean variable, but a variable with more possible values, such as an enumeration variable or other numeric variable.

[0099] As mentioned above, this application focuses on the acceptance report scenario. According to the above description, more completely, one or more embodiments of this specification also provide a Cypress-based acceptance report automatic generation solution, which is Figure 1 An exemplary embodiment of the method.

[0100] Some Cypress instructions (as the original quality of the above-mentioned test operations) are overwritten in advance. For example, after overwriting, they include: cy.visit() for recording the visited link address; cy.type() for recording the input content information; cy.click() for recording the clicked content; cy.check() for recording the selection of single / checkboxes; cy.select() for recording the selection of drop-down boxes; and so on. The access of these instructions adopts a non-intrusive design, and no code modification is required on the user side, and they will be recorded automatically. For some steps, if necessary, an additional "stepDescription" parameter can be passed to indicate the specific meaning of the step. The parameter passing method can be seen in the use case sample code below.

[0101] At the same time, two new custom instructions are added (which can be used as the above steps to distinguish custom instructions) to supplement and improve the report content, including:

[0102] cy.addCaseDescription('caseDescription'): used to add description information of the test case, for example, it can be called once for each test case;

[0103] cy.addStep('stepName','stepDescription'): This is used to add a step information.

[0104] Based on the above override instructions and custom instructions, a sample test case code is written as follows:

[0105] describe('test_name',function(){

[0106] it('what_it_does',function(){

[0107] / / Add the use case description for this test case, and describe the scenario, process, etc. of this use case in detail

[0108] cy.addCaseDescription("Acceptance report test")

[0109] cy.viewport(1920,1080);

[0110] cy.visit('https: / / www.m…test.com);

[0111] cy.wait(3000);

[0112] / / Manually add a step

[0113] cy.addStep("Account login","Enter the correct account password to log in to the system")

[0114] cy.xpath(' / / span[text()="Login"]',

[0115] {timeout:60000}).should('contain','Login');

[0116] cy.get('#username').click();

[0117] cy.get('#username').type(ˋhuan…testˋ,{stepDescription:"Enter login information in the first input box"});

[0118] cy.get('#userpass').type(ˋ12…QYˋ,{stepDescription:"Enter login information in the second input box"});

[0119] cy.wait(3000);

[0120] / / Since the content clicked contains "Login", the steps for "Click the Login button" will be automatically generated

[0121] cy.xpath(' / / span[text()="Login"]').click({force:true});

[0122] cy.wait(3000)

[0123] cy.wait(3000);

[0124] / / Since the following content clicked contains the corresponding content, the appropriate steps will be automatically generated, and there is no need to add stepDescription step information

[0125] cy.xpath(' / / span[text()="Operation and Maintenance Change Management"]').click({force:true});

[0126] cy.xpath(' / / span[text()="Operation and Maintenance Change Management"]',{timeout:60000}).should('contain','Operation and Maintenance Change Management');

[0127] cy.wait(3000);

[0128] cy.xpath(' / / span[text()="My Changes"]').click({force:true});

[0129] };

[0130] };

[0131] As can be seen, in the above test cases, the custom instructions cy.addCaseDescription("Acceptance Report Test") and cy.addStep("Account Login", "Enter the correct account password to log in to the system") are used, and the overridden instructions such as cy.visit('https: / / www.m…test.com) are also used. Of course, instructions such as cy.get and cy.xpath can also be overridden instructions. It should be noted that some content such as website URLs and account numbers has been partially masked to protect privacy without affecting the understanding of this solution.

[0132] One or more embodiments of this specification also provide a partial content schematic diagram of an acceptance report generated by a method based on Figure 1 See Figure 5 .

[0133] exist Figure 5 In the test report, each step is automatically distinguished and described in an orderly and clear manner. In the specific steps, the automatic auxiliary recording includes the link address visited, the information entered, and the relevant screenshots. Similarly, the execution-related information of different test cases can be automatically recorded in a similar manner and automatically displayed according to the required layout, finally forming a complete acceptance report, which is substantial and easy to understand for customers.

[0134] Compared with the two prior arts mentioned in the background technology, the above scheme can solve the problems existing therein. Including: being able to solve the problems of low efficiency and uneven quality in the manual generation process, automatically recording operation information and automatically generating acceptance reports by overwriting the original plug-in instructions, the process is completed automatically without manual intervention, and because it is based on Cypress, a general web testing framework, it is suitable for most products, and can ensure that the generated report format is unified and the data is standard; it can solve the problems of coarse granularity and poor scalability of Mochawesome and other report plug-ins, by overwriting the common visit, type, press and other instructions of Cypress, automatically collecting the step information of the use case, and reflecting the detailed process record in the report. In addition, by providing additional methods such as addStep, it supports users to expand additional process information, and has good flexibility.

[0135] Based on the same idea, one or more embodiments of this specification also provide devices and apparatuses corresponding to the above methods, such as Figure 6 , Figure 7 The apparatus and device can accordingly execute the above method and related optional solutions.

[0136] Figure 6 A schematic diagram of a test report generating device provided in one or more embodiments of this specification, the device comprising:

[0137] A test tool determination module 602 determines an automated test tool having a plurality of test operation original instructions;

[0138] The overwriting instruction case module 604 determines a test case including a test operation overwriting instruction corresponding to the test operation original instruction, wherein the test operation overwriting instruction is obtained by overwriting the test operation original instruction by performing a stub operation;

[0139] A test auxiliary recording module 606 executes the test case to execute the target operation to be tested in the test operation overwriting instruction contained therein, and the plugging code introduced based on the plugging operation, so as to assist in recording the execution related conditions of the target operation to be tested;

[0140] The test report generating module 608 automatically generates a test report according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0141] Optionally, it also includes:

[0142] The original instruction overwriting module 610 obtains a preset report automatic generation switch logic before determining the test case including the test operation overwriting instruction corresponding to the test operation original instruction;

[0143] Using the switch state corresponding to the switch logic automatically generated by the report as a selection condition, generating a selection logic including a first processing branch and a second processing branch, wherein the second processing branch includes a normal execution logic for the original instruction of the test operation;

[0144] In the first processing branch, the test operation original instruction is converted into a main object that is convenient for chain processing, and auxiliary recording logic adapted to the operation in the test operation original instruction is generated according to the characteristics of the operation, and the auxiliary recording logic is integrated into the main object;

[0145] According to the selection logic, a test operation overwrite instruction corresponding to the test operation original instruction is generated.

[0146] Optionally, the selection logic further comprises: a third processing branch generated by taking the switch state corresponding to the report automatic generation switch logic as a selection condition;

[0147] The original instruction overwriting module 610 generates user misoperation simulation logic according to the operation habits of different users;

[0148] Generate misoperation simulation logic;

[0149] According to the erroneous operation simulation logic, the operation logic in the original instruction of the test operation is modified to generate the third processing branch including the erroneous operation simulation logic.

[0150] Optionally, the third processing branch has multiple branches, corresponding to different misoperation simulation logics respectively;

[0151] The test auxiliary recording module 606 obtains a test case set, and determines the third processing branches corresponding to different test cases in the test case set;

[0152] Calculating the operation habit matching degree between the misoperation simulation logics respectively included in each of the third processing branches;

[0153] Extracting a plurality of test case sets from the test case set according to the operation habit matching degree;

[0154] When a user reports an abnormal problem, matching is performed among the multiple test case sets according to the historical data of the user collected in advance, and a test case set is determined as a target subset;

[0155] The test cases in the target subset are executed to quickly respond to the abnormal problem.

[0156] Optionally, the test auxiliary recording module 606, after matching the user's historical data collected in advance in the set of multiple test cases, generates a new misoperation simulation logic according to the user operation corresponding to the abnormal problem and / or other historical data of the user if the matching fails;

[0157] According to the new misoperation simulation logic, at least part of the test operation overwrite instruction is supplementarily overwritten to add a new third processing branch.

[0158] Optionally, the test auxiliary recording module 606 records the actually executed target operation to be tested;

[0159] For the test operation overwrite instruction corresponding to the target operation to be tested, if the stub code in the test operation overwrite instruction also indicates a screenshot operation, the screenshot of the page targeted by the target operation to be tested is also recorded.

[0160] Optionally, the test report generating module 608 arranges the data of the corresponding auxiliary records in series according to the operation time sequence of each target operation to be tested actually performed, so as to obtain a report content set consisting of a plurality of ordered content blocks;

[0161] If the data of the auxiliary record itself does not contain the execution result of the corresponding target operation to be tested, the execution result is laid out in the ordered content block to which it belongs or in the next ordered content block;

[0162] According to the report content set after layout, an automatically generated test report is obtained.

[0163] Optionally, the test case further includes an additional step to distinguish custom instructions;

[0164] A test report generating module 608, which distinguishes the positions of the custom instructions in the test case according to the steps, and divides the ordered content blocks to represent different test steps;

[0165] Obtaining step information corresponding to the generated step by distinguishing the custom instructions through executing the steps;

[0166] The step information is used to describe the ordered content blocks as a whole as the complete content in the automatically generated test report.

[0167] Optionally, the test report is an editable document;

[0168] The test auxiliary recording module 606 receives a user's editing operation on the test report after the test report is automatically generated;

[0169] Determine a test operation overwriting instruction corresponding to the content or layout targeted by the editing operation;

[0170] The result of the editing operation is automatically converted into an overwrite correction logic, and the overwrite correction logic is used to re-overwrite the test operation overwrite instruction.

[0171] Optionally, the test operation original instruction is used to perform at least one of the following operations:

[0172] Visit the link address; enter content information; click; select the radio button or check box; select from the drop-down box.

[0173] Figure 7 A schematic diagram of a test report generating device provided for one or more embodiments of this specification, the device comprising:

[0174] at least one processor; and,

[0175] a memory communicatively connected to the at least one processor; wherein,

[0176] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute:

[0177] Identify automated test tools with multiple test operation primitives;

[0178] Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction;

[0179] By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution related situation of the target operation to be tested;

[0180] A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0181] Based on the same idea, one or more embodiments of this specification further provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:

[0182] Identify automated test tools with multiple test operation primitives;

[0183] Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction;

[0184] By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution related situation of the target operation to be tested;

[0185] A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

[0186] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0187] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0188] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0189] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0190] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0191] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0192] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0194] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0195] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0196] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0197] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0198] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0199] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0200] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0201] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.

Claims

1. A test report generation method, comprising: Identify automated test tools with multiple test operation primitives; Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction; By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution related situation of the target operation to be tested; A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

2. The method according to claim 1, before determining the test case including the test operation overwrite instruction corresponding to the test operation original instruction, the method further comprises: Get the pre-set report automatic generation switch logic; Using the switch state corresponding to the switch logic automatically generated by the report as a selection condition, generating a selection logic including a first processing branch and a second processing branch, wherein the second processing branch includes a normal execution logic for the original instruction of the test operation; In the first processing branch, the test operation original instruction is converted into a main object that is convenient for chain processing, and auxiliary recording logic adapted to the operation in the test operation original instruction is generated according to the characteristics of the operation, and the auxiliary recording logic is integrated into the main object; According to the selection logic, a test operation overwrite instruction corresponding to the test operation original instruction is generated.

3. The method of claim 2, wherein the selection logic further comprises: a third processing branch generated by using the switch state corresponding to the report automatic generation switch logic as a selection condition; The method further comprises: Generate misoperation simulation logic; According to the erroneous operation simulation logic, the operation logic in the original instruction of the test operation is modified to generate the third processing branch including the erroneous operation simulation logic.

4. The method according to claim 3, wherein the third processing branch has a plurality of branches, each corresponding to a different erroneous operation simulation logic; The executing of the instrumentation code introduced based on the instrumentation operation by executing the test case specifically includes: Acquire a test case set, and determine the third processing branches corresponding to different test cases in the test case set; Calculating the operation habit matching degree between the misoperation simulation logics respectively included in each of the third processing branches; Extracting a plurality of test case sets from the test case set according to the operation habit matching degree; When a user reports an abnormal problem, matching is performed among the multiple test case sets according to the historical data of the user collected in advance, and a test case set is determined as a target subset; The test cases in the target subset are executed to quickly respond to the abnormal problem.

5. The method according to claim 4, after matching the pre-collected historical data of the user in the set of multiple test cases, the method further comprises: If the matching fails, a new misoperation simulation logic is generated according to the user operation corresponding to the abnormal problem and / or other historical data of the user; According to the new misoperation simulation logic, at least part of the test operation overwrite instruction is supplementarily overwritten to add a new third processing branch.

6. The method according to claim 1, wherein the auxiliary recording of the execution-related conditions of the target operation to be tested specifically comprises: Recording the actually executed target operation to be tested; For the test operation overwrite instruction corresponding to the target operation to be tested, if the stub code in the test operation overwrite instruction also indicates a screenshot operation, the screenshot of the page targeted by the target operation to be tested is also recorded.

7. The method according to claim 1, wherein the test report is automatically generated according to the execution result of the target operation to be tested and the auxiliary recorded data, specifically comprising: According to the operation time sequence of each of the target operations to be tested that are actually performed, the corresponding data of the auxiliary records are arranged in series to obtain a report content set consisting of a plurality of ordered content blocks; If the data of the auxiliary record itself does not contain the execution result of the corresponding target operation to be tested, the execution result is laid out in the ordered content block to which it belongs or in the next ordered content block; According to the report content set after layout, an automatically generated test report is obtained.

8. The method of claim 7, wherein the test case further comprises an additional step of distinguishing custom instructions; The step of automatically generating a test report based on the execution result of the target operation to be tested and the data of the auxiliary record specifically includes: Distinguishing the positions of the custom instructions in the test case according to the steps, and dividing the ordered content blocks to represent different test steps; Obtaining step information corresponding to the generated step by distinguishing the custom instructions through executing the steps; The step information is used to describe the ordered content blocks as a whole as the complete content in the automatically generated test report.

9. The method according to claim 1 or 7, wherein the test report is an editable document; After the test report is automatically generated, the method further includes: Receiving a user's editing operation on the test report; Determine a test operation overwriting instruction corresponding to the content or layout targeted by the editing operation; The result of the editing operation is automatically converted into an overwrite correction logic, and the overwrite correction logic is used to re-overwrite the test operation overwrite instruction.

10. The method according to any one of claims 1 to 8, wherein the test operation original instruction is used to perform at least one of the following operations: Visit the link address; enter content information; click; select the radio button or check box; select from the drop-down box.

11. A test report generating device, comprising: A test tool determination module determines an automated test tool having a plurality of test operation primitive instructions; An overwriting instruction case module determines a test case including a test operation overwriting instruction corresponding to the test operation original instruction, wherein the test operation overwriting instruction is overwritten by performing a stub operation on the test operation original instruction; A test auxiliary recording module executes the test case to execute the target operation to be tested in the test operation overwriting instruction contained therein, and the plugging code introduced based on the plugging operation, so as to assist in recording the execution related conditions of the target operation to be tested; The test report generation module automatically generates a test report according to the execution result of the target operation to be tested and the data of the auxiliary record.

12. The apparatus of claim 11, further comprising: The original instruction overwriting module obtains a preset report automatic generation switch logic before determining the test case including the test operation overwriting instruction corresponding to the test operation original instruction; Using the switch state corresponding to the switch logic automatically generated by the report as a selection condition, generating a selection logic including a first processing branch and a second processing branch, wherein the second processing branch includes a normal execution logic for the original instruction of the test operation; In the first processing branch, the test operation original instruction is converted into a main object that is convenient for chain processing, and auxiliary recording logic adapted to the operation in the test operation original instruction is generated according to the characteristics of the operation, and the auxiliary recording logic is integrated into the main object; According to the selection logic, a test operation overwrite instruction corresponding to the test operation original instruction is generated.

13. The apparatus of claim 12, wherein the selection logic further comprises: a third processing branch generated by taking the switch state corresponding to the report automatic generation switch logic as a selection condition; The original instruction overwriting module generates misoperation simulation logic; According to the erroneous operation simulation logic, the operation logic in the original instruction of the test operation is modified to generate the third processing branch including the erroneous operation simulation logic.

14. The device according to claim 13, wherein the third processing branch has a plurality of branches, each corresponding to a different erroneous operation simulation logic; The test auxiliary recording module obtains a test case set, and determines the third processing branches corresponding to different test cases in the test case set; Calculating the operation habit matching degree between the misoperation simulation logics respectively included in each of the third processing branches; Extracting a plurality of test case sets from the test case set according to the operation habit matching degree; When a user reports an abnormal problem, matching is performed among the multiple test case sets according to the historical data of the user collected in advance, and a test case set is determined as a target subset; The test cases in the target subset are executed to quickly respond to the abnormal problem.

15. The device according to claim 14, wherein the test auxiliary recording module, after matching the user's historical data collected in advance in the set of multiple test cases, generates a new misoperation simulation logic according to the user operation corresponding to the abnormal problem and / or other historical data of the user if the matching fails; According to the new misoperation simulation logic, at least part of the test operation overwrite instruction is supplementarily overwritten to add a new third processing branch.

16. The device according to claim 11, wherein the test auxiliary recording module records the actually executed target operation to be tested; For the test operation overwrite instruction corresponding to the target operation to be tested, if the stub code in the test operation overwrite instruction also indicates a screenshot operation, the screenshot of the page targeted by the target operation to be tested is also recorded.

17. The device according to claim 11, wherein the test report generating module arranges the data of the corresponding auxiliary records in series according to the operation time sequence of each of the target operations to be tested actually performed, so as to obtain a report content set consisting of a plurality of ordered content blocks; If the data of the auxiliary record itself does not contain the execution result of the corresponding target operation to be tested, the execution result is laid out in the ordered content block to which it belongs or in the next ordered content block; According to the report content set after layout, an automatically generated test report is obtained.

18. The apparatus of claim 17, wherein the test case further comprises an additional step of distinguishing custom instructions; The test report generation module distinguishes the positions of the custom instructions in the test case according to the steps, and divides the ordered content blocks to represent different test steps; Obtaining step information corresponding to the generated step by distinguishing the custom instructions through executing the steps; The step information is used to describe the ordered content blocks as a whole as the complete content in the automatically generated test report.

19. The device according to claim 11 or 17, wherein the test report is an editable document; The test auxiliary recording module receives a user's editing operation on the test report after the test report is automatically generated; Determine a test operation overwriting instruction corresponding to the content or layout targeted by the editing operation; The result of the editing operation is automatically converted into an overwrite correction logic, and the overwrite correction logic is used to re-overwrite the test operation overwrite instruction.

20. The apparatus according to any one of claims 11 to 18, wherein the test operation original instruction is used to perform at least one of the following operations: Visit the link address; enter content information; click; select the radio button or check box; select from the drop-down box.

21. A test report generating device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute: Identify automated test tools with multiple test operation primitives; Determine a test case including a test operation overwrite instruction corresponding to the test operation original instruction, wherein the test operation overwrite instruction is overwritten by performing a stub operation on the test operation original instruction; By executing the test case, the target operation to be tested in the test operation overwriting instruction contained therein and the plugging code introduced based on the plugging operation are executed to assist in recording the execution related situation of the target operation to be tested; A test report is automatically generated according to the execution result of the target operation to be tested and the data of the auxiliary record.

Citation Information

Patent Citations

  • Terminal test method and device, computer equipment and storage medium

    CN110389895A

  • Project test method and device and storage medium

    CN114691514A

  • Time sequence database security test method, device and equipment

    CN116450611A

  • Test processing method, device and equipment

    CN116881152A

  • Method and device for determining coverage rate of test case, equipment and storage medium

    CN118535464A