Unlock instant, AI-driven research and patent intelligence for your innovation.

Code repair case obtaining method, device and equipment and storage medium

A code and case technology, applied in version control, software maintenance/management, reverse engineering, etc., can solve the problems of limited number of code repair cases and low efficiency of collecting cases

Active Publication Date: 2019-08-16
BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF12 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The embodiment of the present invention provides a code repair case acquisition method, device, equipment and storage medium to solve the technical problems in the prior art that the number of code repair cases collected manually is limited and the efficiency of collecting cases is low

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
  • Code repair case obtaining method, device and equipment and storage medium
  • Code repair case obtaining method, device and equipment and storage medium
  • Code repair case obtaining method, device and equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] figure 1 It is a flow chart of a method for obtaining a code repair case provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation where the code repair case is automatically obtained according to the requirement of automatic source code repair, and the method can be obtained from the corresponding code repair case implemented by means, the means may be implemented in software and / or hardware, and may be configured on equipment, such as computer equipment.

[0030] like figure 1 As shown, code repair case acquisition methods can include:

[0031] S101. Obtain fingerprint information of the code line to be repaired in the current version and the incremental version of the target source code respectively, wherein the fingerprint information is used to uniquely describe the code line.

[0032] Since the code needs to iteratively repair the defective code before the code is put into the warehouse, the incremental version of the targ...

Embodiment 2

[0055] figure 2 It is a schematic flowchart of a method for acquiring code repair cases provided by Embodiment 2 of the present invention. This embodiment is based on the above-mentioned embodiments, and before extracting the corresponding code segment, an operation of checking the fingerprint information of the code line to be repaired in the code segment is added.

[0056] like figure 2 As shown, code repair case acquisition methods can include:

[0057] S201. Acquire fingerprint information of the code line to be repaired in the current version and the incremental version of the target source code respectively, wherein the fingerprint information is used to uniquely describe the code line.

[0058] S202. Compare the fingerprint information of the code line to be repaired in different versions of the target source code, and determine the target fingerprint information, wherein the target fingerprint information exists in the current version and does not exist in the incr...

Embodiment 3

[0066] image 3 It is a schematic structural diagram of a device for obtaining code repair cases provided by Embodiment 3 of the present invention. like image 3 As shown, the device includes:

[0067] The fingerprint information extraction module 301 is used to respectively obtain the fingerprint information of the code line to be repaired in the current version and the incremental version of the target source code, wherein the fingerprint information is used to uniquely describe the code line;

[0068] A screening module 302, configured to compare the fingerprint information of the line of code to be repaired in different versions of the target source code, and determine the target fingerprint information, wherein the target fingerprint information exists in the current version and does not exist in the incremental version;

[0069] The first locating module 303 is configured to obtain the pre-repair abstract syntax tree corresponding to the current version of the target s...

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 embodiment of the invention discloses a code repair case obtaining method and device, equipment and a storage medium, and the method comprises the steps: determining target fingerprint informationaccording to the fingerprint information of a to-be-repaired code line, wherein the target fingerprint information exists in the current version of a target source code, and does not exist in the increment version of the target source code; according to the abstract syntax tree before restoration corresponding to the current version of the target source code, positioning a current version code range of a target function to which the target fingerprint information belongs and target function feature information in the target source code; according to the repaired abstract syntax tree corresponding to the incremental version of the target source code and the target function feature information, positioning an incremental version code range of the target function in the incremental version of the target source code; and according to the current version code range and the increment version code range, respectively extracting corresponding code segments of the target source code in different versions as code repair cases. According to the embodiment of the invention, the abstract syntax tree technology is utilized to automatically and efficiently extract the repair cases.

Description

technical field [0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method, device, device, and storage medium for acquiring code repair cases. Background technique [0002] Source code automatic repair technology is a major trend in the industry, and the premise of automatic repair is to have a large amount of source code repair case information, including bug content, code fragments before repair, and code fragments after repair. [0003] In the traditional way, the collection of samples requires manual intervention, so for the automatic repair technology represented by machine learning, manual acquisition of code bug repair cases is inefficient and far from meeting the needs of actual use. Contents of the invention [0004] Embodiments of the present invention provide a method, device, device, and storage medium for acquiring code repair cases, so as to solve the technical problems in the prior art that the num...

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
IPC IPC(8): G06F8/75G06F8/71
CPCG06F8/75G06F8/71
Inventor 焦建锋张克鹏李彦成周秀霞
Owner BEIJING BAIDU NETCOM SCI & TECH CO LTD