CN106155900B - Code test monitoring method, device and equipment - Google Patents

Code test monitoring method, device and equipment Download PDF

Info

Publication number
CN106155900B
CN106155900B CN201510185623.5A CN201510185623A CN106155900B CN 106155900 B CN106155900 B CN 106155900B CN 201510185623 A CN201510185623 A CN 201510185623A CN 106155900 B CN106155900 B CN 106155900B
Authority
CN
China
Prior art keywords
test
code
server
coverage rate
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.)
Active
Application number
CN201510185623.5A
Other languages
Chinese (zh)
Other versions
CN106155900A (en
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.)
Shenzhen Yayue Technology Co ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510185623.5A priority Critical patent/CN106155900B/en
Publication of CN106155900A publication Critical patent/CN106155900A/en
Application granted granted Critical
Publication of CN106155900B publication Critical patent/CN106155900B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a code test monitoring method, a device and equipment, wherein the method comprises the following steps: executing tested code to test, wherein the tested code comprises a probe inserted through a coverage rate instrumentation operation; obtaining an execution result of a probe included in the tested code when the probe is executed; generating a test result file according to the execution result of the probe, and sending the test result file to a server, wherein the server is used for determining the test coverage rate according to the test result file; when detecting the operation of requesting to quit the test, sending a test completion request to the server, receiving reply information of the server, and judging whether to remind the test to continue according to the indication in the reply information; and when the server judges that the test coverage rate is smaller than a preset coverage rate threshold value, indicating that the test is continued in the reply message. The invention can more accurately monitor the test condition of the code.

Description

