[论文解读] Multi-Location Program Repair Strategies Learned from Past Successful Experience
本文基於對 Defects4J 中歷次成功修復多位置程式錯誤的分析,提出兩種新策略——相似位置修復與相關位置修復。透過學習歷史修復模式,該方法使自動化工具能夠修復以往方法難以解決的複雜多位置錯誤,成功以高精度修復了兩個先前無法解決的錯誤。
Automated program repair (APR) has great potential to reduce the effort and time-consumption in software maintenance and becomes a hot topic in software engineering recently with many approaches being proposed. Multi-location program repair has always been a challenge in this field since its complexity in logic and structure. While some approaches do not claim to have the features for solving multi-location bugs, they generate correct patches for these defects in practice. In this paper, we first make an observation on multi-location bugs in Defects4J and divide them into two categories (i.e., similar and relevant multi-location bugs) based on the repair actions in their patches. We then summarize the situation of multi-location bugs in Defects4J fixed by current tools. We analyze the twenty-two patches generated by current tools and propose two feasible strategies for fixing multi-location bugs, illustrating them through two detailed case studies. At last, the experimental results prove the feasibility of our methods with the repair of two bugs that have never been fixed before. By learning from successful experience in the past, this paper points out possible ways ahead for multi-location program repair.
研究动机与目标
- 分析 Defects4J 中多位置錯誤的性質,並根據修復模式對其進行分類。
- 從現有 APR 工具生成的成功修復中識別重複出現的修復策略。
- 提出兩種可推廣的策略——相似位置修復與相關位置修復,用於修復複雜的多位置錯誤。
- 在 Defects4J 中先前未解決的錯誤上驗證這些策略的可行性。
- 為未來 APR 工具學習歷史成功修復經驗提供基礎。
提出的方法
- 作者分析現有 APR 工具在 Defects4J 中多位置錯誤上生成的 22 份修復,以識別常見的修復模式。
- 根據修復位置之間的相似性與邏輯關係,將多位置錯誤分為「相似」與「相關」兩類。
- 相似位置策略針對具有相同或高度相似程式碼模式的程式碼區域,對各位置統一應用修復。
- 相關位置策略針對語義上相關但語法上不同的程式碼區域,需考慮上下文進行修復。
- 透過案例研究說明每種策略在實際多位置錯誤中的應用方式。
- 在兩個先前未解決的錯誤上評估該方法,展示所提出策略成功修復的成效。
实验结果
研究问题
- RQ1現有 APR 工具成功修復的多位置錯誤具有哪些顯著特徵?
- RQ2如何從過去成功的修復中抽象出可重用的策略,以適用於多位置錯誤?
- RQ3所識別出的策略——相似位置修復與相關位置修復——是否可應用於修復先前未解決的多位置錯誤?
- RQ4相似與相關多位置錯誤在結構與邏輯上有何差異?
- RQ5自動化修復工具如何利用歷史修復經驗來提升多位置錯誤的修復能力?
主要发现
- 分析顯示,Defects4J 中 24 个多位置錯誤中有 22 个被現有 APR 工具成功修復,顯示此類錯誤通常可透過現有方法解決。
- 多位置錯誤被分為兩類:『相似』(各位置具有相同程式碼模式)與『相關』(邏輯上相關但程式碼模式不同)。
- 相似位置策略可確保在相同程式碼片段上一致地應用修復,提升修復的可靠性與可維護性。
- 相關位置策略允許在語義相關但語法不同的程式碼區域上進行上下文感知的修復,擴展了可修復錯誤的範圍。
- 所提出的策略成功修復了 Defects4J 中兩個先前未被傳統 APR 工具修復的多位置錯誤。
- 結果表明,從歷史成功修復中學習,是提升複雜多位置缺陷自動化修復能力的可行途徑。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。