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

Code conversion derivation method and device based on single sample

A code conversion and code technology, applied in the field of code conversion derivation based on a single example, can solve the problems of a small number of modified examples, not necessarily applicable, and inability to obtain the desired correct modification in complex and changeable situations.

Active Publication Date: 2019-12-31
PEKING UNIV
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the existing work in the technical field, on the one hand, for methods that rely on the use of a large number of related code modifications to derive code transformations, such as Gensis (F.Long, P.Amidon, and M.Rinard, "Automatic inference of code transforms for patch generation,” in ESEC/FSE, 2017, pp.727–739.), which is characterized by the need for a large number of modifications of the same type to generate code conversion templates, but this is not necessarily applicable in real scenarios, especially for For some project-specific co

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 conversion derivation method and device based on single sample
  • Code conversion derivation method and device based on single sample
  • Code conversion derivation method and device based on single sample

Examples

Experimental program
Comparison scheme
Effect test
No Example Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a code conversion derivation method and device based on a single sample. The method comprises the following steps: extracting a code hypergraph based on sample code fragmentsbefore and after modification; extracting an operation sequence of code modification based on the sample code snippets before and after modification; simplifying the code hypergraph according to the operation sequence of code modification and by statistically analyzing the attribute frequency in the open source project code, and jointly forming a code conversion template by the simplified code hypergraph and the operation sequence of code modification; giving a to-be-modified code fragment, extracting a code hypergraph of the to-be-modified code fragment, and matching the to-be-modified code fragment with the code conversion template to obtain a modified code fragment. Generalized code conversion can be derived and extracted only through one code modification example, it is effectively avoided that derivation must depend on a large number of related code modifications, reasonable code conversion can be derived more effectively, and the method is suitable for various application scenes.

Description

technical field [0001] The invention belongs to the field of software engineering in computer science and technology, and in particular relates to a code conversion and derivation method and device based on a single sample. Background technique [0002] Repeated modifications often occur in software development. Deriving code conversion from existing modifications can help developers automate these code modifications. Specific scenarios include systematic modification, repair of recurring program defects, API adaptation, and code migration , code refactoring, and more. [0003] In the existing work in the technical field, a typical method is to learn from multiple modification examples to abstract the modification mode, and another method is to artificially pre-define the rules to perform fixed abstraction on the modification. [0004] In the existing work in the technical field, on the one hand, for methods that rely on the use of a large number of related code modificatio...

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/41
CPCG06F8/42
Inventor 姜佳君任路遥熊英飞张令明
Owner PEKING UNIV