Code test monitoring method, device and equipment
Technical Field
The invention relates to the technical field of computers, in particular to a code test monitoring method, a code test monitoring device and code test monitoring equipment.
Background
In the prior art, for developed code, the code may be tested by a user in a use environment. Since the machine used by the user, the network in which the user is located, and the operation habit of the user are all various situations, the method for performing the code test by the user is more valuable. In the testing process, the progress of the testing work of the user needs to be monitored.
A code test monitoring method is to detect the time length of the user using the tested code, and after the time length of the user using the tested code exceeds the preset time length, the code test is determined to be completed. The drawback of this method is that if only the code is started without the code test being performed, the use duration can still be made longer than a predetermined duration, and the user is considered to be finished with the test. However, in practice the user does not perform the test.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a method, an apparatus and a device for monitoring code testing, so as to monitor the testing condition of a code more accurately.
In order to achieve the purpose, the embodiment of the invention adopts the following technical scheme:
according to a first aspect of the embodiments of the present invention, there is provided a code test monitoring method, including the steps of:
executing tested code to test, wherein the tested code comprises a probe inserted through a coverage rate instrumentation operation;
obtaining an execution result of a probe included in the tested code when the probe is executed;
generating a test result file according to the execution result of the probe, and sending the test result file to a server, wherein the server is used for determining the test coverage rate according to the test result file;
when detecting the operation of requesting to quit the test, sending a test completion request to the server, receiving reply information of the server, and judging whether to remind the test to continue according to the indication in the reply information;
and when the server judges that the test coverage rate is smaller than a preset coverage rate threshold value, indicating that the test is continued in the reply message.
In an embodiment, when detecting that the operation requesting to quit the test is performed, after sending a test completion request to the server and receiving reply information of the server, the method further includes:
judging whether to allow the test to be completed according to the indication in the reply information;
when the server judges that the test coverage rate is not less than the preset coverage rate threshold value, the reply message indicates that the test is allowed to be completed.
In an embodiment, the generating a test result file according to the execution result of the probe, and sending the test result file to a server includes:
and using a timer, generating a test result file according to the execution result of the probe when the timing time is up, and sending the test result file to a server.
In an embodiment, the generating a test result file according to the execution result of the probe, and sending the test result file to a server includes:
and when the operation of requesting to quit the test is detected, generating a test result file according to the execution result of the probe, and sending the test result file to a server.
According to a second aspect of the embodiments of the present invention, there is provided a code test monitoring method for a server, including the steps of:
determining a test coverage rate according to a received test result file, wherein the test result file is a file generated according to an execution result after a probe inserted through a coverage rate instrumentation operation and included in a tested code is executed;
when a test completion request is received, judging whether the test coverage rate is smaller than a preset coverage rate threshold value;
and when the test coverage rate is smaller than the preset coverage rate threshold value, replying reply information comprising an instruction for continuing the test.
In an embodiment, the method further comprises: when the test coverage is not less than the preset coverage threshold, replying reply information comprising an indication that the test is allowed to be completed.
According to a third aspect of the embodiments of the present invention, there is provided a code test monitoring apparatus, including:
the execution module is used for executing tested code to test, and the tested code comprises a probe inserted through a coverage rate instrumentation operation;
an obtaining module, configured to obtain an execution result of a probe included in the tested code when the probe is executed;
the generating module is used for generating a test result file according to the execution result of the probe and sending the test result file to a server, and the server is used for determining the test coverage rate according to the test result file;
the reminding module is used for sending a test completion request to the server when detecting that the operation of requesting to quit the test is performed, receiving reply information of the server, and judging whether to remind the test to continue according to the indication in the reply information;
and when the server judges that the test coverage rate is smaller than a preset coverage rate threshold value, indicating that the test is continued in the reply message.
In one embodiment, the apparatus further comprises:
the permission module is used for sending a test completion request to the server when detecting the operation of requesting to quit the test, and judging whether to allow the test to be completed or not according to the indication in the reply information after receiving the reply information of the server;
when the server judges that the test coverage rate is not less than the preset coverage rate threshold value, the reply message indicates that the test is allowed to be completed.
In an embodiment, the generating module is configured to use a timer, generate a test result file according to an execution result of the probe when a timing time arrives, and send the test result file to a server.
In an embodiment, the generating module is configured to generate a test result file according to an execution result of the probe when an operation requesting to quit the test is detected, and send the test result file to a server.
According to a fourth aspect of the embodiments of the present invention, there is provided a code test monitoring apparatus for a server, including:
the determining module is used for determining the test coverage rate according to the received test result file, wherein the test result file is a file generated according to the execution result after the probe inserted through the coverage rate instrumentation operation and included in the tested code is executed;
the judging module is used for judging whether the testing coverage rate is smaller than a preset coverage rate threshold value or not when the testing completion request is received;
and the reply module is used for replying reply information comprising an instruction for continuing the test when the test coverage rate is less than the preset coverage rate threshold value.
In an embodiment, the reply module is further configured to reply a reply message including an indication that the test is allowed to be completed when the test coverage is not less than the preset coverage threshold.
According to a fifth aspect of embodiments of the present invention, there is provided an apparatus comprising the code test monitoring device of any of the embodiments of the third aspect.
According to a sixth aspect of embodiments of the present invention, there is provided an apparatus comprising the code test monitoring device of any of the fourth aspect.
The technology provided by the embodiment of the invention has the following beneficial effects:
according to the technical scheme provided by the embodiment of the invention, the tested code is executed for testing, and the tested code comprises a probe inserted through a coverage rate instrumentation operation; obtaining an execution result of a probe included in a tested code when the probe is executed; generating a test result file according to the execution result of the probe, and sending the test result file to a server, wherein the server is used for determining the test coverage rate according to the test result file; when detecting the operation of requesting to quit the test, sending a test completion request to the server, receiving reply information of the server, and judging whether to remind the test to continue according to the indication in the reply information; and when the server judges that the test coverage rate is smaller than the preset coverage rate threshold value, indicating that the test is continued in the reply message. Therefore, the test condition of the code is determined by using the probe, and the test condition of the code can be monitored more accurately; and a test result file is automatically generated according to the execution result of the probe, the test coverage rate is determined according to the test result, whether the test is continued or not is determined according to the test coverage rate, additional operation of a user is not needed, the test burden of the user is reduced, and the test is convenient for the user.
Additional features and advantages of embodiments of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solutions of the embodiments of the present invention are further described in detail with reference to the accompanying drawings and embodiments.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments of the invention, and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention. In the drawings:
FIG. 1 is a flow chart of a code test monitoring method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a code test monitoring method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a code test monitoring method according to an embodiment of the present invention;
FIG. 4 is a block diagram of a code testing and monitoring device according to an embodiment of the present invention;
FIG. 5 is a block diagram of a code test monitoring device according to another embodiment of the present invention;
fig. 6 is a structural diagram of a code testing and monitoring device according to an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, and it should be understood that the preferred embodiments described herein are merely illustrative and explanatory of the embodiments of the present invention, and are not restrictive of the embodiments of the invention.
Fig. 1 is a flowchart of a code test monitoring method according to an embodiment of the present invention. As shown in fig. 1, the method comprises the following steps S101-S104.
In step S101, the code under test is executed for testing.
Wherein, the tested code comprises a probe inserted by a coverage rate instrumentation operation.
For example, EMMA (Emma, Java code coverage statistics tool) and GCOV (C or C + + or object-C code coverage test tool) can both insert probes for instrumentation operations. For the developed code, the probe is inserted by using the above-mentioned tool, the code inserted into the probe by the coverage instrumentation operation is taken as the code to be tested, and the code to be tested is executed for testing.
In step S102, when a probe included in the code under test is executed, an execution result of the probe is obtained.
In step S103, a test result file is generated according to the execution result of the probe, and the test result file is sent to the server.
And the server is used for determining the test coverage rate according to the test result file.
For example, a generating module is developed, the generating module performs the operation in step S103, packages the generating module, for example, into an SDK (software development kit), adds the SDK to a code to be tested during packaging, and then compiles a code to be tested that can generate and send a test result file.
In an embodiment, the generating a test result file according to the execution result of the probe, and sending the test result file to the server may include: and using a timer, generating a test result file according to the execution result of the probe when the timing time is up, and sending the test result file to the server.
For example, the above operation is performed by a developed generation module, that is, a timer is used, and when the timing time arrives, a test result file is generated according to the execution result of the probe, and the test result file is sent to the server. And adding the generating module and the timer into the code to be tested, and further compiling the tested code which can be generated at fixed time and sent to the test result file.
In an embodiment, the generating a test result file according to the execution result of the probe, and sending the test result file to the server may include: and when the operation of requesting to quit the test is detected, generating a test result file according to the execution result of the probe, and sending the test result file to the server.
For example, the developed generating module executes the above operation, that is, when an operation requesting to quit the test is detected, a test result file is generated according to the execution result of the probe, and the test result file is sent to the server. And adding the generating module into the code to be tested, and compiling the tested code which can generate and send the test result file when detecting the operation of requesting to quit the test.
The method of the invention can also comprise: using a timer, when the timing time is up, generating a test result file according to the execution result of the probe, and sending the test result file to a server; and when detecting the operation of requesting to quit the test, generating a test result file according to the execution result of the probe, and sending the test result file to the server.
And after receiving the test result file, the server determines the test coverage rate according to the test result file and stores the test coverage rate.
In step S104, when detecting that the operation requesting to quit the test is performed, sending a test completion request to the server, receiving reply information of the server, and determining whether to prompt to continue the test according to an instruction in the reply information.
And when the server judges that the test coverage rate is smaller than the preset coverage rate threshold value, indicating that the test is continued in the reply message.
For example, when an operation requesting to quit the test is detected, a request for completing the test is sent to the server. And after judging that the test coverage rate is less than the preset coverage rate threshold value, the server sends reply information containing a continuous test instruction. And reminding the user of continuing the test according to the indication of continuing the test contained in the reply message.
In an embodiment, after the sending a test completion request to the server and receiving a reply message from the server when the operation requesting to quit the test is detected, the method may further include: and judging whether the test is allowed to be completed or not according to the indication in the reply message.
When the server judges that the test coverage rate is not less than the preset coverage rate threshold value, the reply message indicates that the test is allowed to be completed.
For example, when an operation requesting to quit the test is detected, a request for completing the test is sent to the server. And after judging that the test coverage rate is not less than the preset coverage rate threshold value, the server sends reply information containing an allowable test instruction. And allowing the test to be completed according to the indication that the reply message contains the test permission, and then quitting the test.
The technology provided by the embodiment of the invention has the following beneficial effects: the test condition of the code is determined by using the probe, so that the test condition of the code can be monitored more accurately; and a test result file is automatically generated according to the execution result of the probe, the test coverage rate is determined according to the test result, whether the test is continued or not is determined according to the test coverage rate, additional operation of a user is not needed, the test burden of the user is reduced, and the test is convenient for the user.
Example one
Fig. 2 is a flowchart of a code test monitoring method according to an embodiment of the present invention, where the method is used for a client performing a code test, and as shown in fig. 2, the method in the embodiment includes the following steps:
step S201, executing the tested code for testing.
Wherein, the tested code comprises a probe inserted by a coverage rate instrumentation operation.
The process of generating the code under test includes: inserting probes through a coverage instrumentation operation in codes to be tested, for example, using EMMA for java language codes in an android system and GCOV for C/C + +/Object-C language codes in IOS (apple operating system); adding a generating module and a timer into a code to be tested, for example, packing the generating module into an SDK, and adding the SDK into the code to be tested during packing; and compiling the code to be tested to generate the code to be tested.
Thus, code test monitoring can be achieved without changing source code.
In step S202, when the probe included in the tested code is executed, an execution result of the probe is obtained.
And step S203, using a timer, generating a test result file according to the execution result of the probe when the timing time is up, and sending the test result file to the server.
And the server is used for determining the test coverage rate according to the test result file and storing the test coverage rate.
And step S204, when the operation of requesting to quit the test is detected, generating a test result file according to the execution result of the probe, sending the test result file to the server, and sending a test completion request to the server.
For example, when the user clicks an exit key, an operation of requesting for exiting the test is detected, a test result file is generated according to an execution result of the probe, the test result file is sent to the server, and a test completion request is sent to the server. The server determines a test coverage rate according to the received test result file, compares the test coverage rate with a preset coverage rate threshold value, and replies reply information including an instruction for continuing the test when the test coverage rate is smaller than the preset coverage rate threshold value; when the test coverage is not less than the preset coverage threshold, replying reply information comprising an indication that the test is allowed to be completed.
Step S205, receiving the reply message from the server, determining whether to prompt the test to continue according to the indication in the reply message, and determining whether to allow the test to be completed.
When the test coverage rate is smaller than the preset coverage rate threshold value, reminding to continue testing according to the indication in the reply message; and when the test coverage rate is not less than the preset coverage rate threshold value, allowing the test to be completed according to the indication in the reply message, and further allowing the user to quit the test.
The technology provided by the embodiment of the invention has the following beneficial effects: the test condition of the code is determined by using the probe, so that the test condition of the code can be monitored more accurately; and a test result file is automatically generated according to the execution result of the probe, the test coverage rate is determined according to the test result, whether the test is continued or not is determined according to the test coverage rate, additional operation of a user is not needed, the test burden of the user is reduced, and the test is convenient for the user.
Fig. 3 is a flowchart of a code test monitoring method according to an embodiment of the present invention, where the method is applied to a server, and as shown in fig. 3, the method includes the following steps:
step S301, determining the test coverage rate according to the received test result file.
The test result file is a file generated according to an execution result after the probe inserted through the coverage instrumentation operation included in the tested code is executed.
Step S302, when the test completion request is received, whether the test coverage rate is smaller than a preset coverage rate threshold value is judged.
Step S303, when the test coverage is smaller than the preset coverage threshold, replying reply information including an instruction to continue the test.
In an embodiment, the method may further include: when the test coverage is not less than the preset coverage threshold, replying reply information comprising an indication that the test is allowed to be completed.
For example, the server receives a test result file, and determines the test coverage rate according to the received test result file; comparing the test coverage rate with a preset coverage rate threshold value, and when the test coverage rate is smaller than the preset coverage rate threshold value, replying reply information including an instruction for continuing the test; when the test coverage is not less than the preset coverage threshold, replying reply information comprising an indication that the test is allowed to be completed.
The technology provided by the embodiment of the invention has the following beneficial effects: the test condition of the code is determined by using the probe, so that the test condition of the code can be monitored more accurately; and comparing the test coverage rate with a preset coverage rate threshold value, and prompting to continue testing according to the comparison indication.
Fig. 4 is a structural diagram of a code test detection apparatus according to an embodiment of the present invention, and as shown in fig. 4, the code test detection apparatus includes:
an execution module 41, configured to execute a tested code for testing, where the tested code includes a probe inserted through a coverage instrumentation operation;
an obtaining module 42, configured to obtain an execution result of a probe when the probe included in the tested code is executed;
the generating module 43 is configured to generate a test result file according to the execution result of the probe, and send the test result file to the server, where the server is configured to determine the test coverage according to the test result file;
the reminding module 44 is used for sending a test completion request to the server when detecting that the operation of requesting to quit the test is performed, receiving reply information of the server, and judging whether to remind the server to continue the test according to the indication in the reply information;
and when the server judges that the test coverage rate is smaller than the preset coverage rate threshold value, indicating that the test is continued in the reply message.
In one embodiment, as shown in fig. 5, the apparatus further comprises:
the permission module 51 is configured to send a test completion request to the server when detecting that the test quitting operation is requested, and after receiving reply information of the server, determine whether to allow the test to be completed according to an indication in the reply information;
when the server judges that the test coverage rate is not less than the preset coverage rate threshold value, the reply message indicates that the test is allowed to be completed.
In an embodiment, the generating module is configured to use a timer, generate a test result file according to an execution result of the probe when the timing time arrives, and send the test result file to the server.
In an embodiment, the generating module is configured to generate a test result file according to an execution result of the probe when an operation requesting to quit the test is detected, and send the test result file to the server.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The embodiment of the invention also provides equipment which comprises the code test monitoring device in any embodiment.
Fig. 6 is a structural diagram of a code test detecting apparatus according to an embodiment of the present invention, where the apparatus is used in a server, and as shown in fig. 6, the code test detecting apparatus includes:
the determining module 61 is configured to determine a test coverage according to a received test result file, where the test result file is a file generated according to an execution result after a probe inserted through a coverage instrumentation operation included in a code to be tested is executed;
a judging module 62, configured to, when the test completion request is received, judge whether the test coverage is smaller than a preset coverage threshold;
and a replying module 63, configured to reply to a reply message including an instruction to continue the test when the test coverage is smaller than the preset coverage threshold.
In an embodiment, the reply module is further configured to reply a reply message including an indication that the test is allowed to be completed when the test coverage is not less than the preset coverage threshold.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The embodiment of the invention also provides equipment which comprises the code test monitoring device in any embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the above embodiments, there is also provided a non-transitory computer-readable storage medium including instructions, 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. A non-transitory computer-readable storage medium, instructions in which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform the above wireless network handover method,
it will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (13)

