skip to main content
10.1145/3511430.3511435acmotherconferencesArticle/Chapter ViewAbstractPublication PagesisecConference Proceedingsconference-collections
research-article

Identifying Extract Method Refactorings

Published:24 February 2022Publication History

ABSTRACT

Extract method refactoring identifies and extracts a set of statements implementing a specific functionality within a method. Its application enhances the structure of code and provides improved readability and reusability. This paper introduces Segmentation, a new approach for identifying extract method opportunities focusing on achieving higher performance with fewer suggestions. Evaluation of the approach includes six case studies from the open-source domain, and performance is compared against two state-of-the-art approaches. The findings suggest that Segmentation provides improved precision and F measure over both the approaches. Further, improved performance is reflected over long methods too.

References

  1. Aharon Abadi, Ran Ettinger, and Yishai A Feldman. 2012. Fine Slicing. In Fundamental Approaches to Software Engineering. Springer, 471–485.Google ScholarGoogle Scholar
  2. Hiralal Agrawal, Richard A DeMillo, and Eugene H Spafford. 1993. Debugging with dynamic slicing and backtracking. Software: Practice and Experience 23, 6 (1993), 589–616.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Abdulaziz Alkhalid, Mohammad Alshayeb, and Sabri Mahmoud. 2010. Software refactoring at the function level using new Adaptive K-Nearest Neighbor algorithm. Advances in Engineering Software 41, 10 (2010), 1160–1178.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Amol Bhangdiya, Bikash Chandra, Biplab Kar, Bharath Radhakrishnan, KV Maheshwara Reddy, Shetal Shah, and S Sudarshan. 2015. The XDa-TA system for automated grading of SQL query assignments. In Data Engineering (ICDE), 2015 IEEE 31st International Conference on. IEEE, 1468–1471.Google ScholarGoogle ScholarCross RefCross Ref
  5. Sofia Charalampidou, Apostolos Ampatzoglou, Alexander Chatzigeorgiou, Antonios Gkortzis, and Paris Avgeriou. 2017. Identifying Extract Method Refactoring Opportunities based on Functional Relevance. IEEE Trans. Software Eng. 43, 10 (2017), 954–974.Google ScholarGoogle ScholarCross RefCross Ref
  6. Martin Fowler. 2009. Refactoring: improving the design of existing code. Pearson Education India.Google ScholarGoogle Scholar
  7. Jonathan L Gross, Jay Yellen, and Mark Anderson. 2018. Graph theory and its applications. Chapman and Hall/CRC.Google ScholarGoogle Scholar
  8. Hyeon Soo Kim, Yong Rae Kwon, and In Sang Chung. 1994. Restructuring programs through program slicing. International Journal of Software Engineering and Knowledge Engineering 4, 03(1994), 349–368.Google ScholarGoogle ScholarCross RefCross Ref
  9. Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. 2012. A field study of refactoring challenges and benefits. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering. ACM, 50.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Raghavan Komondoor and Susan Horwitz. 2000. Semantics-preserving procedure extraction. In Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. 155–169.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Raghavan Komondoor and Susan Horwitz. 2003. Effective, automatic procedure extraction. In 11th IEEE International Workshop on Program Comprehension, 2003. IEEE, 33–42.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Bogdan Korel and Juergen Rilling. 1998. Program slicing in understanding of large programs. In Program Comprehension, 1998. IWPC’98. Proceedings., 6th International Workshop on. IEEE, 145–152.Google ScholarGoogle ScholarCross RefCross Ref
  13. Arun Lakhotia and Jean-Christophe Deprez. 1998. Restructuring programs by tucking statements into functions. Information and Software Technology 40, 11 (1998), 677–689.Google ScholarGoogle ScholarCross RefCross Ref
  14. Martin Lippert and Stephen Roock. 2006. Refactoring in Large Software Projects.Google ScholarGoogle Scholar
  15. Chung-Horng Lung and Marzia Zaman. 2004. Using Clustering Technique to Restructure Programs.. In Software Engineering Research and Practice. 853–860.Google ScholarGoogle Scholar
  16. Katsuhisa Maruyama. 2001. Automated method-extraction refactoring by using block-based slicing. In Proceedings of the 2001 symposium on Software reusability: putting software reuse in context. 31–40.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Emerson R. Murphy-Hill, Chris Parnin, and Andrew P. Black. 2012. How We Refactor, and How We Know It. IEEE Trans. Software Eng. 38, 1 (2012), 5–18. https://doi.org/10.1109/TSE.2011.41Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Danilo Silva, Ricardo Terra, and Marco Tulio Valente. 2014. Recommending automated extract method refactorings. In Proceedings of the 22nd International Conference on Program Comprehension. ACM, 146–156.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Danilo Silva, Nikolaos Tsantalis, and Marco Tulio Valente. 2016. Why we refactor? confessions of github contributors. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 858–870.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Omkarendra Tiwari and Rushikesh K Joshi. 2020. Functionality Based Code Smell Detection and Severity Classification. In Proceedings of the 13th Innovations in Software Engineering Conference on Formerly known as India Software Engineering Conference. 1–5.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Nikolaos Tsantalis and Alexander Chatzigeorgiou. 2011. Identification of extract method refactoring opportunities for the decomposition of methods. Journal of Systems and Software 84, 10 (2011), 1757–1782.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Carmine Vassallo, Giovanni Grano, Fabio Palomba, Harald C Gall, and Alberto Bacchelli. 2019. A large-scale empirical exploration on refactoring activities in open source software projects. Science of Computer Programming 180 (2019), 1–15.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mark Weiser. 1981. Program slicing. In Proceedings of the 5th international conference on Software engineering. IEEE Press, 439–449.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Baowen Xu, Zhenqiang Chen, and Hongji Yang. 2002. Dynamic slicing object-oriented programs for debugging. In Source Code Analysis and Manipulation, 2002. Proceedings. Second IEEE International Workshop on. IEEE, 115–122.Google ScholarGoogle Scholar
  25. Xia Xu, Chung-Horng Lung, Marzia Zaman, and Anand Srinivasan. 2004. Program restructuring through clustering techniques. In Source Code Analysis and Manipulation, 2004. Fourth IEEE International Workshop on. IEEE, 75–84.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Limei Yang, Hui Liu, and Zhendong Niu. 2009. Identifying fragments to be extracted from long methods. In Software Engineering Conference, 2009. APSEC’09. Asia-Pacific. IEEE, 43–49.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Identifying Extract Method Refactorings
        Index terms have been assigned to the content through auto-classification.

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Other conferences
          ISEC '22: Proceedings of the 15th Innovations in Software Engineering Conference
          February 2022
          235 pages
          ISBN:9781450396189
          DOI:10.1145/3511430

          Copyright © 2022 ACM

          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]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 24 February 2022

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed limited

          Acceptance Rates

          Overall Acceptance Rate76of315submissions,24%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format .

        View HTML Format