Mining Fix Patterns with Context Information for Automatic Program Repair

2023 IEEE/ACM International Workshop on Automated Program Repair (APR)(2023)

引用 0|浏览2
暂无评分
摘要
Template-based automatic program repair (APR) using pre-defined fix patterns for generating patches is common in APR literature and is implemented in many APR tools. As the existing APR tools can fix only a limited number of bugs, automatic mining fix patterns from human-written fixes is an appropriate approach to expand the fix pattern set at low cost. On the other hand, a large number of fix patterns do not ensure that a template-based APR tool will become more effective if the buggy context describing the condition for choosing a fix pattern to generate fixes for a buggy code is too generic. Because the state-of-the-art fix patterns just provide a generic code context for matching a fix pattern, the number of matched patterns and therefore the number of generated patches is exceptionally large. Therefore, we mine human-written fixes automatically to not only extract new fix patterns but also clarify the buggy contexts of the bug fix instances forming each fix pattern. Different from the previous works, we propose to use test execution information, such as exception types and execution paths, in addition to code contexts, as the buggy contexts of the fix patterns. For mining strategy, we choose an agglomerative hierarchical clustering algorithm with our custom distance metric to group the bug fix instances that make the same or similar changes into the same cluster. The evaluation result on the bug set of two APR benchmarks Defects4J and Bears reveals that the fix patterns extracted from the clusters containing at least two similar bug fix instances are matched with most of the state-of-the-art fix patterns. Moreover, 11 new fix patterns are found. The buggy contexts, including the code context and the test execution information, of all bug fix instances forming each fix pattern are also clarified. Our fix patterns with the new buggy context information are expected to help the template-based APR tools generate and verify patches more effectively.
更多
查看译文
关键词
automatic program repair,fix pattern,edit script,AST,buggy context,code context,test execution infor-mation,hierarchical clustering,custom distance metric
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要