Font Size: a A A

Automatic Software Repair Method Based On Repair Template

Posted on:2024-02-15Degree:MasterType:Thesis
Country:ChinaCandidate:Z H HeFull Text:PDF
GTID:2568307097971529Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Defect repair is an important part of software maintenance.It is the key to reducing software development costs and improving software quality.Automated software repair has great potential to reduce debugging and maintenance costs during software development,among other things.In recent years,many automatic software repair methods have proven to be useful in software development.However,it is still challenging to reduce the search for large search spaces in order to improve the quality of patches and thus the success and efficiency of automatic software repair methods.To address these issues,this paper investigates two automatic software repair methods based on repair templates and integrates the two software defect repair methods into one repair tool with the following main research:(1)To address the problem of random selection and navigation of repair materials in automatic software repair,we propose pre-defined template and context aware based automatic software repair,and implement the defect repair tool PCRepair.Firstly,the method uses Ochiai fault localization technique to locate the suspicious defect statements and generates a list of suspicious defect statements.Secondly,the context of the suspicious statements is matched with the context of the repair template and use context-aware technology to reduce the search for search space to generate candidate patches for the suspicious statements.Then,the candidate patches are ranked using a patch prioritization technique with weighted fusion similarity,and the ranked candidate patches are sequentially passed through the matching test cases.Finally,until either a plausible patch is generated,or all patch candidates are validated.We experimented with 395 defects in six items on the Defects4 J dataset.The experimental results show that PCRepair correctly repairs 38 defects.Compared with j Gen Prog,Historical Fix,JAID,ACS,KPAR,ELIXIR,AVATAR,Nopol,Fix Miner,Sketch Fix,CODIT and Tufano19,PCRepair outperformed the existing methods in terms of defect repair success rate and efficiency.(2)To address the problems of too coarse repair granularity and poor patch quality in automatic software repair,we propose graph mining template and genetic programming based automatic software repair,and implement the defect repair tool MGRepair.Firstly,the method uses Ochiai fault localization technique to locate the suspicious defective statements and generates a list of suspicious defective statements.Secondly,the context of the suspicious utterance is matched with the context of the graph mining template to generate initialized populations for the suspicious utterance.The defective programs are evolved according to the mutation and crossover operations of genetic programming to generate new individuals.Then,the candidate patches are sequentially passed through the matching test cases,and the test cases are sorted in descending order using the test case prioritization technique.Finally,the filters out patches that fail the test case and outputs patches that pass the test case.We experimented with 395 defects in six items on the Defects4 J dataset.The experimental results show that MGRepair correctly repairs 41 defects.Compared with j Gen Prog,Historical Fix,JAID,ACS,KPAR,ELIXIR,AVATAR,Nopol,Fix Miner,Sketch Fix,CODIT and Tufano19,MGRepair outperformed the existing methods in terms of defect repair success rate and efficiency.(3)This paper integrates two automatic software repair methods,PCRepair and MGRepair,into one repair tool,Bug Fix.The repair tool consists of three main modules: fault localization module,patch generation module and patch validation module.The repair tool is simple to use and only needs to be executed according to the instructions of the tool,which has the corresponding application value.
Keywords/Search Tags:Automatic software repair, Repair template, Context, Genetic programming, Code similarity
PDF Full Text Request
Related items