Check patentability & draft patents in minutes with Patsnap Eureka AI!

Method, device and system for code coverage test

A code coverage and testing device technology, applied in the field of communications, can solve problems such as poor reliability, and achieve the effect of improving reliability and having little effect

Active Publication Date: 2015-06-24
TENCENT TECH (SHENZHEN) CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] In the process of research and practice of the prior art, the inventor of the present invention found that the binary files of the test codes of the existing two schemes have undergone substantial changes, therefore, the reliability of the test is not good

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, device and system for code coverage test
  • Method, device and system for code coverage test
  • Method, device and system for code coverage test

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] Embodiments of the present invention will be described from the perspective of a code coverage test device. The code coverage test device may be integrated into a terminal, and the terminal may specifically be a smart phone, a tablet computer, an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III, moving picture experts compressed standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, moving picture experts compressed standard audio layer 3) players, laptop portable computers and desktop computers, etc.

[0031] A code coverage testing method, comprising: obtaining a binary file and a symbol table generated after compiling source code, and parsing the binary file according to the symbol table to determine the position of a function defined by each source code. When loaded into memory but not executed, set a debug point for the image loaded into memory by the binary file according to the position of the function, determine the e...

Embodiment 2

[0060] According to the method described in Embodiment 1, an example will be given below for further detailed description.

[0061] Such as figure 2 As shown, a code coverage testing method, the specific process can be as follows:

[0062] 201. The code coverage testing device obtains the binary file and the symbol table generated after the source code is compiled.

[0063] Wherein, the binary file and the symbol table can be obtained by compiling the source code to be tested by the compiler.

[0064] 202. The code coverage testing device parses the binary file according to the obtained symbol table, so as to determine the position of the function defined by each source code in the binary file.

[0065] Wherein, the position of the function refers to the actual position of the function after compilation.

[0066] 203. The code coverage test device monitors the loading of each binary file in the operating system. When the binary file is loaded into the memory but not execut...

Embodiment 3

[0081] According to the methods described in Embodiments 1 and 2, the following will be described by taking the Windows driver program test under the Microsoft (Windows) system as an example. It should be understood that the embodiments of the present invention may also be applicable to other hardware platforms, other operating systems, and other programs, which will not be repeated here.

[0082] In the example of the present invention, the code coverage testing device may include a driver module and a user-mode console command-line tool module, referred to as the command-line tool module. Among them, the driver module can be installed on the test machine, and the command line tool module can be directly copied to the test machine. Among them, the functions of these two modules can be as follows:

[0083] (1) The driver module can complete the following functions:

[0084] In the Windows kernel, the user can specify a binary file of the tested driver and a function entry ad...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiments of the invention disclose a code coverage testing method, device and system. In an embodiment of the invention, a binary file and a symbol table generated after source codes are complied are acquired; the binary file is parsed by using the symbol table to determine a position of function defined by each source code; then when the binary file is loaded into a memory and not yet executed, a debug point is set for a map of the binary file that is loaded into the memory according to the position of the function; a code basic block that has been executed is determined according to the debug point, and relevant information of the code basic block that has been executed is recorded in the memory; finally, the relevant information of the code basic block is converted into code line information by using the symbol table, to obtain code lines that the test covers. This solution can improve reliability of test.

Description

technical field [0001] The invention relates to the technical field of communications, in particular to a code coverage test method, device and system. Background technique [0002] Code coverage testing refers to a test method that uses a test method to run code, and counts the code that has been run (that is, covered) in the test. Its purpose is to ensure that the test can cover as much code as possible to improve the reliability of the test. There are many evaluation methods for code coverage, code line coverage is one of them, that is, a good code coverage test method should ensure that the test can cover as many code lines as possible, and clearly know the covered and uncovered code lines . [0003] There are mainly two existing code coverage testing methods, as follows: [0004] 1. Compiler support: When compiling the code, by specifying special compilation parameters, the compiler will generate a special version of the binary file. This binary file inserts special ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36
CPCG06F11/3676
Inventor 谭文
Owner TENCENT TECH (SHENZHEN) CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More