1. A code test monitoring method, comprising the steps of:
packing the generation module into a software development kit, and adding the generation module and a timer into a code to be tested during packing;
compiling the code to be tested to generate a code to be tested, wherein the code to be tested can be generated and sent to a test result file at regular time;
executing the tested code to test, wherein the tested code comprises a probe inserted through a coverage rate instrumentation operation;
obtaining an execution result of a probe included in the tested code when the probe is executed;
generating the test result file according to the execution result of the probe, and sending the test result file to a server, wherein the server is used for determining the test coverage rate according to the test result file and storing the test coverage rate;
when detecting the operation of requesting to quit the test, sending a test completion request to the server, receiving reply information of the server, and judging whether to remind the test to continue according to the indication in the reply information;
when the server judges that the test coverage rate is smaller than a preset coverage rate threshold value, indicating that the test is continued in the reply message;
the generating a test result file according to the execution result of the probe, and sending the test result file to a server includes: and using the timer, generating a test result file according to the execution result of the probe when the timing time is up, and sending the test result file to a server.
2. The method according to claim 1, wherein when detecting an operation requesting to quit the test, sending a test completion request to the server, and after receiving a reply message from the server, the method further comprises:
judging whether to allow the test to be completed according to the indication in the reply information;
when the server judges that the test coverage rate is not less than the preset coverage rate threshold value, the reply message indicates that the test is allowed to be completed.
3. The method of claim 1, wherein generating a test result file according to the execution result of the probe, and sending the test result file to a server, further comprises:
and when the operation of requesting to quit the test is detected, generating a test result file according to the execution result of the probe, and sending the test result file to a server.
4. A code test monitoring method is used for a server and is characterized by comprising the following steps:
determining a test coverage rate according to a received test result file, and storing the test coverage rate, wherein the test result file is a file generated according to an execution result after a probe inserted through a coverage rate instrumentation operation included in a tested code is executed at a timing time, and the tested code is generated through the following steps: packing a generating module into a software development kit, adding the generating module and a timer into a code to be tested during packing, and compiling the code to be tested to generate the code to be tested, wherein the code to be tested can be generated and sent to the test result file at regular time;
when a test completion request is received, judging whether the test coverage rate is smaller than a preset coverage rate threshold value;
and when the test coverage rate is smaller than the preset coverage rate threshold value, replying reply information comprising an instruction for continuing the test.
5. The method of claim 4, further comprising:
when the test coverage is not less than the preset coverage threshold, replying reply information comprising an indication that the test is allowed to be completed.
6. A code test monitoring device, comprising:
the execution module is used for executing tested code to test, the tested code comprises a probe inserted through a coverage instrumentation operation, and the tested code is generated through the following steps: packaging a generating module into a software development kit, adding the generating module and a timer into a code to be tested during packaging, and compiling the code to be tested to generate the code to be tested, wherein the code to be tested can be generated and sent to a test result file at regular time;
an obtaining module, configured to obtain an execution result of a probe included in the tested code when the probe is executed;
the generating module is used for generating the test result file according to the execution result of the probe and sending the test result file to a server when the timing time reaches by using the timer, and the server is used for determining the test coverage rate according to the test result file and storing the test coverage rate;
the reminding module is used for sending a test completion request to the server when detecting that the operation of requesting to quit the test is performed, receiving reply information of the server, and judging whether to remind the test to continue according to the indication in the reply information;
and when the server judges that the test coverage rate is smaller than a preset coverage rate threshold value, indicating that the test is continued in the reply message.
7. The apparatus of claim 6, further comprising:
the permission module is used for sending a test completion request to the server when detecting the operation of requesting to quit the test, and judging whether to allow the test to be completed or not according to the indication in the reply information after receiving the reply information of the server;
when the server judges that the test coverage rate is not less than the preset coverage rate threshold value, the reply message indicates that the test is allowed to be completed.
8. The apparatus of claim 6, wherein the generating module is further configured to generate a test result file according to an execution result of the probe when an operation requesting to quit the test is detected, and send the test result file to a server.
9. A code test monitoring device for a server, comprising:
the determining module is used for determining the test coverage rate according to the received test result file and saving the test coverage rate, wherein the test result file is a file generated according to an execution result after a probe which is included in a tested code and is inserted through a coverage rate instrumentation operation is executed at a timing time, and the tested code is generated through the following steps: packing a generating module into a software development kit, adding the generating module and a timer into a code to be tested during packing, and compiling the code to be tested to generate the code to be tested, wherein the code to be tested can be generated and sent to the test result file at regular time;
the judging module is used for judging whether the testing coverage rate is smaller than a preset coverage rate threshold value or not when the testing completion request is received;
and the reply module is used for replying reply information comprising an instruction for continuing the test when the test coverage rate is less than the preset coverage rate threshold value.
10. The apparatus of claim 9, wherein the replying module is further configured to reply to a reply message including an indication that the test is allowed to be completed when the test coverage is not less than a preset coverage threshold.
11. An apparatus, characterized in that the apparatus comprises a code test monitoring device according to any one of claims 6-8.
12. A device, characterized in that it comprises a code test monitoring apparatus according to any of claims 9-10.
13. A computer-readable storage medium having stored thereon computer-readable instructions for causing at least one processor to perform the method of any one of claims 1 to 5.
CN201510185623.5A 2015-04-17 2015-04-17 Code test monitoring method, device and equipment Active CN106155900B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510185623.5A CN106155900B (en) 2015-04-17 2015-04-17 Code test monitoring method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510185623.5A CN106155900B (en) 2015-04-17 2015-04-17 Code test monitoring method, device and equipment

