Front-end test information display method and display device, electronic equipment

By generating test tasks and counting the test coverage parameters of the front-end code, the problem of low efficiency in front-end code testing coverage evaluation in the existing technology is solved, and automatic reporting of front-end code coverage and project quality improvement is achieved.

CN113986749BActive Publication Date: 2025-04-08BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111316492.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-08
Publication Date
2025-04-08
Estimated Expiration
2041-11-08

AI Technical Summary

Technical Problem

The test coverage of front-end code cannot be effectively evaluated and counted in the prior art, resulting in inefficiency and lack of evaluation methods.

Method used

By generating test tasks, accessing the front-end link address, testing the compiled code in the compilation file, counting the code execution identifier and test coverage parameters, and displaying the test coverage parameters in response to the output instructions.

Benefits of technology

It realizes automatic reporting and statistics of front-end code coverage, improves the overall quality of the project, ensures system stability, and reduces the online missed test rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986749B_ABST
    Figure CN113986749B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for displaying front-end test information, and an electronic device, wherein the display method includes: generating a test task, wherein the test task tests the compiled code in the compilation file of the front-end of the target to be tested by accessing the link address of the front-end of the target to be tested; executing the test task, and counting the code execution identifier and test coverage parameters generated in the test task, wherein the code execution identifier is used to identify the compiled code of the tested line, and the test coverage parameter is the ratio of the compiled code tested to the total code of the compilation file; and displaying the test coverage parameter in response to an output instruction. By realizing the automatic reporting and statistics of the front-end code coverage rate, the overall quality of the test project is improved, the system stability is guaranteed, and the online missed test rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of application testing technology, and in particular to a method and device for displaying front-end test information, and an electronic device. Background Art

[0002] In the related technology, there are three common methods for application code testing: 1. The industry has code coverage statistics tools for backend servers, such as jacoco; 2. Statistics coverage through interfaces in the project process; 3. Manual coverage statistics; However, all three methods have obvious disadvantages: For the first method, it only targets backend servers and there is no coverage evaluation method for front-end functions; for the second method, there is currently no front-end project coverage statistics tool node; for the third method, manual coverage is not only inefficient, but also lacks good evaluation methods. At the same time, in the current code testing method, the statistical card point step of front-end function coverage is not added to the overall project process. Summary of the invention

[0003] The present disclosure provides a method and device for displaying front-end test information, and an electronic device, to at least solve the problem in the related art that the front-end code test process cannot be evaluated and the statistical efficiency is low. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, a method for displaying front-end test information is provided, comprising: generating a test task, wherein the test task tests the compiled code in the compilation file of the front-end of the target to be tested by accessing the link address of the front-end of the target to be tested; executing the test task, and counting the code execution identifier and test coverage parameters generated in the test task, wherein the code execution identifier is used to identify the compiled code of the tested line, and the test coverage parameter is the ratio of the compiled code that has been tested to the total code of the compilation file; and displaying the test coverage parameter in response to an output instruction.

[0005] According to a second aspect of an embodiment of the present disclosure, a display device for front-end test information is provided, comprising: a generation unit, for generating a test task, wherein the test task tests the compilation code in the compilation file of the front-end of the target to be tested by accessing the link address of the front-end of the target to be tested; a statistical unit, for executing the test task, and counting the code execution identifier and test coverage parameters generated in the test task, wherein the code execution identifier is used to identify the compilation code of the tested line, and the test coverage parameter is the ratio of the compiled code that has been tested to the total code of the compilation file; and a display unit, for displaying the test coverage parameter in response to an output instruction.

[0006] According to another aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method for displaying front-end test information as described above.

[0007] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is further provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the method for displaying front-end test information as described in any one of the above items.

[0008] According to another aspect of an embodiment of the present disclosure, a computer program product is further provided, including a computer program / instruction, wherein the computer program / instruction implements the above-mentioned method for displaying front-end test information when executed by a processor.

