This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
How We Refactor, and How We Know It
January/February 2012 (vol. 38 no. 1)
pp. 5-18
Emerson Murphy-Hill, North Carolina State University, Raleigh
Chris Parnin, Georgia Institute of Technology, Atlanta
Andrew P. Black, Portland State University, Portland
Refactoring is widely practiced by developers, and considerable research and development effort has been invested in refactoring tools. However, little has been reported about the adoption of refactoring tools, and many assumptions about refactoring practice have little empirical support. In this paper, we examine refactoring tool usage and evaluate some of the assumptions made by other researchers. To measure tool usage, we randomly sampled code changes from four Eclipse and eight Mylyn developers and ascertained, for each refactoring, if it was performed manually or with tool support. We found that refactoring tools are seldom used: 11 percent by Eclipse developers and 9 percent by Mylyn developers. To understand refactoring practice at large, we drew from a variety of data sets spanning more than 39,000 developers, 240,000 tool-assisted refactorings, 2,500 developer hours, and 12,000 version control commits. Using these data, we cast doubt on several previously stated assumptions about how programmers refactor, while validating others. Finally, we interviewed the Eclipse and Mylyn developers to help us understand why they did not use refactoring tools and to gather ideas for future research.

[1] F. Bourqun and R.K. Keller, "High-Impact Refactoring Based on Architecture Violations," Proc. 11th European Conf. Software Maintenance and Reeng., pp. 149-158, 2007.
[2] S. Counsell, Y. Hassoun, R. Johnson, K. Mannock, and E. Mendes, "Trends in Java Code Changes: The Key to Identification of Refactorings?" Proc. Second Int'l Conf. Principles and Practice of Programming in Java , pp. 45-48, 2003.
[3] S. Counsell, Y. Hassoun, G. Loizou, and R. Najjar, "Common Refactorings, a Dependency Graph and Some Code Smells: An Empirical Study of Java OSS," Proc. ACM/IEEE Int'l Symp. Empirical Software Eng., pp. 288-296, 2006.
[4] D. Dig, C. Comertoglu, D. Marinov, and R. Johnson, "Automated Detection of Refactorings in Evolving Components," Proc. 20th European Conf. Object-Oriented Programming, pp. 404-428, 2006.
[5] M. Fowler, Refactoring: Improving the Design of Existing Code. Addison-Wesley Longman Publishing Co., Inc., 1999.
[6] A. Hindle, D.M. German, and R. Holt, "What Do Large Commits Tell Us?: A Taxonomical Study of Large Commits," Proc. 2008 Int'l Workshop Mining Software Repositories, pp. 99-108, 2008.
[7] G.C. Murphy, M. Kersten, and L. Findlater, "How Are Java Software Developers Using the Eclipse IDE?" IEEE Software, vol. 23, no. 4, pp. 76-83, July/Aug. 2006.
[8] E. Murphy-Hill and A.P. Black, "High Velocity Refactorings in Eclipse," Proc. OOPSLA Workshop Eclipse Technology Exchange, 2007.
[9] E. Murphy-Hill and A.P. Black, "Breaking the Barriers to Successful Refactoring: Observations and Tools for Extract Method," Proc. 30th Int'l Conf. Software Eng., pp. 421-430, 2008.
[10] E. Murphy-Hill and A.P. Black, "Refactoring Tools: Fitness for Purpose," IEEE Software, vol. 25, no. 5, pp. 38-44, Sept./Oct. 2008.
[11] E. Murphy-Hill, C. Parnin, and A.P. Black, "How We Refactor, and How We Know It," Proc. 31st Int'l Conf. Software Eng., 2009.
[12] W.F. Opdyke and R.E. Johnson, "Refactoring: An Aid in Designing Application Frameworks and Evolving Object-oriented Systems," Proc. Symp. Object-Oriented Programming Emphasizing Practical Applications, Sept. 1990.
[13] M. Pizka, "Straightening Spaghetti-Code with Refactoring?" Software Eng. Research and Practice, H.R. Arabnia and H. Reza, eds., pp. 846-852, CSREA Press, 2004.
[14] J. Ratzinger, "sPACE: Software Project Assessment in the Course of Evolution," PhD thesis, Vienna Univ. of Technology, Austria, 2007.
[15] J. Ratzinger, T. Sigmund, and H.C. Gall, "On the Relation of Refactorings and Software Defect Prediction," Proc. Int'l Working Conf. Mining Software Repositories, pp. 35-38, 2008.
[16] R. Robbes, "Mining a Change-Based Software Repository," Proc. Fourth Int'l Workshop Mining Software Repositories, pp. 15-23, 2007.
[17] K. Stroggylos and D. Spinellis, "Refactoring-Does It Improve Software Quality?" Proc. Fifth Int'l Workshop Software Quality, pp. 10-16, 2007.
[18] The Eclipse Foundation. Usage Data Collector Results, Website, http://www.eclipse.org/org/usagedata/reports/ data commands.csv, Feb. 2009.
[19] M.A. Toleman and J. Welsh, "Systematic Evaluation of Design Choices for Software Development Tools," Software—Concepts and Tools, vol. 19, no. 3, pp. 109-121, 1998.
[20] P. Weißgerber and S. Diehl, "Are Refactorings Less Error-Prone than Other Changes?" Proc. Int'l Workshop Mining Software Repositories, pp. 112-118, 2006.
[21] Z. Xing and E. Stroulia, "Refactoring Practice: How It Is and How It Should be Supported—An Eclipse Case Study," Proc. 22nd IEEE Int'l Conf. Software Maintenance, pp. 458-468, 2006.
[22] T. Zimmermann and P. Weißgerber, "Preprocessing CVS Data for Fine-Grained Analysis," Proc. Int'l Workshop Mining Software Repositories, pp. 2-6, 2004.

Index Terms:
Refactoring, refactoring tools, floss refactoring, root-canal refactoring.
Citation:
Emerson Murphy-Hill, Chris Parnin, Andrew P. Black, "How We Refactor, and How We Know It," IEEE Transactions on Software Engineering, vol. 38, no. 1, pp. 5-18, Jan.-Feb. 2012, doi:10.1109/TSE.2011.41
Usage of this product signifies your acceptance of the Terms of Use.