Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2950290.2950305acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Why we refactor? confessions of GitHub contributors

Published: 01 November 2016 Publication History

Abstract

Refactoring is a widespread practice that helps developers to improve the maintainability and readability of their code. However, there is a limited number of studies empirically investigating the actual motivations behind specific refactoring operations applied by developers. To fill this gap, we monitored Java projects hosted on GitHub to detect recently applied refactorings, and asked the developers to explain the reasons behind their decision to refactor the code. By applying thematic analysis on the collected responses, we compiled a catalogue of 44 distinct motivations for 12 well-known refactoring types. We found that refactoring activity is mainly driven by changes in the requirements and much less by code smells. Extract Method is the most versatile refactoring operation serving 11 different purposes. Finally, we found evidence that the IDE used by the developers affects the adoption of automated refactoring tools.

References

[1]
G. Bavota, A. De Lucia, A. Marcus, and R. Oliveto. Recommending refactoring operations in large software systems. In M. P. Robillard, W. Maalej, R. J. Walker, and T. Zimmermann, editors, Recommendation Systems in Software Engineering, pages 387–419. Springer Berlin Heidelberg, 2014.
[2]
G. Bavota, A. De Lucia, and R. Oliveto. Identifying Extract Class refactoring opportunities using structural and semantic cohesion measures. J. Syst. Softw., 84(3):397–414, Mar. 2011.
[3]
G. Bavota, R. Oliveto, M. Gethers, D. Poshyvanyk, and A. De Lucia. Methodbook: Recommending Move Method refactorings via relational topic models. IEEE Trans. Softw. Eng., 40(7):671–694, July 2014.
[4]
K. Beck. Extreme Programming Explained: Embrace Change. Addison-Wesley, 2000.
[5]
O. Chaparro, G. Bavota, A. Marcus, and M. Di Penta. On the impact of refactoring operations on code quality metrics. In Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, pages 456–460, 2014.
[6]
D. S. Cruzes and T. Dyba. Recommended steps for thematic synthesis in software engineering. In Proceedings of the 2011 International Symposium on Empirical Software Engineering and Measurement, pages 275–284, 2011.
[7]
M. Dias, A. Bacchelli, G. Gousios, D. Cassou, and S. Ducasse. Untangling fine-grained code changes. In Proceedings of the 22nd IEEE International Conference on Software Analysis, Evolution, and Reengineering, pages 341–350, 2015.
[8]
B. Dit, M. Revelle, M. Gethers, and D. Poshyvanyk. Feature location in source code: a taxonomy and survey. Journal of Software: Evolution and Process, 25(1):53–95, 2013.
[9]
B. Du Bois, S. Demeyer, and J. Verelst. Does the ”refactor to understand” reverse engineering pattern improve program comprehension? In Proceedings of the Ninth European Conference on Software Maintenance and Reengineering, pages 334–343, 2005.
[10]
M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, Boston, MA, USA, 1999.
[11]
J. L. Hintze and R. D. Nelson. Violin plots: A box plot-density trace synergism. The American Statistician, 52(2):181–184, 1998.
[12]
K. Hotta, Y. Higo, and S. Kusumoto. Identifying, tailoring, and suggesting Form Template Method refactoring opportunities with program dependence graph. In Proceedings of the 16th European Conference on Software Maintenance and Reengineering, pages 53–62, 2012.
[13]
D. Kawrykow and M. P. Robillard. Non-essential changes in version histories. In Proceedings of the 33rd International Conference on Software Engineering, pages 351–360, 2011.
[14]
M. Kim, D. Cai, and S. Kim. An empirical investigation into the role of api-level refactorings during software evolution. In Proceedings of the 33rd International Conference on Software Engineering, pages 151–160, 2011.
[15]
M. Kim, M. Gee, A. Loh, and N. Rachatasumrit. Ref-Finder: A refactoring reconstruction tool based on logic query templates. In Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 371–372, 2010.
[16]
M. Kim, T. Zimmermann, and N. Nagappan. A field study of refactoring challenges and benefits. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, pages 50:1–50:11, 2012.
[17]
M. Kim, T. Zimmermann, and N. Nagappan. An empirical study of refactoring challenges and benefits at Microsoft. IEEE Trans. Softw. Eng., 40(7), July 2014.
[18]
N. Meng, L. Hua, M. Kim, and K. S. McKinley. Does automated refactoring obviate systematic editing? In Proceedings of the 37th International Conference on Software Engineering, May 2015.
[19]
T. Mens and T. Tourwe. A survey of software refactoring. IEEE Trans. Softw. Eng., 30(2):126–139, 2004.
[20]
G. C. Murphy, M. Kersten, and L. Findlater. How are Java software developers using the Eclipse IDE? IEEE Software, 23(4):76–83, July 2006.
[21]
E. Murphy-Hill and A. P. Black. Breaking the barriers to successful refactoring: Observations and tools for Extract Method. In Proceedings of the 30th International Conference on Software Engineering, pages 421–430, 2008.
[22]
E. Murphy-Hill, T. Zimmermann, C. Bird, and N. Nagappan. The design space of bug fixes and how developers navigate it. IEEE Transactions on Software Engineering, 41(1):65–81, Jan 2015.
[23]
E. R. Murphy-Hill, C. Parnin, and A. P. Black. How we refactor, and how we know it. IEEE Trans. Softw. Eng., 38(1):5–18, 2012.
[24]
S. Negara, N. Chen, M. Vakilian, R. E. Johnson, and D. Dig. A comparative study of manual and automated refactorings. In Proceedings of the 27th European Conference on Object-Oriented Programming (ECOOP), pages 552–576, 2013.
[25]
S. Negara, M. Codoban, D. Dig, and R. E. Johnson. Mining fine-grained code changes to detect unknown change patterns. In Proceedings of the 36th International Conference on Software Engineering, pages 803–813, 2014.
[26]
W. F. Opdyke. Refactoring object-oriented frameworks. PhD thesis, University of Illinois at Urbana-Champaign, IL, USA, 1992.
[27]
K. Prete, N. Rachatasumrit, N. Sudan, and M. Kim. Template-based reconstruction of complex refactorings. In Proceedings of the 2010 IEEE International Conference on Software Maintenance, pages 1–10, 2010.
[28]
N. Rachatasumrit and M. Kim. An empirical investigation into the impact of refactoring on regression testing. In 28th IEEE International Conference on Software Maintenance, pages 357–366, 2012.
[29]
V. Sales, R. Terra, L. Miranda, and M. Valente. Recommending Move Method refactorings using dependency sets. In Proceedings of the 20th Working Conference on Reverse Engineering, pages 232–241, 2013.
[30]
D. Silva, R. Terra, and M. T. Valente. Recommending automated Extract Method refactorings. In Proceedings of the 22nd International Conference on Program Comprehension, pages 146–156, 2014.
[31]
J. Singer, S. E. Sim, and T. C. Lethbridge. Guide to Advanced Empirical Software Engineering, chapter Software Engineering Data Collection for Field Studies, pages 9–34. Springer London, London, 2008.
[32]
G. Soares, R. Gheyi, E. Murphy-Hill, and B. Johnson. Comparing approaches to analyze refactoring activity on software repositories. J. Syst. Softw., 86(4):1006–1022, Apr. 2013.
[33]
R. Tairas and J. Gray. Increasing clone maintenance support by unifying clone detection and refactoring activities. Inf. Softw. Technol., 54(12):1297–1307, Dec. 2012.
[34]
N. Tsantalis and A. Chatzigeorgiou. Identification of Move Method refactoring opportunities. IEEE Trans. Softw. Eng., 35(3):347–367, May 2009.
[35]
N. Tsantalis and A. Chatzigeorgiou. Identification of Extract Method refactoring opportunities for the decomposition of methods. J. Syst. Softw., 84(10):1757–1782, Oct. 2011.
[36]
N. Tsantalis, V. Guana, E. Stroulia, and A. Hindle. A multidimensional empirical study on refactoring activity. In Proceedings of the Conference of the Centre for Advanced Studies on Collaborative Research (CASCON), pages 132–146, 2013.
[37]
N. Tsantalis, D. Mazinanian, and G. P. Krishnan. Assessing the refactorability of software clones. IEEE Trans. Softw. Eng., 41(11):1055–1090, Nov 2015.
[38]
M. Vakilian, N. Chen, S. Negara, B. A. Rajkumar, B. P. Bailey, and R. E. Johnson. Use, disuse, and misuse of automated refactorings. In Proceedings of the 34th International Conference on Software Engineering, pages 233–243, 2012.
[39]
Y. Wang. What motivate software engineers to refactor source code? evidences from professional developers. In IEEE International Conference on Software Maintenance, pages 413–416, Sept 2009.
[40]
P. Weißgerber and S. Diehl. Are refactorings less error-prone than other changes? In Proceedings of the 2006 International Workshop on Mining Software Repositories, pages 112–118, 2006.
[41]
Z. Xing and E. Stroulia. UMLDiff: An algorithm for object-oriented design differencing. In Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering, pages 54–65, 2005.
[42]
Z. Xing and E. Stroulia. The JDEvAn tool suite in support of object-oriented evolutionary development. In Companion of the 30th International Conference on Software Engineering, pages 951–952, 2008.

