Font Size: a A A

Automatic Program Repair Method Based On Syntactic And Semantic Analysis

Posted on:2024-05-22Degree:MasterType:Thesis
Country:ChinaCandidate:W H YuFull Text:PDF
GTID:2568307091965299Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Automatic program repair techniques play a significant role in software development by effectively reducing the manual effort required to fix software defects and improving development efficiency.Currently,deep learning-based automatic program repair methods start from source code representation and building deep learning models.They leverage large-scale open-source data to guide the repair process,without relying on human expertise,and can be executed on different platforms for program repair.However,existing methods lack the extraction of code structure features,which affects the accuracy of program repair.In addition,there is redundant information in the representation of defect contexts,which affects the efficiency of software repair.This paper conducts research on the above issues.To address the issue of lacking structural information in program repair models,an automatic program repair method(CTransformer)combining lexical and syntactic information is proposed.The method uses code text and abstract syntax tree as source code representation information,uses Transformer network to construct program repair models,and combines the deep position information of abstract syntax tree as position encoding,enabling the model to learn the structural features of abstract syntax tree.In order to verify the effectiveness of the proposed CTransformer method,this paper conducted experimental evaluations on 395 defect programs in Defects4 j v1.2.The results showed that the source code representation method designed by CTransformer can effectively improve the repair performance of the model.In order to mitigate the impact of redundant defect context information on the repair efficiency of the program repair model,this paper analyzes the dependency between defect statements and defect context,uses Semantic information to assist program repair,designs an automatic program repair method based on defect context semantic analysis,and combines it with the CTransformer method proposed previously to form a new program repair method(CSTransformer).In order to verify the effectiveness of the method,this article conducted experimental verification on the benchmark dataset Defects4 j.The experimental results showed that the proposed CSTransformer method improved computational efficiency by 31% compared to existing methods,while adding two correct patches;Methods Using different hyperparameter to combine multiple groups of CSTransformers,47 defective programs were correctly repaired,and the number of correct patches was further increased.
Keywords/Search Tags:Automatic Program Repair, Transformer, Program Syntactic Features, Abstract Syntax Tree
PDF Full Text Request
Related items