arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

用基础模型检测Python重构实现中的行为变化

Detecting Behavioral Changes in Python Refactoring Implementations with Foundation Models

Jonhnanthan Oliveira, Rohit Gheyi, Márcio Ribeiro, Alessandro Garcia

arXiv 2608.09919首次发表:更新:

AI 中文总结

本研究提出基于基础模型Oracle的方法,通过分析git风格差异检测Python重构的行为变化,在Rope上评估发现13个bug,12个被接受,凸显需提升Python重构工具鲁棒性。

AI 中文摘要

Python是一种被广泛采用的编程语言,以其简洁性和灵活性受到重视。然而,尽管重构是软件演进中旨在改进内部代码结构且不改变外部行为的重要实践,Python的自动重构仍然具有挑战性。理解重构过程中如何引入行为变化至关重要,因为此类问题会损害软件可靠性并降低开发者生产力。我们提出一种基于基础模型Oracle的方法,该方法分析git风格的差异以识别Python重构引入的行为变化。我们在Rope重构实现上评估了我们的技术,复用了之前研究中的1152次重构尝试,并使用该Oracle分析了217个生成的转换对。我们基于模型的分析在所研究的7种重构类型中发现了13个不同的bug。所有报告的bug都已提交给相应的开发者,根据问题跟踪器的证据,13个问题报告中有12个被接受。这些结果凸显了提高当前Python重构工具鲁棒性的必要性,以确保自动代码转换的正确性并支持可靠的软件维护。

英文摘要

Python is a widely adopted programming language, valued for its simplicity and flexibility. However, automated refactoring for Python remains challenging, even though refactoring is an essential practice in software evolution aimed at improving internal code structure without changing external behavior. Understanding how behavioral changes are introduced during refactoring is crucial, as such issues can compromise software reliability and reduce developer productivity. We propose an approach based on a foundation model oracle that analyzes git-style diffs to identify behavioral changes introduced by Python refactorings. We evaluated our technique on Rope refactoring implementations, reusing 1,152 refactoring attempts from a prior study and analyzing 217 resulting transformation pairs with the oracle. Our model-based analysis uncovered 13 distinct bugs among the seven refactoring types studied. All reported bugs were submitted to the respective developers, and 12 of the 13 resulting issue reports were accepted according to issue-tracker evidence. These results highlight the need to improve the robustness of current Python refactoring tools to ensure the correctness of automated code transformations and support reliable software maintenance.

CommentsAccepted at Brazilian Symposium on Software Engineering (SBES) 2026

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