paperbot · PL 论文追踪

全部论文 待读 收藏

P2 The untold story of code refactoring customizations in practice

实践中的代码重构定制化:一个未被讲述的故事
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 2/10 · 论文关注重构定制化实践与IDE工具支持,属于软件工程/开发者工具实证研究,与画像核心的静态分析、LLM/Agent、浮点程序分析、贝叶斯程序分析均无直接交集。虽然重构工具底层可能涉及程序分析,但本文不讨论分析方法、LLM或Agent。引用 14 inbox
Daniel Oliveira, Wesley K. G. Assunção, Alessandro Garcia, Ana Carla Bibiano, Márcio Ribeiro, Rohit Gheyi, Baldoino Fonseca
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:通过分析13个项目1162次重构与调查40名开发者,揭示实践中重构常伴随定制化修改且IDE支持不足。

文献为每种重构定义了标准代码修改,主流IDE也提供相应重构工具。但以往研究表明,开发者常避免使用这些工具,或修改甚至反转IDE自动重构的结果,从而被迫手动重构,既繁琐又易错,说明重构支持未必完全符合实践需求。为理解开发者如何定制重构修改,本文分析了来自13个软件项目的1162次重构,涉及超过10万处程序修改。结果显示,开发者会反复在标准修改之外应用额外的修改模式,即定制化重构模式;例如在观察到的Move Method实例中,80.77%存在定制化重构。作者还考察了主流IDE重构工具的特性,发现多数定制化模式未被充分支持。对40名开发者的调查进一步确认了这些定制化模式的相关性,并表明IDE重构支持亟需改进。研究结论是重构指南应更新以反映典型定制化,IDE构建者也可据此支持更灵活的重构应用,例如在将异常代码抽取为新方法时允许开发者选择由哪个方法处理方法异常。

问题
研究问题是主流IDE对标准重构的支持是否与实践需求对齐,以及开发者在实际重构中会如何定制代码修改。
方法
对13个软件项目中1162次重构、超过10万处程序修改进行实证分析,识别定制化重构模式,考察主流IDE重构工具的支持情况,并问卷40名开发者。
评估
通过实证统计、IDE功能对比和开发者调查三重评估,发现多数定制化模式未被IDE完全支持,开发者确认其相关性并认同需要改进重构支持。
原文摘要(Abstract)

Refactoring is a common software maintenance practice. The literature defines standard code modifications for each refactoring type and popular IDEs provide refactoring tools aiming to support these standard modifications. However, previous studies indicated that developers either frequently avoid using these tools or end up modifying and even reversing the code automatically refactored by IDEs. Thus, developers are forced to manually apply refactorings, which is cumbersome and error-prone. This means that refactoring support may not be entirely aligned with practical needs. The improvement of tooling support for refactoring in practice requires understanding in what ways developers tailor refactoring modifications. To address this issue, we conduct an analysis of 1,162 refactorings composed of more than 100k program modifications from 13 software projects. The results reveal that developers recurrently apply patterns of additional modifications along with the standard ones, from here on called patterns of customized refactorings. For instance, we found customized refactorings in 80.77% of the Move Method instances observed in the software projects. We also investigated the features of refactoring tools in popular IDEs and observed that most of the customization patterns are not fully supported by them. Additionally, to understand the relevance of these customizations, we conducted a survey with 40 developers about the most frequent customization patterns we found. Developers confirm the relevance of customization patterns and agree that improvements in IDE's refactoring support are needed. These observations highlight that refactoring guidelines must be updated to reflect typical refactoring customizations. Also, IDE builders can use our results as a basis to enable a more flexible application of automated refactorings. For example, developers should be able to choose which method must handle exceptions when extracting an exception code into a new method.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{OliveiraAGBRGF23,
  title = {The untold story of code refactoring customizations in practice},
  author = {Daniel Oliveira and Wesley K. G. Assunção and Alessandro Garcia and Ana Carla Bibiano and Márcio Ribeiro and Rohit Gheyi and Baldoino Fonseca},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00021}
}