Characteristics of method extractions in Java: a large scale empirical study

被引:0
作者
Andre Hora
Romain Robbes
机构
[1] UFMG,Department of Computer Science
[2] Free University of Bozen-Bolzano,undefined
来源
Empirical Software Engineering | 2020年 / 25卷
关键词
Refactoring; Extract method; Software repository mining; Software evolution; Empirical software engineering;
D O I
暂无
中图分类号
学科分类号
摘要
Extract method is the “Swiss army knife” of refactorings: developers perform method extraction to introduce alternative signatures, decompose long code, improve testability, among many other reasons. Although the rationales behind method extraction are well explored, we are not yet aware of its characteristics. Assessing this information can provide the basis to better understand this important refactoring operation as well as improve refactoring tools and techniques based on the actual behavior of developers. In this paper, we assess characteristics of the extract method refactoring. We rely on a state-of-the-art technique to detect method extraction, and analyze over 70K instances of this refactoring, mined from 124 software systems. We investigate five aspects of this operation: magnitude, content, transformation, size, and degree. We find that (i) the extract method is among the most popular refactorings; (ii) extracted methods are over represented on operations related to creation, validation, and setup; (iii) methods that are targets of the extractions are 2.2x longer than the average, and they are reduced by one statement after the extraction; and (iv) single method extraction represents most, but not all, of the cases. We conclude by proposing improvements to refactoring detection, suggestion, and automation tools and techniques to support both practitioners and researchers.
引用
收藏
页码:1798 / 1833
页数:35
相关论文
共 37 条
  • [1] Ayewah N(2008)Using static analysis to find bugs IEEE Softw 25 22-29
  • [2] Pugh W(2018)How do developers react to API evolution? a large-scale empirical study Softw Qual J 26 161-191
  • [3] Hovemeyer D(2014)An empirical study of refactoring challenges and benefits at microsoft IEEE Trans Softw Eng 40 633-649
  • [4] Morgenthaler JD(2004)A survey of software refactoring IEEE Trans Softw Eng 30 126-139
  • [5] Penix J(2006)How are Java software developers using the Elipse IDE? IEEE Softw 23 76-83
  • [6] Hora A(2012)How we refactor, and how we know it IEEE Trans Softw Eng 38 5-18
  • [7] Robbes R(2015)The design space of bug fixes and how developers navigate it IEEE Trans Softw Eng 41 65-81
  • [8] Valente MT(2018)JMove: A novel heuristic and tool to detect move method refactoring opportunities J Sys Softw 138 19-36
  • [9] Anquetil N(2011)Identification of extract method refactoring opportunities for the decomposition of methods J Syst Softw 84 1757-1782
  • [10] Etien A(2019)A large-scale empirical exploration on refactoring activities in open source software projects Sci Comput Program 180 1-15