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

我该如何重构它?Stack Overflow中重构趋势和主题的实证研究

How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow

Anthony Peruma, Steven Simmons, Eman Abdullah AlOmar, Christian D. Newman, Mohamed Wiem Mkaouer, Ali Ouni

摘要:

作为软件维护和演化的重要组成部分,重构由开发人员执行,无论技术或领域如何,以提高系统的内部质量,并减少其技术债务。然而,选择合适的重构策略并不总是那么简单,这导致开发人员寻求帮助。虽然重构的研究已经很成熟,有几项研究在检测重构机会和建议适当的代码更改之间进行了改变,但对它们在实践中的采用知之甚少。分析开发人员的认知对于更好地理解开发人员认为代码中存在的问题以及他们如何处理这些问题至关重要。此外,需要通过提取更适合开发人员实际情况的常见重构意图,来弥合研究重构与实际应用之间的差距。在这项研究中,我们通过一系列定量和定性的实验,分析重构讨论堆栈溢出。我们的研究结果表明,堆栈溢出是由一组不同的开发人员用于重构援助的各种技术。我们的观察显示了开发人员在重构时通常需要帮助的五个方面--代码优化、工具和IDE、体系结构和设计模式、单元测试和数据库。我们设想我们的研究结果更好地桥接重构的传统(或学术)方面与其现实世界的适用性之间的支持,包括更好的工具支持。

英文摘要:

An essential part of software maintenance and evolution, refactoring is performed by developers, regardless of technology or domain, to improve the internal quality of the system, and reduce its technical debt. However, choosing the appropriate refactoring strategy is not always straightforward, resulting in developers seeking assistance. Although research in refactoring is well-established, with several studies altering between the detection of refactoring opportunities and the recommendation of appropriate code changes, little is known about their adoption in practice. Analyzing the perception of developers is critical to understand better what developers consider to be problematic in their code and how they handle it. Additionally, there is a need for bridging the gap between refactoring, as research, and its adoption in practice, by extracting common refactoring intents that are more suitable for what developers face in reality. In this study, we analyze refactoring discussions on Stack Overflow through a series of quantitative and qualitative experiments. Our results show that Stack Overflow is utilized by a diverse set of developers for refactoring assistance for a variety of technologies. Our observations show five areas that developers typically require help with refactoring -- Code Optimization, Tools and IDEs, Architecture and Design Patterns, Unit Testing, and Database. We envision our findings better bridge the support between traditional (or academic) aspects of refactoring and their real-world applicability, including better tool support.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