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

skip to main content
10.1145/2597008.2597141acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
Article

Recommending automated extract method refactorings

Published: 02 June 2014 Publication History

Abstract

Extract Method is a key refactoring for improving program comprehension. However, recent empirical research shows that refactoring tools designed to automate Extract Methods are often underused. To tackle this issue, we propose a novel approach to identify and rank Extract Method refactoring opportunities that are directly automated by IDE-based refactoring tools. Our approach aims to recommend new methods that hide structural dependencies that are rarely used by the remaining statements in the original method. We conducted an exploratory study to experiment and define the best strategies to compute the dependencies and the similarity measures used by the proposed approach. We also evaluated our approach in a sample of 81 extract method opportunities generated for JUnit and JHotDraw, achieving a precision of 48% (JUnit) and 38% (JHotDraw).

References

[1]
M. Fowler, Refactoring: Improving the design of existing code. Addison-Wesley, 1999.
[2]
W. Opdyke, “Refactoring object-oriented frameworks,” Ph.D. dissertation, University of Illinois at Urbana-Champaign, 1992.
[3]
S. Negara, N. Chen, M. Vakilian, R. E. Johnson, and D. Dig, “A comparative study of manual and automated refactorings,” in 27th European Conference on Object-Oriented Programming (ECOOP), 2013, pp. 552–576.
[4]
M. Kim, T. Zimmermann, and N. Nagappan, “A field study of refactoring challenges and benefits,” in 20th International Symposium on the Foundations of Software Engineering (FSE), 2012, pp. 50:1–50:11.
[5]
E. R. Murphy-Hill, C. Parnin, and A. P. Black, “How we refactor, and how we know it,” in 31st International Conference on Software Engineering (ICSE), 2009, pp. 287–297.
[6]
——, “How we refactor, and how we know it,” IEEE Transactions on Software Engineering, vol. 38, no. 1, pp. 5–18, 2012.
[7]
E. R. Murphy-Hill and A. P. Black, “Refactoring tools: Fitness for purpose,” IEEE Software, vol. 25, no. 5, pp. 38–44, 2008.
[8]
N. Tsantalis and A. Chatzigeorgiou, “Identification of extract method refactoring opportunities for the decomposition of methods,” Journal of Systems and Software, vol. 84, no. 10, pp. 1757–1782, 2011.
[9]
R. Terra, M. T. Valente, K. Czarnecki, and R. Bigonha, “Recommending refactorings to reverse software architecture erosion,” in 16th European Conference on Software Maintenance and Reengineering (CSMR), Early Research Achievements Track, 2012, pp. 335–340.
[10]
N. Tsantalis and A. Chatzigeorgiou, “Identification of move method refactoring opportunities,” IEEE Transactions on Software Engineering, vol. 99, pp. 347–367, 2009.
[11]
V. Sales, R. Terra, L. F. Miranda, and M. T. Valente, “Recommending move method refactorings using dependency sets,” in 20th Working Conference on Reverse Engineering (WCRE), 2013, pp. 232–241.
[12]
M. K. O’Keeffe and M. Ó. Cinnéide, “Search-based software maintenance,” in 10th European Conference on Software Maintenance and Reengineering (CSMR), 2006, pp. 249–260.
[13]
O. Seng, J. Stammel, and D. Burkhart, “Search-based determination of refactorings for improving the class structure of object-oriented systems,” in 8th Conference on Genetic and Evolutionary Computation (GECCO), 2006, pp. 1909–1916.
[14]
G. Bavota, R. Oliveto, M. Gethers, D. Poshyvanyk, and A. D. Lucia, “Methodbook: Recommending move method refactorings via relational topic models,” IEEE Transactions on Software Engineering, pp. 1–26, 2014.
[15]
R. Marinescu, “Detection strategies: Metrics-based rules for detecting design flaws,” in 20th International Conference on Software Maintenance (ICSM), 2004, pp. 350–359.
[16]
A. Abadi, R. Ettinger, and Y. A. Feldman, “Fine slicing for advanced method extraction,” in 3rd Workshop on Refactoring Tools (WRT), 2009, pp. 1–4.
[17]
D. Liang and M. Harrold, “Slicing objects using system dependence graphs,” in 14th International Conference on Software Maintenance (ICSM), 1998, pp. 358–367.
[18]
R. Ettinger, “Program sliding,” in 26th European Conference on Object-Oriented Programming (ECOOP), 2012, pp. 713–737.
[19]
E. R. Murphy-Hill and A. P. Black, “Breaking the barriers to successful refactoring: Observations and tools for extract method,” in 30th International Conference on Software Engineering (ICSE), 2008, pp. 421–430.
[20]
X. Ge, Q. L. DuBose, and E. R. Murphy-Hill, “Reconciling manual and automatic refactoring,” in 34th International Conference on Software Engineering (ICSE), 2012, pp. 211–221.
[21]
M. Robillard, R. Walker, and T. Zimmermann, “Recommendation systems for software engineering,” IEEE Software, vol. 27, no. 4, pp. 80–86, 2010.
[22]
Y. Ye and G. Fischer, “Reuse-conducive development environments,” Automated Software Engineering, vol. 12, pp. 199–235, 2005.
[23]
R. Holmes, R. Walker, and G. Murphy, “Approximate structural context matching: An approach to recommend relevant examples,” IEEE Transactions on Software Engineering, vol. 32, no. 12, pp. 952–970, 2006.
[24]
J. E. Montandon, H. Borges, D. Felix, and M. T. Valente, “Documenting APIs with examples: Lessons learned with the APIMiner platform,” in 20th Working Conference on Reverse Engineering (WCRE), Practice Track, 2013, pp. 401–408.
[25]
T. Zimmermann, A. Zeller, P. Weissgerber, and S. Diehl, “Mining version histories to guide software changes,” IEEE Transactions on Software Engineering, vol. 31, no. 6, pp. 429–445, 2005.
[26]
N. Nagappan, T. Ball, and A. Zeller, “Mining metrics to predict component failures,” in 28th International Conference on Software Engineering (ICSE), 2006, pp. 452–461.
[27]
R. Terra, M. T. Valente, K. Czarnecki, and R. Bigonha, “A recommendation system for repairing violations detected by static architecture conformance checking,” Software: Practice and Experience, pp. 1–28, 2014.
[28]
B. S. Everitt, S. Landau, M. Leese, and D. Stahl, Cluster Analysis, 5th ed. Wiley, 2011.
[29]
R. Terra, J. Brunet, L. F. Miranda, M. T. Valente, D. Serey, D. Castilho, and R. S. Bigonha, “Measuring the structural similarity between source code entities,” in 25th Conference on Software Engineering and Knowledge Engineering (SEKE), 2013, pp. 753–758.
[30]
R. Terra and M. T. Valente, “A dependency constraint language to manage object-oriented software architectures,” Software: Practice and Experience, vol. 32, no. 12, pp. 1073–1094, 2009.
[31]
N. Tsantalis, V. Guana, E. Stroulia, and A. Hindle, “A multidimensional empirical study on refactoring activity,” in 23rd Conference of the Centre for Advanced Studies on Collaborative Research (CASCON), 2013, pp. 132–146.

