Catalogs of refactoring have key importance in software maintenance and evolution, since developers rely on such documents to understand and perform refactoring operations. Furthermore, these catalogs constitute a reference guide for communication between practitioners since they standardize a common refactoring vocabulary. Fowler's book describes the most popular catalog of refactorings, which documents single and well-known refactoring operations. However, sometimes refactorings are composite transformations, i.e., a sequence of refactorings is performed over a given program element. For example, a sequence of Extract Method operations (a single refactoring) can be performed over the same method, in one or in multiple commits, to simplify its implementation, therefore, leading to a Method Decomposition operation (a composite refactoring). In this paper, we propose and document a catalog with eight composite refactorings. We also implement a set of scripts to mine composite refactorings by preprocessing the results of refactoring detection tools. Using such scripts, we search for composites in a representative refactoring oracle with hundreds of confirmed single refactoring operations. Next, to complement this first study, we also search for composites in the full history of ten well-known open-source projects. We characterize the detected composite refactorings, under dimensions such as size and location. We conclude by addressing the applications and implications of the proposed catalog.
翻译:重新构件的目录在软件维护和演进方面具有关键重要性,因为开发者依靠这类文件来理解和进行重新构件操作。此外,这些目录是执业者之间交流的参考指南,因为这些目录使共同的重新构件词汇标准化。福勒的书描述了最受欢迎的再构件目录,这些目录记录了单一和众所周知的重新构件操作。然而,有时再构件是合成转换,即对某一程序要素进行一系列的重新构件。例如,在一种或多种承诺中,可以用同一方法进行一系列的“提取方法”操作(一个单一的重新构件),以简化其实施,从而导致一种最受欢迎的重新构件目录(一个复合重新构件)。在本文中,我们提出并记录一个包含八种复合再构件的目录。我们还通过预先处理再构件检测工具的结果,对地雷的公开合成再构件进行一系列脚本。例如,使用这种脚本,我们用这种脚本来在具有代表性的复合结构图状中搜索,然后在有数百个具有代表性的图像的图像中进行搜索。