[0009] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0010] After generating the test task, the test task is executed, and the code execution identifier and test coverage parameters generated in the test task are counted, wherein the code execution identifier is used to identify the compiled code of the tested line, and the test coverage parameter is the ratio of the compiled code that has been tested to the total code of the compiled file. In response to the output instruction, the test coverage parameter is displayed. By installing the front-end code test plug-in, the code coverage parameters and coverage rate are counted, and the associated task is created on the front-end coverage rate statistics platform (that is, the test task is created on the statistics platform, and the test task is associated with the test code branch given by the development end), and then the covered code lines and branch codes are reported by accessing the front-end website for splicing (binding relationship), and the uncovered code is presented on the platform, and the code update coverage rate is reported in real time, thereby solving the problem of the lack of statistical means for the code coverage of the front-end in the demand project, the lack of front-end exit checkpoints in the project process, and the lack of evaluation standards for development and PM self-test projects. The front-end code coverage rate is automatically reported and counted, improving the overall quality of the project, ensuring system stability, and reducing the online missed test rate.

[0011] In this embodiment, the coverage parameters and coverage rate can be counted, and then based on the user's output instructions (for example, a virtual button is touched to indicate the display of coverage rate, code execution range, etc.), the code execution identifier and test coverage parameters generated in the statistical test task can be displayed. In this application, during testing, data such as coverage rate and error rate can be changed according to the length of time.

[0012] In this application, the front-end coverage data is used to formulate the test pass standard and serve as the project exit checkpoint. At the same time, the code files and lines of the changed branch are visualized to clearly show the scope of the code changes. During the test, the coverage of each file and code line can be dynamically viewed to facilitate QA to check for omissions and reduce the online missed test rate.

[0013] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0015] Figure 1 It is a schematic diagram of an implementation environment of a method for displaying front-end test information according to an exemplary embodiment.

[0016] Figure 2 The present invention is a flowchart of an optional method for displaying front-end test information according to an exemplary embodiment.

[0017] Figure 3 It is a schematic diagram of an optional front-end testing process system according to an exemplary embodiment.

[0018] Figure 4 The invention is a device block diagram of an optional device for displaying front-end test information according to an exemplary embodiment. DETAILED DESCRIPTION

[0019] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0021] The present application can be applied to code testing platform / code testing statistics platform / front-end statistics platform, and mainly performs test statistics on programming code text of front-end applications. By installing plug-ins on the front-end code, the test subject creates associated tasks on the front-end coverage statistics platform after the project is involved in the test (i.e., creates a test task on the statistics platform, and the test task is associated with the test code branch given by the development end). Then, the covered lines and branch codes are reported by splicing (binding relationship) when accessing the front-end domain name, and the counted uncovered code is presented on a platform, and the code update coverage is reported in real time (the code update coverage is changed approximately every 10 seconds).

[0022] After receiving the test project (the developer compiles the code file according to the development requirements, and tests the front-end code project indicated in the code file), the code testing platform / front-end statistics platform / coverage statistics plug-in can be introduced in the front-end development in advance to realize the front-end code coverage statistics.

[0023] In this application, the front-end code coverage index is used as a checkpoint in the project process, which adds a statistical method for the online standard for the self-testing requirements of the development product, and improves the standardization of the process. At the same time, through the statistics of the front-end coverage data, the code granularity that is not covered by the project is found, and then the use cases are supplemented to reduce the online missed test rate.

[0024] This application can also intuitively display uncovered code through a visual platform interface, allowing testers to more clearly understand the test completion and determine whether the evaluation criteria and evaluation scope are reasonable.

[0025] The present application is described in detail below in conjunction with various embodiments of the present application.

[0026] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a method for displaying front-end test information according to an exemplary embodiment. Figure 1 , the implementation environment:

[0027] It includes an electronic terminal 101 and a server 102 .

[0028] The electronic terminal 101 may be a smart phone, tablet computer, laptop computer, desktop computer or other electronic device with display function. The electronic terminal 101 has the function of rendering the front-end page corresponding to any view application / view tool (for example, displaying the code coverage, test cases, tested code branches counted by code statistics evaluation, and intuitively displaying the tested code files, displayed on the front-end page). In some embodiments, a browser front-end / local front-end is installed on the electronic terminal 101, and the electronic terminal 101 renders the front-end page corresponding to any application / tool ​​by running the browser front-end.

[0029] It should be noted that the electronic terminal 101 generally refers to one of a plurality of terminals, and this embodiment is only illustrated by the electronic terminal 101. Those skilled in the art will appreciate that the number of the above terminals may be more or less. For example, the above terminals may be only a few, or the above terminals may be dozens or hundreds, or a greater number, and the embodiment of the present disclosure does not limit the number of terminals and device types.

