一句话:提出 LiveRef 实时重构环境,可实时识别、推荐并应用 Extract Method 重构,提升 Java 代码质量与开发体验。
重构软件既困难又耗时,已有重构工具虽能帮助开发者改善代码可读性与可维护性,但通常反馈周期长,影响重构体验。论文提出 Live Refactoring 概念及其原则:持续可视化重构候选并实时推荐,以及在应用重构后立即展示代码变化结果。作者实现 LiveRef,一个面向 Java 的实时重构环境,能够识别、建议并应用 Extract Method 重构。为评估该方法,作者开展了一项实证实验,初步结果表明该环境改善了多项代码质量指标,并得到参与者的接受、理解和使用。工具源码与演示视频已公开。
Refactoring software can be hard and time-consuming. Several refactoring tools assist developers in reaching more readable and maintainable code. However, most of them are characterized by long feedback loops that impoverish their refactoring experience. We believe that we can reduce this problem by focusing on the concept of Live Refactoring and its main principles: the live recommendation and continuous visualization of refactoring candidates, and the immediate visualization of results from applying a refactoring to the code. Therefore, we implemented a Live Refactoring Environment that identifies, suggests, and applies Extract Method refactorings. To evaluate our approach, we carried out an empirical experiment. Early results showed us that our refactoring environment improves several code quality aspects, being well received, understood, and used by the experiment participants. The source code of our tool is available on: https://github.com/saracouto1318/LiveRef. Its demonstration video can be found at: https://youtu.be/_jxx21ZiQ0o.