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.
翻译:重新定位是优化软件健康的非要素做法。 虽然有几项研究提出了通过应用设计模式和消除设计缺陷优化软件设计的最佳优化软件设计的重新设定战略, 但对于开发者如何实际重新设定其代码来改进软件再利用的情况却知之甚少。 因此,我们从1,828个开放源代码项目中提取了一套旨在改进软件再恢复功能的再设定要素。 我们分析了可恢复性再设定因素对最新再设定指标的影响,我们比较了再设定指标类型的分布情况和其余主流再设定要素的分布情况。 总体而言,我们发现,在可再恢复性背景下应用的再设定类型分布不同于主流开发中的再设定类型分布。在为改善可再恢复性而进行的再设定中,源文档受到更多设计级再设定类型的影响。 可再设定性再设定数据,高层次代码元素的分布情况,如软件包、类和当前主流再设定值的分布。 我们发现,在可再应用性背景下应用的再设定类型分布与再设定类型不同。 在典型的再定位参数中,包括典型的再定位参数中,提供了所有影响、当前再定位参数的典型再定位参数中的所有影响要素。