[0030] The server 102 may be one server, multiple servers, a cloud server, a cloud computing platform, or a virtualization center. In some embodiments, the server 102 is a background server of any application or any multiple applications, and the server 102 stores resources for rendering pages belonging to the any application or the any multiple applications. The server 102 provides background services for page rendering of the any application or the any multiple applications based on the stored resources.

[0031] The electronic terminal 101 communicates with the server 102 via a wireless network or a wired network. The electronic terminal 101 runs a browser front end, responds to a page rendering instruction, and the URL corresponding to the page rendering instruction belongs to the application corresponding to the server 102, and communicates with the server 102 to obtain resources for rendering the page corresponding to the URL, and renders the page corresponding to the URL based on the obtained resources. It should be noted that the server 102 generally refers to one of a plurality of servers, each of which is a background server of a different application, and the electronic terminal 101 renders pages of different applications by communicating with the background servers of different applications.

[0032] It should be noted that, in some embodiments, the above Figure 1 The electronic terminal 101 (or mobile device) shown has a touch display (also called a "touch screen" or "touch display screen"). In some embodiments, the above Figure 1 The electronic terminal 101 (or mobile device) shown has a graphical user interface (GUI), and the user can perform human-computer interaction with the GUI through finger contacts and / or gestures on the touch display surface. The human-computer interaction functions here optionally include the following interactions: clicking virtual buttons, word processing, making electronic reports, sending and receiving emails, call interface, web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product executable by one or more processors or a readable storage medium.

[0033] In this embodiment, the coverage parameters and coverage rate can be counted, and then based on the user's output instructions (for example, a virtual button is touched to indicate the display of coverage rate, code execution range, etc.), the code execution identifier and test coverage parameters generated in the statistical test task can be displayed. In this application, during testing, data such as coverage rate and error rate can be changed according to the length of time.

[0034] Figure 2 is a flowchart of an optional method for displaying front-end test information according to an exemplary embodiment. Figure 2 As shown, the following steps are included:

[0035] In step S201, a test task is generated, and the test task tests the compilation code in the compilation file of the front end of the target to be tested by accessing the link address of the front end of the target to be tested.

[0036] Optionally, generating a test task includes: after receiving the test project, determining the task type of the test task based on the project information of the test project; creating a task name of the test task based on the task type; and determining the code execution branch and code repository of the test task based on the project information of the test project.

[0037] A test project may refer to a project for testing programming files / code files provided by the development end, and the programming files are generated based on the demand products. The types of programming files include, but are not limited to: patch files, version update files. Through the test project, the programming file / code file can be tested for omissions, deviations, bugs, etc. During the test process, the data corresponding to the programming file and the application running data are often placed on the back-end server, but the effect display and the interaction results with the user are displayed on the front end. Therefore, during the test, it is necessary to test the front-end programming code, and at the same time, perform statistics on the tested code coverage, tested code branches, and tested code lines, and display the real-time test results and coverage statistics.

[0038] In this embodiment, a coverage statistics plug-in may be pre-installed in the compiled code (mainly the front-end code) in the compilation file, so that after the project is involved in the test, the plug-in can be used to create associated test tasks.

[0039] In this embodiment, the project information may include but is not limited to: project name, project number, project requirement document, project developer, project type, and compiled code file of the project. The task name may be text, characters, numbers, or a combination of names.

[0040] The code execution branch in this embodiment refers to the branches in the compiled code, which generally record the source branch name and the target branch name, such as the performance recording branch, the sliding position recording branch, etc. The code warehouse refers to the code library called by the compilation file, or refers to the basic warehouse for developing products.

[0041] When displaying, it is necessary to specifically display the code files of the changed branches and the details page with a visual display of the number of lines (the displayed test details page includes: which files have been changed, visual coverage of the tested code, branches, reports), etc.

[0042] Optionally, when creating a test task associated with a test project, this embodiment can be created on a pre-built front-end coverage statistics platform. After completing the creation of the test task, you can bind the relationship between the test task and the front-end by accessing the front-end URL / domain name, report the code lines and branch codes covered by the test process in real time, and present the uncovered code in a platform-based manner.

