CN113986749A - Display method and display device of front-end test information and electronic equipment - Google Patents

Display method and display device of front-end test information and electronic equipment Download PDF

Info

Publication number
CN113986749A
CN113986749A CN202111316492.1A CN202111316492A CN113986749A CN 113986749 A CN113986749 A CN 113986749A CN 202111316492 A CN202111316492 A CN 202111316492A CN 113986749 A CN113986749 A CN 113986749A
Authority
CN
China
Prior art keywords
test
code
coverage
task
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111316492.1A
Other languages
Chinese (zh)
Inventor
祖静
贾淑静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111316492.1A priority Critical patent/CN113986749A/en
Publication of CN113986749A publication Critical patent/CN113986749A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The disclosure relates to a display method and a display device of front-end test information and electronic equipment, wherein the display method comprises the following steps: generating a test task, wherein the test task tests a compiling code in a compiling file of the front end of the target to be tested by accessing a link address of the front end of the target to be tested; executing the test task, and counting a code execution identifier and a test coverage parameter generated in the test task, wherein the code execution identifier is used for identifying the compiled code of the tested line, and the test coverage parameter is the ratio of the counted tested compiled code to the total code of the compiled file; in response to the output instruction, the test coverage parameters are presented. By realizing automatic reporting and counting of the coverage rate of the front-end codes, the overall quality of test items is improved, the stability of a system is ensured, and the online missing test rate is reduced.

Description

