Method and device for obtaining code coverage information

A technology of code coverage and coverage information, which is applied in the field of software testing, can solve problems such as low efficiency and failure to generate code coverage reports, and achieve the effect of avoiding the testing process and improving testing efficiency

Active Publication Date: 2017-08-25
TENCENT TECH (SHENZHEN) CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, since the software under test is not an officially released software product, there may be many bugs in itself. Therefore, when an error occurs in the execution of the unit test sample code and the execution of the software under test crashes (crashes) and the execution is terminated, it cannot generate Code coverage report requires testers to repeat the test process after code modification to generate a complete code coverage report, resulting in low test efficiency

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 and device for obtaining code coverage information
  • Method and device for obtaining code coverage information
  • Method and device for obtaining code coverage information

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] Code coverage (code coverage) information is a measure in software testing, which describes the proportion, location and degree of the source code in the program being tested, and the resulting proportion is also called code coverage. For example, if the code coverage rate of a certain piece of code is 80% during the test, it means that 80% of the code in the test is called and executed, that is, the test is completed for 80% of the program statements, but there are still 20 For % of the code, the program statements under some conditional branches are not executed, or some functions are not called because the test samples input during the test are not comprehensive enough. The report containing code coverage information in the prior art may also include specific program statement execution conditions, and all executed program statements are displayed in the file, which is convenient for testers to view.

[0025] However, in existing software testing, testers first write...

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

A method for obtaining code coverage information comprises the steps that source codes or binary files to be tested are loaded, and instrumentation marks are added to the source codes or binary files to be tested; code coverage information generating instructions are received; the instrumentation marks corresponding to the code coverage information generating instructions are counted, and corresponding code coverage information is extracted; the extracted code coverage information is integrated and written into a corresponding code coverage report. In addition, the invention provides a device for obtaining the code coverage information. The method and device for obtaining the code coverage information can avoid a repeated testing process, and thus testing efficiency is improved.

Description

technical field [0001] The invention relates to the technical field of software testing, in particular to a method and device for acquiring code coverage information. Background technique [0002] In the existing software testing technology, it is usually necessary to count the code coverage information during the testing process, which describes parameters such as the quantity, location and proportion of the source code of the software under test executed during the testing process. [0003] Existing methods for obtaining code coverage information usually run a plurality of unit test sample codes, and then count the read and write addresses of the software under test in the memory after the software test is over, so as to count the number and location of codes executed in the software under test, Generate reports that include code coverage information. [0004] However, since the software under test is not an officially released software product, there may be many bugs in ...

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
Inventor 丁如敏沈东雄
Owner TENCENT TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products