Cited By

View all
  • (2024)A portal to catalog worked examples extracted from open source software projects to support the teaching of Software EngineeringJournal of Software Engineering Research and Development10.5753/jserd.2024.402712:1Online publication date: 19-Aug-2024
  • (2024)Graph Learning for Extract Class RefactoringProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3685561(1923-1925)Online publication date: 11-Sep-2024
  • (2024)HECS: A Hypergraph Learning-Based System for Detecting Extract Class Refactoring OpportunitiesProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3685307(1851-1855)Online publication date: 11-Sep-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
FSE 2016: Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering
November 2016
1156 pages
ISBN:9781450342186
DOI:10.1145/2950290
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 November 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. GitHub
  2. Refactoring
  3. code smells
  4. software evolution

Qualifiers

  • Research-article

Conference

FSE'16
Sponsor:

Acceptance Rates

Overall Acceptance Rate 17 of 128 submissions, 13%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)198
  • Downloads (Last 6 weeks)48
Reflects downloads up to 03 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)A portal to catalog worked examples extracted from open source software projects to support the teaching of Software EngineeringJournal of Software Engineering Research and Development10.5753/jserd.2024.402712:1Online publication date: 19-Aug-2024
  • (2024)Graph Learning for Extract Class RefactoringProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3685561(1923-1925)Online publication date: 11-Sep-2024
  • (2024)HECS: A Hypergraph Learning-Based System for Detecting Extract Class Refactoring OpportunitiesProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3685307(1851-1855)Online publication date: 11-Sep-2024
  • (2024)One-to-One or One-to-Many? Suggesting Extract Class Refactoring Opportunities with Intra-class Dependency Hypergraph Neural NetworkProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680379(1529-1540)Online publication date: 11-Sep-2024
  • (2024)How Do Software Developers Use ChatGPT? An Exploratory Study on GitHub Pull RequestsProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3645084(212-216)Online publication date: 15-Apr-2024
  • (2024)How to refactor this code? An exploratory study on developer-ChatGPT refactoring conversationsProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3645081(202-206)Online publication date: 15-Apr-2024
  • (2024)Automating Source Code Refactoring in the ClassroomProceedings of the 55th ACM Technical Symposium on Computer Science Education V. 110.1145/3626252.3630787(60-66)Online publication date: 7-Mar-2024
  • (2024)Behind the Intent of Extract Method Refactoring: A Systematic Literature ReviewIEEE Transactions on Software Engineering10.1109/TSE.2023.334580050:4(668-694)Online publication date: Apr-2024
  • (2024)Extending Refactoring Detection to Kotlin: A Dataset and Comparative Study2024 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER60148.2024.00034(267-271)Online publication date: 12-Mar-2024
  • (2024)7 Dimensions of software change patternsScientific Reports10.1038/s41598-024-54894-014:1Online publication date: 13-Mar-2024
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media