[0043] Figure 3 is a schematic diagram of an optional front-end test process system according to an exemplary embodiment. Figure 3 As shown, it includes four stages: demand stage, development stage, testing and online. Among them, the demand stage refers to receiving user development requirements (including fixing bugs, developing new functions, etc.). In the development stage, developers compile code files based on development requirements. At the same time, coverage statistics plug-ins can be introduced in this stage. In testing, front-end code test coverage statistics can be performed. In the online stage, it means that the test passes, meets the test standards, and is put into operation.

[0044] During the test phase, you can introduce the coverage statistics plug-in in the compilation file, link the coverage statistics platform, determine the front end of the test, and then create a test task (mainly including: task name, code branch, code repository, coverage diff type), and generate a task identifier (i.e., generate a task CoverID), and then enter the test code coverage statistics platform to obtain the front-end coverage. Create associated tasks on the front-end coverage statistics platform, and then report the covered lines and branch codes by splicing (binding relationship) when accessing the front-end domain name (with the task identifier), and present the uncovered code on the platform.

[0045] In step S203, the test task is executed, and the code execution identifier and test coverage parameters generated in the test task are counted, wherein the code execution identifier is used to identify the compilation code of the tested line, and the test coverage parameter is the ratio of the tested compilation code to the total code of the compilation file.

[0046] Optionally, in this embodiment, after counting the code execution identifiers generated in the test task, the method further includes: determining the code lines of the compiled code that have been executed and the code lines of the compiled code that have not been executed; identifying the code lines of the compiled code that have been executed by using a first identification condition, and displaying the code execution identifier; identifying the code lines of the compiled code that have not been executed by using a second identification condition, and displaying the code non-execution identifier.

[0047] The first identification condition and the second identification condition in this embodiment can be set in advance by the test platform. For example, they can be identified by color, with the first identification condition set to green and the second identification condition set to black. The colors can be used to cover the tested codes and untested codes to intuitively display the code testing progress.

[0048] In step S205 , in response to the output instruction, the test coverage parameters are displayed.

[0049] An optional step of displaying test coverage parameters in response to an output instruction also includes: counting the code lines of compiled code executed under each code execution branch; calculating the ratio of the code lines of compiled code executed under the code execution branch to all code lines under the code execution branch to obtain the code execution coverage; and displaying the code execution coverage corresponding to each code execution branch in response to a coverage output instruction.

[0050] By counting the code execution coverage, you can dynamically view the coverage of each file and code line during the test process, which is convenient for QA to check for omissions and reduce the online missed test rate. The code execution coverage can be a percentage, and the coverage parameters can intuitively display the tested code.

[0051] The front-end code execution coverage is reported in real time, and the seriousness of the test requirements and the coverage of the use case execution can be directly quantified and counted.

[0052] Another optional step of displaying the test coverage parameters in response to the output instruction also includes: counting the coverage of the test items that have passed the code test, and determining whether the test file is complete and needs to be modified by comparing the project test coverage.

[0053] In order to ensure smooth testing during the testing process, test files can be written in advance, and front-end code tests can be performed on the test projects through test files. During the testing process, test files need to be continuously updated to ensure that test files mark the coverage of test projects and that all code branches within the test projects can be tested. Therefore, it is necessary to count the project test coverage to determine whether the test files need to be modified in a timely manner.

[0054] In this embodiment, during the process of compiling the test file, the requirement document of the requirement phase may be referred to, and based on the requirement document, the requirement coverage during the test process may be determined to ensure that the compiled code file covers customer requirements.

[0055] In this embodiment, the step of displaying the test coverage parameters in response to the output instruction also includes: if code change information input by an external module is received during the execution of the test task; in response to the output instruction to display the code change, the code change range is displayed.

[0056] By displaying the scope of code changes, developers can be shown that their compiled code files are incomplete or have defects. Therefore, the compiled code files need to be updated and modified to improve the demand coverage of the compiled code files and improve user satisfaction.

[0057] Alternatively, in response to the output instruction, the step of displaying the test coverage parameters further includes: displaying the coverage type corresponding to the executed code execution branch.

[0058] In this embodiment, the coverage types include but are not limited to: incremental type and full coverage type. By displaying the coverage type corresponding to the executed code execution, the type of the tested branch can be intuitively displayed, and the display content is more comprehensive.