Cited By

View all
  • (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: 4-Jan-2024
  • (2023)The Untold Story of Code Refactoring Customizations in PracticeProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00021(108-120)Online publication date: 14-May-2023
  • (2023)REMS: Recommending Extract Method Refactoring Opportunities via Multi-view Representation of Code Property Graph2023 IEEE/ACM 31st International Conference on Program Comprehension (ICPC)10.1109/ICPC58990.2023.00034(191-202)Online publication date: May-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC 2014: Proceedings of the 22nd International Conference on Program Comprehension
June 2014
325 pages
ISBN:9781450328791
DOI:10.1145/2597008
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

In-Cooperation

  • TCSE: IEEE Computer Society's Tech. Council on Software Engin.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 June 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Extract Method
  2. Program comprehension supporting tools
  3. Refactoring
  4. Self-documenting methods

Qualifiers

  • Article

Conference

ICSE '14
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)37
  • Downloads (Last 6 weeks)3
Reflects downloads up to 01 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (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: 4-Jan-2024
  • (2023)The Untold Story of Code Refactoring Customizations in PracticeProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00021(108-120)Online publication date: 14-May-2023
  • (2023)REMS: Recommending Extract Method Refactoring Opportunities via Multi-view Representation of Code Property Graph2023 IEEE/ACM 31st International Conference on Program Comprehension (ICPC)10.1109/ICPC58990.2023.00034(191-202)Online publication date: May-2023
  • (2023)Just-in-time code duplicates extractionInformation and Software Technology10.1016/j.infsof.2023.107169158(107169)Online publication date: Jun-2023
  • (2023)Supporting single responsibility through automated extract method refactoringEmpirical Software Engineering10.1007/s10664-023-10427-329:1Online publication date: 22-Dec-2023
  • (2023)MIRROR: multi-objective refactoring recommendation via correlation analysisAutomated Software Engineering10.1007/s10515-023-00400-131:1Online publication date: 21-Oct-2023
  • (2022)A Technique to Test Refactoring Detection ToolsProceedings of the XXXVI Brazilian Symposium on Software Engineering10.1145/3555228.3555246(188-197)Online publication date: 5-Oct-2022
  • (2022)Identifying Extract Method RefactoringsProceedings of the 15th Innovations in Software Engineering Conference10.1145/3511430.3511435(1-11)Online publication date: 24-Feb-2022
  • (2022)An automated extract method refactoring approach to correct the long method code smellJournal of Systems and Software10.1016/j.jss.2022.111221187:COnline publication date: 12-May-2022
  • (2022)Anti‐bloater class restructuringJournal of Software: Evolution and Process10.1002/smr.243134:3Online publication date: 1-Mar-2022
  • 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