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

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

Using machine learning to guide the application of software refactorings: a preliminary exploration

Published: 09 November 2022 Publication History

Abstract

Refactorings constitute the most direct and comprehensible ap-proach for addressing software quality issues, stemming directly from identified code smells. Nevertheless, despite their popularity in both the research and industrial communities: (a) the effect of a refactoring is not guaranteed to be successful; and (b) the plethora of available refactoring opportunities does not allow their compre-hensive application. Thus, there is a need of guidance, on when to apply a refactoring opportunity, and when the development team shall postpone it. The notion of interest, forms one of the major pil-lars of the Technical Debt metaphor expressing the additional maintenance effort that will be required because of the accumulated debt. To assess the benefits of refactorings and guide when a refac-toring should take place, we first present the results of an empirical study assessing and quantifying the impact of various refactorings on Technical Debt Interest (building a real-world training set) and use machine learning approaches for guiding the application of fu-ture refactorings. To estimate interest, we rely on the FITTED framework, which for each object-oriented class assesses its dis-tance from the best-quality peer; whereas the refactorings that are applied throughout the history of a software project are extracted with the RefactoringMiner tool. The dataset of this study involves 4,166 refactorings applied across 26,058 revisions of 10 Apache projects. The results suggest that the majority of refactorings reduce Technical Debt interest; however, considering all refactoring appli-cations, it cannot be claimed that the mean impact differs from zero, confirming the results of previous studies highlighting mixed ef-fects from the application of refactorings. To alleviate this problem, we have built an adequately accurate (~70%) model for the predic-tion of whether or not a refactoring should take place, in order to reduce Technical Debt interest.

References

[1]
Mohammad Alshayeb. 2009. Empirical investigation of refactoring effect on software quality. Information and software technology, 51, 9 (2009), 1319–1326.
[2]
Areti Ampatzoglou, Alexandros Michailidis, Christos Sarikyriakidis, Apostolos Ampatzoglou, Alexander Chatzigeorgiou, and Paris Avgeriou. 2018. A framework for managing interest in technical debt: an industrial validation. In Proceedings of the 2018 International Conference on Technical Debt. 115–124.
[3]
Georgios Digkas, Mircea Lungu, Alexander Chatzigeorgiou, and Paris Avgeriou. 2017. The evolution of technical debt in the apache ecosystem. In European conference on software architecture. 51–66.
[4]
Bart Du Bois and Tom Mens. 2003. Describing the impact of refactoring on internal program quality. In International Workshop on Evolution of Large-scale Industrial Software Applications. 37–48.
[5]
Davide Falessi, Barbara Russo, and Kathleen Mullen. 2017. What if i had no smells? In 2017 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). 78–84.
[6]
Martin Host, Austen Rainer, Per Runeson, and Bjorn Regnell. 2012. Case Study Research in Software Engineering: Guidelines and Examples. John Wiley & Sons.
[7]
Yoshio Kataoka, Takeo Imai, Hiroki Andou, and Tetsuji Fukaya. 2002. A quantitative evaluation of maintainability enhancement by refactoring. In International Conference on Software Maintenance, 2002. Proceedings. 576–585.
[8]
Emerson Murphy-Hill, Chris Parnin, and Andrew P Black. 2011. How we refactor, and how we know it. IEEE Transactions on Software Engineering, 38, 1 (2011), 5–18.
[9]
Mehwish Riaz, Emilia Mendes, and Ewan Tempero. 2009. A systematic review of software maintainability prediction and metrics. In 2009 3rd international symposium on empirical software engineering and measurement. 367–377.
[10]
Konstantinos Stroggylos and Diomidis Spinellis. 2007. Refactoring–does it improve software quality? In Fifth International Workshop on Software Quality (WoSQ’07: ICSE Workshops 2007). 10–10.
[11]
Eleni Stroulia and Rohit Kapoor. 2001. Metrics of refactoring-based development: An experience report. In OOIS 2001. Springer, 113–122.
[12]
Nikolaos Tsantalis, Ameya Ketkar, and Danny Dig. 2020. RefactoringMiner 2.0. IEEE Transactions on Software Engineering.
[13]
Nikolaos Tsantalis, Matin Mansouri, Laleh M Eshkevari, Davood Mazinanian, and Danny Dig. 2018. Accurate and efficient refactoring detection in commit history. In Proceedings of the 40th international conference on software engineering. 483–494.
[14]
Angeliki-Agathi Tsintzira, Apostolos Ampatzoglou, Oliviu Matei, Areti Ampatzoglou, Alexander Chatzigeorgiou, and Robert Heb. 2019. Technical debt quantification through metrics: an industrial validation. In 15th China-Europe International Symposium on software engineering education.
[15]
Chikako Van Koten and AR Gray. 2006. An application of Bayesian network for predicting object-oriented software maintainability. Information and Software Technology, 48, 1 (2006), 59–67.
[16]
Dirk Wilking, Umar Farooq Kahn, and Stefan Kowalewski. 2007. An empirical evaluation of refactoring. e-Informatica Software Engineering Journal, 1, 1 (2007).

Cited By

View all
  • (2023)MaLTeSQuE 2022 Workshop SummaryACM SIGSOFT Software Engineering Notes10.1145/3573074.357309948:1(95-96)Online publication date: 17-Jan-2023
  • (2023)Exploring the Effect of Various Maintenance Activities on the Accumulation of TD Principal2023 ACM/IEEE International Conference on Technical Debt (TechDebt)10.1109/TechDebt59074.2023.00018(102-111)Online publication date: May-2023
  • (2023)A metrics-based approach for selecting among various refactoring candidatesEmpirical Software Engineering10.1007/s10664-023-10412-w29:1Online publication date: 16-Dec-2023

Index Terms

  1. Using machine learning to guide the application of software refactorings: a preliminary exploration

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      MaLTeSQuE 2022: Proceedings of the 6th International Workshop on Machine Learning Techniques for Software Quality Evaluation
      November 2022
      34 pages
      ISBN:9781450394567
      DOI:10.1145/3549034
      • General Chairs:
      • Maxime Cordy,
      • Xiaofei Xie,
      • Bowen Xu,
      • Bibi Stamatia
      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: 09 November 2022

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Interest
      2. Refactoring
      3. Software Quality
      4. Technical Debt

      Qualifiers

      • Research-article

      Funding Sources

      Conference

      MaLTeSQuE '22
      Sponsor:

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)34
      • Downloads (Last 6 weeks)2
      Reflects downloads up to 26 Nov 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)MaLTeSQuE 2022 Workshop SummaryACM SIGSOFT Software Engineering Notes10.1145/3573074.357309948:1(95-96)Online publication date: 17-Jan-2023
      • (2023)Exploring the Effect of Various Maintenance Activities on the Accumulation of TD Principal2023 ACM/IEEE International Conference on Technical Debt (TechDebt)10.1109/TechDebt59074.2023.00018(102-111)Online publication date: May-2023
      • (2023)A metrics-based approach for selecting among various refactoring candidatesEmpirical Software Engineering10.1007/s10664-023-10412-w29:1Online publication date: 16-Dec-2023

      View Options

      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