Method and apparatus for determining coverage information for incremental code

A code coverage and coverage technology, applied in the computer field, can solve the problems of no statistics, impact on the accuracy of results, missing coverage indicators, etc., to reduce data errors and improve efficiency and accuracy.

Active Publication Date: 2021-05-25
BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But when there is such a situation in the source code that one line of statement is written in multiple lines of code, if an increment occurs in multiple lines of code, it is often not counted in the coverage result, which affects the accuracy of the result
In addition, some languages ​​are limited by coverage tools, and some coverage indicators are missing
For example, coverage, the most widely used language test coverage tool for python, cannot obtain function coverage
The missing coverage index also has a certain impact on the measurement of the coverage of the tested source file

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 apparatus for determining coverage information for incremental code
  • Method and apparatus for determining coverage information for incremental code
  • Method and apparatus for determining coverage information for incremental code

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0028] The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.

[0029] It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.

[0030] figure 1 An exemplary system architecture 100 is shown to which embodiments of the method for determining coverage information of incremental codes or the apparatus for determining coverage information of incremental codes of the present application can be applied.

...

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 present application discloses a method and a device for determining coverage information of incremental codes. The method includes: using a code manager to obtain an incremental change file of the code of the version to be tested relative to the code of the baseline version; based on the incremental change file, obtaining the incremental code of the code of the version to be tested relative to the code of the baseline version; Test to get the overall code coverage information; based on the overall code coverage information and the incremental change file, map the changed code lines of the incremental code to the line objects of the abstract syntax tree; traverse the line objects of the abstract syntax tree, from the abstract syntax tree Determine the total number of feature information of the incremental code and the number of covered feature information of the incremental code in the row object; divide the number of covered feature information of the incremental code by the total number of feature information of the incremental code to obtain the coverage rate of the incremental code information. The method can improve the efficiency and accuracy of testing incremental codes.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to the field of computer network technology, and in particular to a method and device for determining coverage information of incremental codes. Background technique [0002] The product iteration of the Internet industry is getting faster and faster. In order to ensure the quality of the product, the role of unit testing cannot be underestimated. For legacy projects, a large amount of unit test code for legacy code is missing. The cost of unit test code that complements the original code is very high, and the effect is not significant. [0003] In this case, it is feasible to check and measure the coverage of the newly added code. However, the existing coverage statistics tools can only count the coverage of all codes by unit test cases, and developers and testers often focus on the coverage data of incremental codes. Three coverage indicators are commonly used for c...

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 BAIDU ONLINE NETWORK TECH (BEIJIBG) 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