Publications (2)

Publication Number Publication Date
CN106155900A CN106155900A (en) 2016-11-23
CN106155900B true CN106155900B (en) 2020-12-04

Family

ID=58058520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510185623.5A Active CN106155900B (en) 2015-04-17 2015-04-17 Code test monitoring method, device and equipment

Country Status (1)

Country Link
CN (1) CN106155900B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168872B (en) * 2017-05-11 2020-09-11 网易(杭州)网络有限公司 Code checking method, device, storage medium and processor
CN107480066B (en) * 2017-08-18 2020-10-30 网易(杭州)网络有限公司 Code coverage rate statistical method, device, storage medium, processor and terminal
CN108563578B (en) * 2018-04-20 2021-09-21 平安科技(深圳)有限公司 SDK compatibility detection method, device, equipment and readable storage medium
CN111090586B (en) * 2019-12-09 2024-02-09 广州品唯软件有限公司 Method and device for reporting code coverage rate data file and computer equipment
CN111209214B (en) * 2020-02-17 2023-04-25 网易(杭州)网络有限公司 Code test processing method and device, electronic equipment and medium
CN112463607B (en) * 2020-11-26 2024-03-15 苏州洞察云信息技术有限公司 Determination statement value confirmation method, device and storage medium
CN113360419B (en) * 2021-08-11 2022-06-07 云智慧(北京)科技有限公司 Application data processing method, device and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517876A (en) * 2003-01-17 2004-08-04 华为技术有限公司 Statistical method for covering rate of embedded system
CN101706750A (en) * 2009-11-16 2010-05-12 西安邮电学院 Detective pole acquiring method based on embedded type simulator
CN104199773A (en) * 2014-09-03 2014-12-10 腾讯科技(深圳)有限公司 Method and device for obtaining code coverage information

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408862B (en) * 2007-10-12 2012-08-22 李周 Embedded system test method
US20100131930A1 (en) * 2008-11-21 2010-05-27 International Business Machines Corporation Selective Code Coverage Instrumentation
CN102243609A (en) * 2011-06-15 2011-11-16 惠州运通信息技术有限公司 Embedded software-based test analysis method and system
CN103019933B (en) * 2012-11-27 2016-01-13 网宿科技股份有限公司 Test case coverage automatic identifying method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517876A (en) * 2003-01-17 2004-08-04 华为技术有限公司 Statistical method for covering rate of embedded system
CN101706750A (en) * 2009-11-16 2010-05-12 西安邮电学院 Detective pole acquiring method based on embedded type simulator
CN104199773A (en) * 2014-09-03 2014-12-10 腾讯科技(深圳)有限公司 Method and device for obtaining code coverage information

