Complex software can be hard to read, adapt, and maintain. Refactoring it can create cleaner and self-explanatory code. Refactoring tools try to guide developers towards better code, with more quality. However, most of them take too long to provide feedback, support, and guidance on how developers should improve their software. To reduce this problem, we explored the concept of Live Refactoring, focusing on visually suggesting and applying refactorings, in real-time. With this in mind, we developed a Live Refactoring Environment that visually identifies, recommends, and applies Extract Method refactorings. To validate it, we conducted an empirical experiment. Early results showed that our approach improved several code quality metrics. Besides, we also concluded that our results were significantly different and better than the ones from refactoring the code manually without further help.
翻译:复杂软件可能难以阅读、适配及维护。对其进行重构可创建更清晰且自解释的代码。重构工具试图引导开发者编写更优质、更高质量的代码。然而,大多数工具在提供反馈、支持及指导开发者如何改进软件方面耗时过长。为缓解此问题,我们探索了"实时重构"概念,专注于以实时方式直观建议并应用重构。基于此,我们开发了一个实时重构环境,能够直观识别、推荐并应用提取方法重构。为验证该环境,我们开展了一项实证实验。初步结果表明,我们的方法改善了多项代码质量指标。此外,我们还得出结论:与未经额外辅助的手动代码重构结果相比,我们取得的结果具有显著差异且更优。