Effective automated program repair techniques have great potential to reduce the costs of debugging and maintenance. Previously proposed automated program repair (APR) techniques often follow a generate-and-validate and testcase-driven procedure: They first randomly generate a large pool of fix candidates and then exhaustively validate the quality of the candidates by testing them against existing or provided test suites. Unfortunately, many real-world bugs cannot be repaired by existing techniques even after more than 12 hours of computation in a multi-core cloud environment. More work is needed to advance the capabilities of modern APR techniques.We propose a new technique that utilizes the wealth of bug fixes across projects in their development history to effectively guide and drive a program repair process. Our main insight is that recurring bug fixes are common in real-world applications, and that previously-appearing fix patterns can provide useful guidance to an automated repair technique. Based on this insight, our technique first automatically mines bug fix patterns from the history of many projects. We then employ existing mutation operators to generate fix candidates for a given buggy program. Candidates that match frequently occurring historical bug fixes are considered more likely to be relevant, and we thus give them priority in the random search process. Finally, candidates that pass all the previously failed test cases are recommended as likely fixes. We compare our technique against existing generate-andvalidate and test-driven APR approaches using 90 bugs from 5 Java programs. The experiment results show that our technique can produce good-quality fixes for many more bugs as compared to the baselines, while being reasonably computationally efficient: it takes less than 20 minutes, on average, to correctly fix a bug.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.