Also Published As

Publication number Publication date
CN106155900A (en) 2016-11-23

Similar Documents

Publication Publication Date Title
CN106155900B (en) Code test monitoring method, device and equipment
CN106294102B (en) Application program testing method, client, server and system
US9846601B2 (en) Method and apparatuses for determining a leak of resource and predicting usage of resource
RU2019126634A (en) DATA TRANSMISSION METHOD, TERMINAL DEVICE AND NETWORK DEVICE
EP3140732B1 (en) Startup accelerating method and apparatus
SG11201904533UA (en) Method, apparatus and system for detecting abnormal behavior of user
CN106792792B (en) Base station, user terminal and its downlink data control method and device
US20130311820A1 (en) Forecasting workload transaction response time
CN110196801B (en) Code coverage rate based test method and device
CN107357606B (en) Application program starting method and device of mobile terminal
CN107346272A (en) The determination method and apparatus of dynamic heterogeneous redundant system
CN108255700B (en) Test result generation method and device
WO2020098311A1 (en) Method and apparatus for resource leak detection
RU2017128108A (en) PLANNING INTERACTION WITH SUBJECT
JP5745561B2 (en) Prediction error evaluation apparatus and method
CN111078382A (en) Command timeout processing method and device
CN107273283B (en) Automatic software detection method and device
CN114428744A (en) Application program starting time monitoring method, monitoring server and system
CN104239199A (en) Virtual robot generation method, automatic test method and related device
CN105824824B (en) Standby call ticket collection equipment and call ticket file collection method thereof
WO2017101806A1 (en) Method and apparatus for acquiring network operation-and-maintenance (o&m) data
CN109271219B (en) Counting method and device for countdown animation position
CN110109673B (en) Compiler detection device and method based on Beidou subnanosecond high-precision time service
CN113032018B (en) Improved method for read command and related device
CN110334017B (en) Test script generation method and related device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221114

Address after: 1402, Floor 14, Block A, Haina Baichuan Headquarters Building, No. 6, Baoxing Road, Haibin Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518133

Patentee after: Shenzhen Yayue Technology Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right