期刊文献+

Major motivations for extract method refactorings: analysis based on interviews and change histories

Major motivations for extract method refactorings: analysis based on interviews and change histories
原文传递
导出
摘要 Extract method is one of the most popular soft- ware refactorings. However, little work has been done to investigate or validate the major motivations for such refactorings. Digging into this issue might help researchers to improve tool support for extract method refactorings, e.g., proposing better tools to recommend refactoring opportunities, and to select fragments to be extracted. To this end, we conducted an interview with 25 developers, and our results suggest that current reuse, decomposition of long methods, clone resolution, and future reuse are the major motivations for extract method refactorings. We also validated the results by analyzing the refactoring history of seven open-source applications. Analysis results suggest that current reuse was the primary motivation for 56% of extract method refactorings, decomposition of methods was the primary motivation for 28% of extract method refactorings, and clone resolution was the primary motivation for 16% of extract method refactorings. These findings might suggest that recommending extract method opportunities by analyzing only the inner structure (e.g., complexity and length) of methods alone would miss many extract method opportunities. These findings also suggest that extract method refactorings are often driven by current and immediate reuse. Consequently, how to recognize or predict reuse requirements timely during software evolution may play a key role in the recommendation and automation of extract method refactorings. We also investigated the likelihood for the extracted methods to be reused in future, and our results suggest that such methods have a small chance (12%) to be reused in future unless the extracted fragment could be reused immediately in software evolution and extracting such a fragment can resolve existing clones at the same time. Extract method is one of the most popular soft- ware refactorings. However, little work has been done to investigate or validate the major motivations for such refactorings. Digging into this issue might help researchers to improve tool support for extract method refactorings, e.g., proposing better tools to recommend refactoring opportunities, and to select fragments to be extracted. To this end, we conducted an interview with 25 developers, and our results suggest that current reuse, decomposition of long methods, clone resolution, and future reuse are the major motivations for extract method refactorings. We also validated the results by analyzing the refactoring history of seven open-source applications. Analysis results suggest that current reuse was the primary motivation for 56% of extract method refactorings, decomposition of methods was the primary motivation for 28% of extract method refactorings, and clone resolution was the primary motivation for 16% of extract method refactorings. These findings might suggest that recommending extract method opportunities by analyzing only the inner structure (e.g., complexity and length) of methods alone would miss many extract method opportunities. These findings also suggest that extract method refactorings are often driven by current and immediate reuse. Consequently, how to recognize or predict reuse requirements timely during software evolution may play a key role in the recommendation and automation of extract method refactorings. We also investigated the likelihood for the extracted methods to be reused in future, and our results suggest that such methods have a small chance (12%) to be reused in future unless the extracted fragment could be reused immediately in software evolution and extracting such a fragment can resolve existing clones at the same time.
出处 《Frontiers of Computer Science》 SCIE EI CSCD 2016年第4期644-656,共13页 中国计算机科学前沿(英文版)
关键词 software refactoring extract method MOTIVATION data mining software quality software refactoring, extract method, motivation, data mining, software quality
  • 相关文献

参考文献44

  • 1Opdyke W F. Refactoring object-oriented trameworks. Dissertation for the Doctoral Degree. Champaign: University of Illinois at Urbana- Champaign, 1992.
  • 2Mens T, Tourwe T. A survey of software refactoring. IEEE Transac- tions on Software Engineering, 2004, 30(2): 126-139.
  • 3Murphy-Hill E, Parnin C, Black A P. How we refactor, and how we know it. IEEE Trransactions on Softeare Engineering, 2012, 38(1): 5- 18.
  • 4Xing Z, Stroulia E. Refactoring practice: how it is and how it should be supported -- an eclipse case study. In: Proceedings of IEEE Inter- national Conference on Software Maintemmce. 2006, 458-468.
  • 5Maruyama K. Automated method-extraction refactoring by using block-based slicing. ACM SIGSOFT Software Engineering Notes, 2001, 26(3): 31--40.
  • 6Sharma T. Identifying extract-method refactoring candidates automati- cally. In: Proceedings of the 5th Workshop on Refaetoring Tools. 2012, 50-53.
  • 7Tsantalis N, Chatzigeorgiou A. Identification of extract method refac- toring opportunities for the decomposition of methods. Journal of Sys- tems and Software, 2011, 84:1757-1782.
  • 8Silva D, Terra R, Valente M T. Recommending automated extract method refactorings. In: Proceedings of the 22nd International Con- ference on Program Comprehension. 2014, 146-156.
  • 9Palomba F, Bavota G, Di Penta M, Olivetc R, De Lucia A. Do they re- ally smell bad? a study on developers' perception of bad code smells. In: Proceedings of the 2014 IEEE International Conference on Soft- ware Maintenance and Evolution. 2014, 101-110.
  • 10Murphy-Hill E, Parnin C, Black A P. How we refactor, and how we know it. In: Proceedings of the 31st International Conference on Soft- ware Engineering. 2009, 287-297.

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部