[0059] Through the above steps, when generating a test task, executing the test task, and responding to the output instruction, the test coverage parameters are displayed, wherein the code execution identifier is used to identify the compiled code of the tested line, and the test coverage parameter is the ratio of the compiled code that has been tested to the total code of the compiled file. In this embodiment, after the project to be tested is involved in the test, the associated test task is created, and then by accessing the front-end website for splicing (binding relationship), and displaying the test coverage parameters and the code execution identifier (including the tested code line and branch code), the statistically uncovered code is presented, and the front-end code coverage rate is automatically reported and counted, thereby improving the overall quality of the project, ensuring the stability of the system, reducing the online missed test rate, and solving the problem that the front-end code testing process cannot be evaluated in the related technology and the statistical efficiency is low.

[0060] In this embodiment, after displaying the test coverage parameters in response to the output instruction, the display method also includes: determining the coverage index during the code execution process based on the executed test tasks; based on the coverage index, analyzing whether the executed test tasks have completed all tests on the test items; if the executed test tasks have not completed all tests on the test items, adjusting the test cases corresponding to the test tasks based on the coverage index; if the executed test tasks have completed all tests on the test items, generating a test report.

[0061] In this embodiment, when generating a test report, a termination instruction can be received and responded to, the test is suspended, and the coverage report is displayed, that is, the tester can click the termination virtual button by himself to view the coverage status.

[0062] Coverage indicators refer to the pre-set indicator standards that meet the requirements document, including but not limited to: first screen performance display, receiving touch operation page display, etc. Through coverage indicators, the test standards and test pass requirements can be determined. This coverage indicator can be used as a project process checkpoint, referring to the front-end code coverage indicator, adding a statistical method for the online standard to the self-test requirements of the product development, and improving the test process.

[0063] Through the coverage index, we can check and fill in the gaps in the use cases (write normal functions, test them through text, and check whether the test files themselves are covered), and finally complete the functional logic coverage. When the front-end code coverage reaches the standard index, it can be put online. It serves as a test exit point (standard parameter threshold) in the project process to improve system stability and reduce the online missed test rate.

[0064] The present invention is described below in conjunction with another optional embodiment.

[0065] Figure 4 is a device block diagram of an optional device for displaying front-end test information according to an exemplary embodiment. Figure 4 The device includes: a generating unit 401, a counting unit 402, and a display unit 403.

[0066] The generating unit 401 is configured to generate a test task, wherein the test task tests the compilation code in the compilation file of the front end of the target to be tested by accessing the link address of the front end of the target to be tested.

[0067] The statistical unit 402 is configured to execute the test task and count the code execution identifier and test coverage parameter generated in the test task, wherein the code execution identifier is used to identify the compilation code of the tested line, and the test coverage parameter is the ratio of the tested compilation code to the total code of the compilation file.

[0068] The display unit 403 is used to display the test coverage parameters in response to the output instruction.

[0069] The above-mentioned display device of front-end test information generates a test task in the generating unit 401, and the test task tests the compilation code in the compilation file of the front-end of the target to be tested by accessing the link address of the front-end of the target to be tested, executes the test task through the statistical unit 402, and counts the code execution identification and test coverage parameters generated in the test task, wherein the code execution identification is used to identify the compilation code of the tested line, and the test coverage parameter is the ratio of the compiled code that has been tested to the total code of the compilation file, and displays the test coverage parameter in response to the output instruction by displaying 403. In this embodiment, after the project to be tested is involved in the test, the creation of the associated test task is performed, and then the splicing (binding relationship) is performed by accessing the front-end website, and the test coverage parameters and code execution identification (including the tested code line and branch code) are displayed, and the uncovered code that is counted is presented, so as to realize the automatic reporting and statistics of the front-end code coverage rate, improve the overall quality of the project, ensure the stability of the system, reduce the online missed test rate, and solve the problem that the front-end code testing process cannot be evaluated in the related technology and the statistical efficiency is low.

[0070] Optionally, the generation unit includes: a first determination module, configured to determine the task type of the test task based on the project information of the test project after receiving the test project; a first creation module, configured to create a task name of the test task based on the task type; and a second determination module, configured to determine the code execution branch and code repository of the test task based on the project information of the test project.

[0071] Optionally, the display unit includes: a first display module configured to display the coverage type corresponding to the executed code execution branch.

