Font Size: a A A

Study On Automatic Program Repair Method Based On Machine Learning

Posted on:2023-02-28Degree:MasterType:Thesis
Country:ChinaCandidate:Y HuangFull Text:PDF
GTID:2568306788475774Subject:Software Engineering Technology
Abstract/Summary:PDF Full Text Request
In the process of software development,software defects are difficult to avoid,and software defect repair is one of the important means to ensure software quality.However,with the increase of software scale and complexity,the traditional software defect repair methods are facing problems such as insufficient ability and high cost.Therefore,researchers propose an automatic software repair method based on machine learning to improve the automation of program repair.Through the automatic software repair method based on machine learning,the repair cost can be reduced,and the software defects can be repaired automatically without manual intervention.The study on the automatic software repair method based on machine learning is of great significance to the theoretical research and practical application in the field of defect repair.Researchers at home and abroad have conducted in-depth research on patch generation and patch verification in automatic software repair methods based on machine learning,but there are still some problems to be solved:(1)The repair preference of software repair methods based on deep learning for different types of defects is still unclear,so they can not give full play to the role of deep learning model to improve the repair efficiency;(2)At present,most of the automatic program repair methods use the test suite to verify the generated repair patches.A complete program repair requires a huge time overhead.In view of the above shortcomings,this thesis puts forward the corresponding research methods:(1)Studying the repair preference of deep learning methods for different types of defects from two angles,including whether the software automatic repair method based on deep learning has different repair preference for different types of defects on the basis of defect classification,and compare and analyze the different preference of different learning models to repair different types of defects.The experimental results show that the software automatic repair method based on deep learning has the most obvious repair preference for three types of defects,including IF statement type,method statement type and return statement type,and the methods based on different learning models also have different repair preference for different types of defects;(2)A patch validation approach combining Doc2 Vec and BERT embedding technology is proposed for patch sorting.Firstly,the trained Doc2 Vec model is used to calculate the cosine similarity between the patch code generated by the automatic program repair tool and the error code fragment,and all patches are sorted in descending order according to the similarity,and the patches with similarity higher than the threshold are selected;at the same time,the BERT model is used to classify the error-patch code pairs generated by the automatic program repair tool,and the error patches in the set of patches selected by Doc2 Vec model are filtered out according to the classification results.Experiments are performed to verify the method on the patches generated by 15 automatic repair tools,and the method is used to filter the patches generated by 5 automatic repair tools.The experimental results show that this method can effectively verify the correctness of patches and improve the efficiency of patch validation.(3)An automatic program repair tool based on deep learning is designed and implemented.According to different defect types,the tool can generate patches for defects using different methods based on deep learning,sort the generated patches,and finally validate the patches.
Keywords/Search Tags:automatic program repair, deep learning models, patch generation, embedding technologies, patch validation
PDF Full Text Request
Related items