一句话:提出并原型化实时重构环境,可识别、推荐并应用 Extract Method 重构,改善开发者重构体验。
手动重构代码往往复杂,已有重构工具虽能减轻负担,但多数只在后期提供反馈与建议,难以在编码过程中及时支持开发者。本文提出 Live Refactoring 概念,认为持续、即时地向代码建议重构候选有助于缓解该问题。作者原型实现了一个实时重构环境,能够识别、推荐并应用 Extract Method 重构。通过一项实证实验评估该方法对开发者重构过程和代码质量的影响,结果表明该环境帮助开发者获得更高质量代码,并改善了其重构体验。
Refactoring code manually can be complex. Several refactoring tools were developed to mitigate the effort needed to create more readable, adaptable, and maintainable code. However, most of them continue to provide late feedback, assistance, and support on how developers should improve their software. That’s where the concept of Live Refactoring comes in. We believe the immediate and continuous suggestion of refactoring candidates to the code will help reduce this problem. Therefore, we prototyped a Live Refactoring Environment that identifies, recommends, and applies Extract Method refactorings. We carried out an empirical experiment that showed us that our approach helped developers reach better code, with more quality, improving their refactoring experience.