[0072] Optionally, the display device of front-end test information also includes: a third determination module, configured to determine the coverage index in the code execution process based on the executed test task after displaying the test coverage parameters in response to the output instruction; a first analysis module, configured to analyze whether the executed test task has completed all tests on the test item based on the coverage index; a first adjustment module, configured to adjust the test case corresponding to the test task based on the coverage index when the executed test task has not completed all tests on the test item; and a first generation module, configured to generate a test report when the executed test task has completed all tests on the test item.

[0073] In order to ensure the smoothness of the test, test files are generally written during the testing process. The front-end code of the test project is tested through the test files. During the testing process, the test files need to be continuously updated to ensure that the test files mark the coverage of the test projects and that all code branches within the test projects can be tested. Therefore, it is necessary to count the project test coverage to determine whether the test files need to be modified in time.

[0074] In this embodiment, during the process of compiling the test file, the requirement document of the requirement phase is generally referred to, and based on the requirement document, the requirement coverage during the test process is determined to ensure that the compiled code file covers customer requirements.

[0075] Optionally, the display device of the front-end test information also includes: a fourth determination module, configured to determine the code lines of the executed compiled code and the code lines of the unexecuted compiled code after the code execution identifier is generated in the statistical test task; a first identification module, configured to identify the code lines of the executed compiled code through a first identification condition and display the code execution identifier; and a second identification module, configured to identify the code lines of the unexecuted compiled code through a second identification condition and display the code non-execution identifier.

[0076] The first identification condition and the second identification condition in this embodiment can be set in advance by the test platform. For example, they can be identified by color, with the first identification condition set to green and the second identification condition set to black. The colors can be used to cover the tested codes and untested codes to intuitively display the code testing progress.

[0077] Optionally, the display unit also includes: a first statistical module, configured to count the code lines of the compiled code executed under each code execution branch; a first calculation module, configured to calculate the ratio of the code lines of the compiled code executed under the code execution branch to all the code lines under the code execution branch to obtain the code execution coverage; and a display module, configured to display the code execution coverage corresponding to each code execution branch in response to a coverage output instruction.

[0078] By counting the code execution coverage, you can dynamically view the coverage of each file and code line during the test process, which is convenient for QA to check for omissions and reduce the online missed test rate. The code execution coverage can be a percentage, and the coverage parameters can intuitively display the tested code.

[0079] The front-end code execution coverage is reported in real time, and the seriousness of the test requirements and the coverage of the use case execution can be directly quantified and counted.

[0080] Optionally, the display unit further includes: a receiving module configured to receive code change information input by an external module during the execution of the test task; and display the code change range in response to an output instruction to display the code change.

[0081] By displaying the scope of code changes, developers can be shown that their compiled code files are incomplete or have defects. Therefore, the compiled code files need to be updated and modified to improve the demand coverage of the compiled code files and improve user satisfaction.

[0082] According to another aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method for displaying front-end test information as described above.

[0083] The types of electronic devices in this application may include terminals or servers.

[0084] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, and when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform a method for displaying front-end test information as described in any one of the above. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0085] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the above-mentioned method for displaying front-end test information is implemented.

[0086] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0087] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for displaying front-end test information, characterized in that: include: Pre-install a coverage statistics plug-in in the compiled code in the compilation file, generate a test task through the coverage statistics plug-in, and test the compiled code in the compilation file of the front end of the target to be tested by accessing the link address of the front end of the target to be tested; Execute the test task, and count the code execution identifier and test coverage parameter generated in the test task, wherein the code execution identifier is used to identify the compiled code of the tested line, and the test coverage parameter is the ratio of the tested compiled code to the total code of the compiled file; In response to the output instruction, displaying the test coverage parameter; After displaying the test coverage parameters in response to the output instruction, the display method further includes: determining the coverage index in the code execution process based on the executed test tasks, wherein the coverage index refers to the index standard that is preset to meet the requirement document, including: first screen performance display, receiving touch operation page display; based on the coverage index, analyzing whether the executed test tasks have completed all tests on the test items; if the executed test tasks have not completed all tests on the test items, adjusting the test cases corresponding to the test tasks based on the coverage index; if the executed test tasks have completed all tests on the test items, generating a test report; When the test report is generated, the test is paused in response to the received termination instruction, and the coverage report is displayed.