Display method and display device of front-end test information and electronic equipment
Technical Field
The present disclosure relates to the field of application testing technologies, and in particular, to a method and an apparatus for displaying front-end test information, and an electronic device.
Background
In the related art, when performing application code testing, there are three common ways: 1. the industry has a code coverage rate statistical tool of a back-end server, such as jacoco, 2, which counts the coverage rate through an interface in a project flow; 3. coverage statistics is carried out manually; however, these three approaches have significant disadvantages: for the first, only for the back-end server, there is no coverage rate evaluation mode for the front-end function; for the second type, there is no front-end project coverage statistics tool node at present; for the third, manual execution of coverage is not only inefficient, but also lacks a good means of evaluation. Meanwhile, in the current code testing mode, the step of counting the front-end function coverage rate is not added into the whole project flow.
Disclosure of Invention
The disclosure provides a display method and a display device for front-end test information and electronic equipment, which are used for at least solving the problems that the code test process of a front end cannot be evaluated and the statistical efficiency is low in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for displaying front-end test information is provided, including: generating a test task, wherein the test task tests a compiling code in a compiling file of the front end of the target to be tested by accessing a link address of the front end of the target to be tested; executing the test task, and counting a code execution identifier and a test coverage parameter generated in the test task, wherein the code execution identifier is used for identifying a compiled code of a tested line, and the test coverage parameter is the ratio of the counted tested compiled code to the total code of the compilation file; and responding to an output instruction, and displaying the test coverage parameters.
According to a second aspect of the embodiments of the present disclosure, there is provided a device for displaying front-end test information, including: the generating unit is used for generating a test task, and the test task tests the compilation code in the compilation file of the target front end to be tested by accessing the link address of the target front end to be tested; the statistical unit is used for executing the test task and counting a code execution identifier and a test coverage parameter generated in the test task, wherein the code execution identifier is used for identifying the compilation code of a tested row, and the test coverage parameter is the ratio of the statistical tested compilation code to the total code of the compilation file; and the display unit is used for responding to the output instruction and displaying the test coverage parameters.
According to another aspect of the embodiments of the present disclosure, there is provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method for presenting front-end test information as described above.
According to another aspect of the embodiments of the present disclosure, there is also provided a computer-readable storage medium, wherein when the 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 presenting front-end test information according to any one of the above items.
According to another aspect of the embodiments of the present disclosure, there is also provided a computer program product, which includes computer programs/instructions, and is characterized in that when the computer programs/instructions are executed by a processor, the method for displaying front-end test information is implemented.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
after the test task is generated, the test task is executed, code execution identification and test coverage parameters generated in the test task are counted, wherein the code execution identification is used for identifying the compilation code of the tested row, the test coverage parameters are the ratio of the counted compilation code which is tested to the total code of the compilation file, and the test coverage parameters are displayed in response to the output instruction. The method comprises the steps of counting code coverage parameters and coverage rate by installing a code test plug-in of a front end, establishing a related task on a front end coverage rate counting platform (namely establishing a test task on the counting platform, wherein the test task is related to a test code branch given by a development end), splicing (binding relation) at an access front end network address to report a covered code line and a covered branch code, flatly presenting the counted uncovered code, reporting the code updating coverage rate in real time, thereby solving the problems that the statistical means of the front end code coverage rate in a required project is lacked, the front end is lacked in a project flow to register a stuck point, the development and PM self-test project is lacked with an evaluation online standard and the like, realizing automatic reporting and counting of the front end code coverage rate, improving the overall quality of the project, ensuring the stability of a system and reducing the online leakage rate.
In this embodiment, the coverage parameters and the coverage rate may be counted, and then the code execution identifier and the test coverage parameters generated in the test task are displayed and counted based on an output instruction of the user (for example, a virtual button is touched to indicate a display coverage rate, a code execution range, and the like).
In the application, a test passing standard is formulated for the front-end coverage rate data and is used as a project output card point, and meanwhile, the branched code file and the line number are changed for visual display, so that the code change range is clearly and clearly displayed; in the testing process, the coverage rate condition of each file and code line can be dynamically checked, so that QA can conveniently check the leakage and the defect, and the online leakage detection rate is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a schematic diagram illustrating an implementation environment of a method for presenting front-end test information according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating an alternative method for presenting front-end test information in accordance with an exemplary embodiment.
FIG. 3 is a schematic diagram illustrating an alternative front-end test flow system in accordance with an exemplary embodiment.
Fig. 4 is an apparatus block diagram illustrating an alternative apparatus for presenting front-end test information in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The method can be applied to a code testing platform/a code testing and counting platform/a front-end counting platform, mainly carries out testing and counting on a programming code text of a front-end application program, and after a plug-in is installed on a front-end code, a testing main body carries out establishment of an association task on the front-end coverage counting platform after a project intervention test (namely, a testing task is established on the counting platform and is associated with a testing code branch given by a development end), and then, through splicing (binding relation) to report a covered row and a branch code on accessing a front-end domain name, the counted uncovered code is presented in a platformization mode, and the code updating coverage rate is reported in real time approximately (the code updating coverage rate is changed every 10 s).
After receiving the test items (the code file compiled by the developer according to the development requirement, and the code test items of the front end indicated in the code file), a code test platform/a front end statistical platform/a coverage statistical plug-in can be introduced into the front end development in advance to realize the front end code coverage statistics.
In the application, the front-end code coverage rate index is used as a project process stuck point, a statistical means of an online standard is added for developing the self-test requirement of a product, and the process is perfect and standardized. Meanwhile, the code granularity uncovered by the item is found through the front-end coverage rate data statistics, so that the use case is supplemented, and the online missing rate is reduced.
According to the application, the uncovered codes can be visually displayed through a visual platform interface, so that testers can more clearly know the test completion degree, and whether the evaluation standard and the evaluation range are reasonable or not is determined.
The present application is described in detail below with reference to various embodiments thereof.
Fig. 1 is a schematic diagram illustrating an implementation environment of a method for presenting front-end test information according to an exemplary embodiment. Referring to fig. 1, the implementation environment:
including an electronic terminal 101 and a server 102.
The electronic terminal 101 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, or other electronic devices with a display function. The electronic terminal 101 has a function of rendering a front-end page corresponding to any view application/view tool (for example, displaying code coverage counted by code statistical evaluation, test cases, tested code branches, visually displaying tested code files, and displaying 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 a front-end page corresponding to any application/tool by running the browser front end.
It should be noted that the electronic terminal 101 generally refers to one of a plurality of terminals, and the electronic terminal 101 is only exemplified in the embodiment. Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer. For example, the number of the terminals may be only a few, or the number of the terminals may be several tens or hundreds, or more, and the number of the terminals and the type of the device are not limited in the embodiments of the present disclosure.
The server 102 may be a server, a plurality of servers, a cloud server, a cloud computing platform, or a virtualization center. In some embodiments, the server 102 is a background server for any application or any number of applications, the server 102 stores resources for rendering pages belonging to the any application or the number of applications, and the server 102 provides background services for page rendering of the any application or the number of applications based on the stored resources.
The electronic terminal 101 communicates with the server 102 through a wireless network or a wired network. The electronic terminal 101 runs the browser front end, responds to the page rendering instruction, and the website corresponding to the page rendering instruction belongs to the application corresponding to the server 102, obtains the resource for rendering the page corresponding to the website by communicating with the server 102, and renders the page corresponding to the website based on the obtained resource. It should be noted that the server 102 generally refers to one of a plurality of servers, where each server is a background server for different applications, and the electronic terminal 101 renders pages of different applications by communicating with the background servers of different applications.
It should be noted here that, in some embodiments, the electronic terminal 101 (or mobile device) shown in fig. 1 described above has a touch display (also referred to as a "touch screen" or "touch display screen"). In some embodiments, the electronic terminal 101 (or mobile device) shown in fig. 1 above has a Graphical User Interface (GUI) with which a user can interact with a human machine by touching finger contacts and/or gestures on the surface of the display screen, where the human machine interaction function optionally includes the following interactions: clicking virtual buttons, word processing, making electronic reports, sending and receiving e-mail, call interfacing, web browsing, etc., executable instructions for performing the above-described human-computer interaction functions are configured/stored in one or more processor-executable computer program products or readable storage media.
In this embodiment, the coverage parameters and the coverage rate may be counted, and then the code execution identifier and the test coverage parameters generated in the test task are displayed and counted based on an output instruction of the user (for example, a virtual button is touched to indicate a display coverage rate, a code execution range, and the like).
Fig. 2 is a flowchart illustrating an alternative method for presenting front-end test information according to an exemplary embodiment, where, as shown in fig. 2, the method includes the following steps:
in step S201, a test task is generated, and the test task tests the compilation code in the compilation file of the target front end to be tested by accessing the link address of the target front end to be tested.
Optionally, generating a test task includes: after receiving the test items, determining the task types of the test tasks based on the item information of the test items; based on the task type, creating a task name of the test task; and determining a code execution branch and a code warehouse of the test task based on the project information of the test project.
The test item may refer to an item for testing a programming file/code file provided by a development end, the programming file being generated based on a desired product. Types of programming files include, but are not limited to: patch files, version update files. The programming file/code file can be tested whether omission, deviation, BUG and the like exist through testing items, in the testing process, data and application running data corresponding to the programming file are usually placed on a rear-end server, but the effect display and the interaction result with a user are displayed on the front end, so that the programming code on the front end needs to be tested during testing, the tested code coverage rate, the tested code branches and the tested code lines need to be counted, and the test result and the coverage rate counting result are displayed in real time.
In this embodiment, a coverage statistics plug-in may be installed in a compiled code (mainly a front-end code) in a compiled file in advance, so that after a project intervention test, an associated test task may be created by the plug-in.
In this embodiment, the item information may include, but is not limited to: project name, project number, project requirement document, project developer, project type, and project compiling code file. The task name may be a literal, character, number, or combination name.
The code execution branch in this embodiment refers to Branches in compiled code, and generally records a source branch name and a target branch name, for example, a performance recording branch, a sliding position recording branch, and the like. And the code warehouse refers to a code library called by documentation or a base warehouse for developing products.
During displaying, a code file for changing branches and a detail page for visually displaying line numbers (the displayed test detail page includes files which are changed and visually covers tested codes, branches and reports) need to be specifically displayed.
Optionally, when creating a test task associated with a test project, the present embodiment may be created on a pre-constructed front-end coverage statistical platform. After the test task is established, the relation between the test task and the front end can be bound by accessing the website/domain name of the front end, the code lines and branch codes covered in the test process are reported in real time, and the counted uncovered codes are presented in a platform mode.
FIG. 3 is a schematic diagram illustrating an alternative front-end test flow system according to an exemplary embodiment, as shown in FIG. 3, including four stages: the method comprises a demand phase, a development phase, a test and an online phase, wherein the demand phase is to receive user development requirements (including bug repair, new function development and the like), in the development phase, developers compile code files based on the development requirements, meanwhile, a coverage rate statistical plug-in can be introduced in the phase, in the test, front-end code test coverage rate statistics can be carried out, and in the online phase, the test is passed, the test standard is met, and online operation is achieved.
For the middle stage of testing, a coverage rate statistical platform can be linked through a coverage rate statistical plug-in introduced in a compilation file, the front end of testing is determined, then a testing task (mainly comprising a task name, a code branch, a code warehouse and a coverage diff type) is created, a task identifier (namely a task coverID) is generated, then the testing task enters the coverage rate statistical platform of the testing code, and the front end coverage rate is obtained through statistics. And establishing a related task on a front-end coverage rate statistical platform, and then reporting covered row and branch codes by splicing (binding relationship) on an access front-end domain name (on-band task identifier), so as to present the counted uncovered codes in a platform manner.
In step S203, a test task is executed, and a code execution identifier and a test coverage parameter generated in the test task are counted, wherein the code execution identifier is used to identify the compilation code of the tested row, and the test coverage parameter is a ratio of the counted compilation code that has been tested to the total code of the compilation file.
Optionally in this embodiment, after counting the code execution identifier generated in the test task, the method further includes: determining a code line of the executed compiled code and a code line of the unexecuted compiled code; carrying out identification processing on a code line of the executed compiled code through a first identification condition, and displaying a code execution identification; and identifying the code line of the unexecuted compiled code through a second identification condition, and displaying the unexecuted code identification of the code.
The first identification condition and the second identification condition in this embodiment may be set in advance by the test platform, for example, identification is performed by color, the first identification condition is set to be green, the second identification condition is set to be black, tested code printing and untested code are covered by color, and the code test progress is visually displayed.
In step S205, in response to the output instruction, the test coverage parameter is presented.
An optional step of presenting the test coverage parameter in response to the output command, further comprising: counting code lines of the compiled codes executed under each code execution branch; calculating the ratio of the code lines of the compiled codes executed under the code execution branch to all the code lines under the code execution branch to obtain the code execution coverage rate; code execution coverage corresponding to each code execution branch is displayed in response to a coverage output instruction.
By counting the code execution coverage rate, the coverage rate condition of each file and code line can be dynamically checked in the test process, the QA can conveniently check the missing and the gap, and the online missing detection rate is reduced. The code execution coverage rate can be a percentage system, and the tested code can be visually displayed through a coverage rate parameter.
And reporting the execution coverage rate of the front-end code in real time, and meanwhile, directly quantifying and counting the requirement input fidelity of the responsible test and the coverage rate of case execution.
Another optional step of presenting the test coverage parameter in response to the output instruction further includes: and counting the coverage rate of the test items passing the code test, and determining whether the test files are complete and need to be modified or not by comparing the test coverage rates of the items.
In the testing process, in order to ensure the smoothness of the test, the test file can be written in advance, the front-end code test is carried out on the test item through the test file, the test file needs to be updated continuously in the testing process, the marking of the test file on the coverage rate of the test item is ensured, and the test completion of all code branches in the test item can be ensured, so the test coverage rate of the item needs to be counted to determine whether the test file needs to be modified in time.
In the embodiment, in the process of compiling the test file, the requirement document in the requirement stage can be referred to, the requirement coverage in the test process is determined based on the requirement document, and the compiled code file can be ensured to cover the requirement of a customer.
In this embodiment, the step of presenting the test coverage parameter in response to the output instruction further includes: if the code change information input by the external module is received in the process of executing the test task; and responding to the output instruction for showing the code change, and showing the code change range.
By displaying the code change range, the incomplete or defect code files compiled by the method can be displayed to developers, so that the compiled code files need to be updated and changed, the requirement coverage of the compiled code files is improved, and the use satisfaction of users is improved.
Another optional step of presenting the test coverage parameter in response to the output instruction further includes: and showing the coverage type corresponding to the executed code execution branch.
In this embodiment, the coverage types include, but are not limited to: an incremental type, a full coverage type. By displaying the coverage type corresponding to the executed code execution, the type of the tested branch can be visually displayed, and the display content is more comprehensive.
Through the steps, the test task is generated, the test task is executed, and the test coverage parameter is displayed in response to the output instruction, wherein the code execution identifier is used for identifying 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 the embodiment, after the item to be tested is subjected to the intervention test, the associated test task is created, then the front-end network address is accessed for splicing (binding relationship), test coverage parameters and code execution identifiers (including a test code line and a test branch code) are displayed, the counted uncovered codes are presented, the automatic reporting and counting of the front-end code coverage rate are realized, the overall quality of the item is improved, the system stability is ensured, the online missing test rate is reduced, and the problems that the front-end code test process cannot be evaluated and the counting efficiency is low in the related technology are solved.
In this embodiment, after the test coverage parameter is displayed in response to the output instruction, the display method further includes: determining a coverage index in the code execution process based on the executed test task; analyzing whether the executed test task completes all tests on the test project or not based on the coverage index; if the executed test task does not complete all tests on the test items, adjusting the test case corresponding to the test task based on the coverage index; and if the executed test tasks complete all tests on the test items, generating a test report.
In this embodiment, when the test report is generated, the termination instruction may be received, the termination instruction may be responded, the test may be suspended, and the coverage report may be displayed, that is, the tester may click the termination virtual button by itself to check the coverage status.
The coverage index refers to preset index standards meeting the requirement documents, and includes but is not limited to: the method comprises the steps of first screen performance display, receiving touch operation page display and the like. By covering the index, the standard of the test and the requirement of qualified test can be determined. The coverage index can be used as a project flow stuck point and refers to a front-end code coverage index, a statistical means of an online standard is added for developing the self-test requirement of a product, and a test flow is perfected.
And (4) checking and repairing the defects of the use cases (normal writing functions, testing through characters and checking whether the test files cover) through the coverage rate index, and finally finishing functional logic coverage, wherein the front-end code coverage rate can be on line when reaching the standard index. The method is used as a test quasi-sticking point (standard parameter threshold) in a project flow, so that the system stability is improved, and the online missing detection rate is reduced.
The invention is described below in connection with an alternative embodiment.
Fig. 4 is an apparatus block diagram illustrating an alternative apparatus for presenting front-end test information in accordance with an exemplary embodiment. Referring to fig. 4, the apparatus includes: a generating unit 401, a counting unit 402 and a display unit 403.
The generating unit 401 is configured to generate a test task, where the test task tests the compilation code in the compilation file of the target front end to be tested by accessing the link address of the target front end to be tested.
The statistical unit 402 is configured to execute the test task, and count a code execution identifier and a test coverage parameter generated in the test task, where the code execution identifier is used to identify an encoding code of a tested row, and the test coverage parameter is a ratio of the statistical tested encoding code to a total code of the encoding file.
The presentation unit 403 is configured to present the test coverage parameter in response to an output instruction.
The device for displaying the front-end test information generates the test task in the generating unit 401, 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 counting unit 402, and counts the code execution identifier and the test coverage parameter generated in the test task, wherein the code execution identifier is used for identifying the compilation code of the tested row, the test coverage parameter is used for counting the ratio of the tested compilation code to the total code of the compilation file, and responds to the output instruction through the displaying unit 403 to display the test coverage parameter. In the embodiment, after the item to be tested is subjected to the intervention test, the associated test task is created, then the front-end network address is accessed for splicing (binding relationship), test coverage parameters and code execution identifiers (including a test code line and a test branch code) are displayed, the counted uncovered codes are presented, the automatic reporting and counting of the front-end code coverage rate are realized, the overall quality of the item is improved, the system stability is ensured, the online missing test rate is reduced, and the problems that the front-end code test process cannot be evaluated and the counting efficiency is low in the related technology are solved.
Optionally, the generating unit includes: the first determination module is configured to determine the task type of the test task based on the project information of the test project after the test project is received; the first creating module is configured to create a task name of the testing task based on the task type; a second determination module configured to determine a code execution branch and a code repository of the test task based on the project information of the test project.
Optionally, the display unit includes: the first showing module is configured to show the coverage type corresponding to the executed code execution branch.
Optionally, the apparatus for displaying the front-end test information further includes: the third determination module is configured to determine a coverage index in the code execution process based on the executed test task after the test coverage parameters are displayed 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; the first adjusting module is configured to adjust the test cases corresponding to the test tasks based on the coverage indexes under the condition that the executed test tasks do not complete all tests on the test items; the first generation module is configured to generate a test report when the executed test task completes all tests on the test item.
In the testing process, in order to ensure the smoothness of the test, a test file is generally written, a front-end code test is performed on a test item through the test file, the test file needs to be continuously updated in the testing process, the marking of the test file on the coverage rate of the test item is ensured, and all code branches in the test item can be ensured to be tested, so that the test coverage rate of the item needs to be counted to determine whether the test file needs to be modified in time.
In this embodiment, in the process of compiling the test file, the requirement document in the requirement stage is generally referred to, and the requirement coverage in the test process is determined based on the requirement document, so that the compiled code file can be ensured to cover the customer requirements.
Optionally, the apparatus for displaying the front-end test information further includes: a fourth determination module configured to determine a code line of the compiled code that has been executed and a code line of the compiled code that has not been executed after counting the code execution identification generated in the test task; the first identification module is configured to identify and process a code line of the executed compiled code through a first identification condition and display a code execution identifier; and the second identification module is configured to identify and process the code line of the unexecuted compiled code through a second identification condition and show the code unexecuted identification.
The first identification condition and the second identification condition in this embodiment may be set in advance by the test platform, for example, identification is performed by color, the first identification condition is set to be green, the second identification condition is set to be black, tested code printing and untested code are covered by color, and the code test progress is visually displayed.
Optionally, the display unit further comprises: a first statistical module configured to count code lines of the compiled code that have been executed under each code execution branch; the first calculation module is configured to calculate the ratio of the code lines of the compiled codes executed under the code execution branch to all the code lines under the code execution branch to obtain the code execution coverage rate; a display module configured to display a code execution coverage corresponding to each code execution branch in response to a coverage output instruction.
By counting the code execution coverage rate, the coverage rate condition of each file and code line can be dynamically checked in the test process, the QA can conveniently check the missing and the gap, and the online missing detection rate is reduced. The code execution coverage rate can be a percentage system, and the tested code can be visually displayed through a coverage rate parameter.
And reporting the execution coverage rate of the front-end code in real time, and meanwhile, directly quantifying and counting the requirement input fidelity of the responsible test and the coverage rate of case execution.
Optionally, the display unit further comprises: the receiving module is configured to receive code change information input by the external module in the process of executing the test task; and responding to the output instruction for showing the code change, and showing the code change range.
By displaying the code change range, the incomplete or defect code files compiled by the method can be displayed to developers, so that the compiled code files need to be updated and changed, the requirement coverage of the compiled code files is improved, and the use satisfaction of users is improved.
According to another aspect of the embodiments of the present disclosure, there is provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method for presenting front-end test information as described above.
The type of the electronic device in the present application may include a terminal, and may also include a server.
In an exemplary embodiment, there is also provided a computer-readable storage medium comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method of presenting front-end test information as described in any one of the above. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is further provided, which includes a computer program/instruction, and when executed by a processor, implements the method for presenting front-end test information described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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 (10)

1. A method for displaying front-end test information is characterized by comprising the following steps:
generating a test task, wherein the test task tests a compiling code in a compiling file of the front end of the target to be tested by accessing a link address of the front end of the target to be tested;
executing the test task, and counting a code execution identifier and a test coverage parameter generated in the test task, wherein the code execution identifier is used for identifying a compiled code of a tested line, and the test coverage parameter is the ratio of the counted tested compiled code to the total code of the compilation file;
and responding to an output instruction, and displaying the test coverage parameters.
2. The presentation method of claim 1, wherein the generating a test task comprises:
after receiving a test project, determining a task type of a test task based on project information of the test project;
based on the task type, creating a task name of the test task;
and determining a code execution branch and a code warehouse of the test task based on the project information of the test project.
3. The method of claim 2, wherein said exposing the test coverage parameters in response to the output instruction comprises:
and showing the coverage type corresponding to the executed code execution branch.
4. The method of claim 2, wherein after presenting the test coverage parameters in response to an output instruction, the method of presenting further comprises:
determining a coverage index in the code execution process based on the executed test task;
analyzing whether the executed test task completes all tests on the test project or not based on the coverage index;
under the condition that the executed test task does not complete all tests on the test items, adjusting the test cases corresponding to the test tasks based on the coverage indexes;
and generating a test report under the condition that the executed test task completes all tests on the test item.
5. The demonstration method according to claim 1, wherein after counting the code execution identifications generated in the test task, the method further comprises:
determining a code line of the executed compiled code and a code line of the unexecuted compiled code;
carrying out identification processing on a code line of the executed compiled code through a first identification condition, and displaying a code execution identification;
and identifying the code line of the unexecuted compiled code through a second identification condition, and displaying the unexecuted code identification of the code.
6. The method of claim 1, wherein said exposing the test coverage parameters in response to an output instruction further comprises:
counting code lines of the compiled codes executed under each code execution branch;
calculating the ratio of the code lines of the compiled codes executed under the code execution branch to all the code lines under the code execution branch to obtain the code execution coverage rate;
in response to a coverage output instruction, code execution coverage corresponding to each of the code execution branches is displayed.
7. The utility model provides a display device of front end test information which characterized in that includes:
the generating unit is configured to generate a test task, and the test task tests the compilation code in the compilation file of the target front end to be tested by accessing the link address of the target front end to be tested;
the statistical unit is configured to execute the test task and count a code execution identifier and a test coverage parameter generated in the test task, wherein the code execution identifier is used for identifying an encoding code of a tested row, and the test coverage parameter is a ratio of the statistical tested encoding code to a total code of the encoding file;
and the display unit is used for responding to the output instruction and displaying the test coverage parameters.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of presenting front-end test information according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of presenting front-end test information of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program/instructions, when executed by a processor, implement the method of presentation of front-end test information according to any of claims 1 to 6.
CN202111316492.1A 2021-11-08 2021-11-08 Display method and display device of front-end test information and electronic equipment Pending CN113986749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111316492.1A CN113986749A (en) 2021-11-08 2021-11-08 Display method and display device of front-end test information and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111316492.1A CN113986749A (en) 2021-11-08 2021-11-08 Display method and display device of front-end test information and electronic equipment

Publications (1)

Publication Number Publication Date
CN113986749A true CN113986749A (en) 2022-01-28

Family

ID=79747203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111316492.1A Pending CN113986749A (en) 2021-11-08 2021-11-08 Display method and display device of front-end test information and electronic equipment

Country Status (1)

Country Link
CN (1) CN113986749A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567564A (en) * 2022-12-06 2023-01-03 东方空间(西安)宇航技术有限公司 Testing method, device, system and equipment of aerospace equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567564A (en) * 2022-12-06 2023-01-03 东方空间(西安)宇航技术有限公司 Testing method, device, system and equipment of aerospace equipment
CN115567564B (en) * 2022-12-06 2023-09-08 东方空间(西安)宇航技术有限公司 Method, device, system and equipment for testing aerospace equipment

Similar Documents

Publication Publication Date Title
US10698702B1 (en) Automating interactions with software user interface
CN110442511B (en) Visual embedded point testing method and device
CN108111364B (en) Service system testing method and device
CN103984626A (en) Method and device for generating test-case script
Holl et al. Mobile application quality assurance
Ma et al. Paladin: Automated generation of reproducible test cases for android apps
Soui et al. On the impact of aesthetic defects on the maintainability of mobile graphical user interfaces: An empirical study
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
CN113986749A (en) Display method and display device of front-end test information and electronic equipment
CN107038120A (en) A kind of method for testing software and equipment
CN110765007A (en) Crash information online analysis method for android application
Wang et al. An empirical study on bugs in JavaScript engines
CN113342692A (en) Test case automatic generation method and device, electronic equipment and storage medium
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN112506778A (en) WEB user interface automatic test method, device, equipment and storage medium
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
Aljawabrah et al. Automated recovery and visualization of test-to-code traceability (TCT) links: An evaluation
CN115048302A (en) Front-end compatibility testing method and device, storage medium and electronic equipment
CN108885574B (en) System for monitoring and reporting performance and correctness issues at design, compilation, and runtime
CN115480940A (en) Page calling method, device and medium for financial ratio indexes
CN115480970A (en) Performance test method, device, equipment and storage medium
CN113986753A (en) Interface test method, device, equipment and storage medium
CN113326193A (en) Applet testing method and device
CN112699014A (en) Method and device for testing and displaying storage performance prediction function
US8862945B2 (en) System and method for measuring the effect of interruptions on software application usability

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination