Font Size: a A A

Research On Graph-based End-to-End Automated Program Repair Approaches

Posted on:2022-12-18Degree:MasterType:Thesis
Country:ChinaCandidate:B TangFull Text:PDF
GTID:2518306611494754Subject:Computer Software and Application of Computer
Abstract/Summary:PDF Full Text Request
Automated Program Repair(APR)technology is an important technology to reduce the cost of operations and maintenance used by enterprises for program repair and to free developers from heavy burden of repairing work.The rise of deep learning has provided a new solution for APR.In recent years,deep learning techniques have been widely used in the field of automated program repair.The mainstream deep learning-based APR approaches mainly apply neural machine translation models to translate defective programs end-to-end into correct code to complete the repair process.However,these approaches mainly take sequence or tree representation to represent source code.Programming languages inherently have a variety of characteristics,such as the existence of long-term dependencies between words and the high degree of freedom in variable naming.It is difficult to model long-term dependencies by sequence representation while the use of tree representation may introduce redundancy due to the presence of virtual nodes.The application of these representations will directly affect the performance of the translation model and make it difficult to learn the implied semantics.In this paper,two graph-based automated program repair approaches are proposed to address the problems with code representation and translation model applicability in the field of neural machine translation-based program repair.On the one hand,we use static analysis techniques to generate program graphs and represent source code based on graphs.On the other hand,to adapt the input in graph,a graph neural network-based encoder is used to replace the sequence encoder in the traditional neural machine translation model.In summary,this paper makes the following contributions:1)A graph-based approach to method-level APR is proposed.This approach represents bug methods as an optimized program graph representation based on abstract syntax tree to preserve the rich syntactic semantic information,and then introduces Graph-to-Sequence learning for constructed graph representations to generate methodlevel patches end-to-end for bug methods while preserving the full graph structure information.Experiments on the Java benchmark dataset Defects4J show that our approach can repair 34 bug methods,outperforming the baseline in the method-level APR task.2)A graph-based approach to statement-level APR is proposed.This approach designs a program graph representation incorporated with several types of semantic information retain complex semantic information in source code.In order to model different types of semantic information,we introduce a novel graph encoder based on Relational Graph Convolutional Network(RGCN).Experiments on the Java benchmark dataset Defects4J show that our approach is able to repair 38 real defects and outperform the baseline in statement-level APR task.3)An online automated program repair system is deployed.This system provides analysis of bug programs and provides different solutions for buggy programs with different granularity to assist developers in understanding programs and completing program repair tasks.
Keywords/Search Tags:Automatic program repair, Neural machine translation, Code representation, Program static analysis, Graph neural network
PDF Full Text Request
Related items