2. The display method according to claim 1, characterized in that: The generating test task includes: After receiving the test project, determining a task type of the test task based on the project information of the test project; Based on the task type, create a task name for the test task; Based on the project information of the test project, a code execution branch and a code repository of the test task are determined.

3. The display method according to claim 2, characterized in that: The step of displaying the test coverage parameter in response to the output instruction includes: Displays the coverage type corresponding to the executed code execution branch.

4. The display method according to claim 1, characterized in that: After counting the code execution identifiers generated in the test task, the method further includes: determining lines of compiled code that were executed and lines of compiled code that were not executed; Marking the code lines of the executed compiled code according to the first marking condition, and displaying the code execution mark; The code lines of the unexecuted compiled code are marked by the second marking condition, and a code unexecuted mark is displayed.

5. The display method according to claim 1, characterized in that: The displaying of the test coverage parameter in response to the output instruction further comprises: Count the number of compiled code lines executed under each code execution branch; Calculating the ratio of the code lines of the compiled code executed under the code execution branch to all the code lines under the code execution branch to obtain the code execution coverage; In response to the coverage output instruction, the code execution coverage corresponding to each of the code execution branches is displayed.

6. The display method according to claim 1, characterized in that: The displaying of the test coverage parameter in response to the output instruction further comprises: If code change information is received from an external module during the execution of the test task, the code change scope is displayed in response to an output instruction to display the code change.

7. A display device for front-end test information, characterized in that: include: The generating unit is configured to install a coverage statistics plug-in in the compiled code in the compilation file in advance, and generate a test task through the coverage statistics plug-in, wherein the test task tests the compiled code in the compilation file of the front end of the target to be tested by accessing the link address of the front end of the target to be tested; A statistical unit is configured to execute the test task and count the code execution identifier and test coverage parameter generated in the test task, wherein the code execution identifier is used to identify the compilation code of the tested line, and the test coverage parameter is the ratio of the statistically tested compilation code to the total code of the compilation file; A display unit, configured to display the test coverage parameter in response to an output instruction; Also includes: A third determination module is configured to determine, after displaying the test coverage parameters in response to the output instruction, coverage indicators in the code execution process based on the executed test tasks, wherein the coverage indicators refer to pre-set indicator standards that meet the requirements document, including: first screen performance display, receiving touch operation page display; A first analysis module is configured to analyze whether the executed test task has completed all tests on the test items based on the coverage index; A first adjustment module is configured to adjust the test case corresponding to the test task based on the coverage index when the executed test task has not completed all tests on the test item; The first generating module is configured to generate a test report when the executed test task completes all tests on the test items; wherein, when generating the test report, in response to a received termination instruction, the test is paused and a coverage report is displayed.

8. The display device according to claim 7, characterized in that: The generating unit comprises: A first determination module is configured to determine a task type of the test task based on the project information of the test project after receiving the test project; A first creation module is configured to create a task name for the test task based on the task type; The second determination module is configured to determine the code execution branch and the code repository of the test task based on the project information of the test project.

9. The display device according to claim 8, characterized in that: The display unit comprises: The first display module is configured to display the coverage type corresponding to the executed code execution branch.

10. The display device according to claim 7, characterized in that: Also includes: a fourth determination module, configured to determine, after counting the code execution identifiers generated in the test task, code lines of the compiled code that have been executed and code lines of the compiled code that have not been executed; A first identification module is configured to identify the code lines of the executed compiled code according to the first identification condition and display the code execution identification; The second identification module is configured to identify the code lines of the unexecuted compiled code according to the second identification condition and display the code unexecuted mark.

11. The display device according to claim 7, characterized in that: The display unit also includes: A first statistics module is configured to count the code lines of the compiled code executed in each code execution branch; A first calculation module is configured to calculate a ratio of code lines of compiled code executed under a code execution branch to all code lines under the code execution branch to obtain a code execution coverage rate; The display module is configured to display the code execution coverage corresponding to each of the code execution branches in response to the coverage output instruction.

12. The display device according to claim 7, characterized in that: The display unit also includes: The receiving module is configured to receive code change information input by an external module during the execution of a test task; and display the code change range in response to an output instruction to display the code change.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for displaying front-end test information as described in any one of claims 1 to 6.

14. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for displaying front-end test information as claimed in any one of claims 1 to 6.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for displaying front-end test information according to any one of claims 1 to 6 is implemented.