arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2111.07002cs.SE
收藏

面向重用的重构:一项实证研究

Refactoring for Reuse: An Empirical Study

Eman Abdullah AlOmar, Tianjia Wang, Vaibhavi Raut, Mohamed Wiem Mkaouer, Christian Newman, Ali Ouni

摘要:

重构是优化软件健康的实际实践。虽然一些研究提出了重构策略,通过应用设计模式和删除设计缺陷来优化软件设计,但很少有人知道开发人员实际上如何重构代码以提高其重用性。因此,我们从1,828个开源项目中提取了一组旨在提高软件可重用性的重构。我们分析了可重用性重构对最先进的可重用性度量的影响,并比较了可重用性重构类型的分布,以及其余主流重构的分布。总的来说,我们发现在可重用性的上下文中应用的重构类型的分布与主流开发中重构类型的分布不同。在为提高可重用性而执行的重构中,源文件受到更多设计级别类型的重构的影响。可重用性重构会显著影响高级代码元素,如包、类和方法,而典型的重构会影响所有代码元素,包括标识符和参数。这些发现提供了实际的见解,目前的重构实践中的代码重用的背景下,涉及重构的行为。

英文摘要:

Refactoring is the de-facto practice to optimize software health. While several studies propose refactoring strategies to optimize software design through applying design patterns and removing design defects, little is known about how developers actually refactor their code to improve its reuse. Therefore, we extract, from 1,828 open-source projects, a set of refactorings that were intended to improve the software reusability. We analyze the impact of reusability refactorings on the state-of-the-art reusability metrics, and we compare the distribution of reusability refactoring types, with the distribution of the remaining mainstream refactorings. Overall, we found that the distribution of refactoring types, applied in the context of reusability, is different from the distribution of refactoring types in mainstream development. In the refactorings performed to improve reusability, source files are subject to more design-level types of refactorings. Reusability refactorings significantly impact, high-level code elements, such as packages, classes, and methods, while typical refactorings, impact all code elements, including identifiers, and parameters. These findings provide practical insights into the current practice of refactoring in the context of code reuse involving the act of refactoring.

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

↑