Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3387904.3389264acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

How Does Incomplete Composite Refactoring Affect Internal Quality Attributes?

Published: 12 September 2020 Publication History
  • Get Citation Alerts
  • Abstract

    Program refactoring consists of code changes applied to improve the internal structure of a program and, as a consequence, its comprehensibility. Recent studies indicate that developers often perform composite refactorings, i.e., a set of two or more interrelated single refactorings. Recent studies also recommend certain patterns of composite refactorings to fully remove poor code structures, i.e, code smells, thus further improving the program comprehension. However, other recent studies report that composite refactorings often fail to fully remove code smells. Given their failure to achieve this purpose, these composite refactorings are considered incomplete, i.e, they are not able to entirely remove a smelly structure. Unfortunately, there is no study providing an in-depth analysis of the incompleteness nature of many composites and their possibly partial impact on improving, maybe decreasing, internal quality attributes. This paper identifies the most common forms of incomplete composites, and their effect on quality attributes, such as coupling and cohesion, which are known to have an impact on program comprehension. We analyzed 353 incomplete composite refactorings in 5 software projects, two common code smells (Feature Envy and God Class), and four internal quality attributes. Our results reveal that incomplete composite refactorings with at least one Extract Method are often (71%) applied without Move Methods on smelly classes. We have also found that most incomplete composite refactorings (58%) tended to at least maintain the internal structural quality of smelly classes, thereby not causing more harm to program comprehension. We also discuss the implications of our findings to the research and practice of composite refactoring.

    References

    [1]
    Eman AlOmar, Mohamed Mkaouer, Ali Ouni, and Marouane Kessentini. 2019. On the impact of refactoring on the relationship between quality attributes and design metrics. In 13th ESEM (2019). 1--11.
    [2]
    Mohammad Alshayeb. 2009. Empirical investigation of refactoring effect on software quality. IST (2009) 51, 9 (2009), 1319--1326.
    [3]
    Victor Basili and Dieter Rombach. 1988. The TAME project: Towards improvement-oriented software environments. TSE (1988) 14, 6 (1988), 758--773.
    [4]
    Gabriele Bavota, Andrea De Lucia, Massimiliano Di Penta, Rocco Oliveto, and Fabio Palomba. 2015. An experimental investigation on the innate relationship between quality and refactoring. JSS (2015) 107 (2015), 1--14.
    [5]
    Ana Carla Bibiano, Eduardo Fernandes, Daniel Oliveira, Alessandro Garcia, Marcos Kalinowski, Baldoino Fonseca, Roberto Oliveira, Anderson Oliveira, and Diego Cedrim. 2019. A quantitative study on characteristics and effect of batch refactoring on code smells. In 13th ESEM (2019). 1--11.
    [6]
    Aline Brito, Andre Hora, and Marco Tulio Valente. 2019. Refactoring graphs: Assessing refactoring over time. In 26th SANER (2019). 504--507.
    [7]
    Diego Cedrim, Alessandro Garcia, Melina Mongiovi, Rohit Gheyi, Leonardo Sousa, Rafael de Mello, Baldoino Fonseca, Márcio Ribeiro, and Alexander Chávez. 2017. Understanding the impact of refactoring on smells: A longitudinal study of 23 software projects. In 11th FSE (2017).
    [8]
    Alexander Chávez, Isabella Ferreira, Eduardo Fernandes, Diego Cedrim, and Alessandro Garcia. 2017. How does refactoring affect internal quality attributes? A multi-project study. In 31st SBES (2017). 74--83.
    [9]
    Mel Cinnéide and Paddy Nixon. 2000. Composite refactorings for Java programs. In 14th ECOOP (2000). 129--135.
    [10]
    Rafael Maiani de Mello, Anderson G. Uchôa, Roberto Felicio Oliveira, Willian Nalepa Oizumi, Jairo Souza, Kleyson Mendes, Daniel Oliveira, Baldoino Fonseca, and Alessandro Garcia. 2019. Do Research and Practice of Code Smell Identification Walk Together? A Social Representations Analysis. In ESEM (2019). IEEE, 1--6.
    [11]
    Bart Du Bois, Serge Demeyer, and Jan Verelst. 2004. Refactoring: Improving coupling and cohesion of existing code. In 11th WCRE (2004). 144--151.
    [12]
    Dubbo. 2019. Refactoring to remove duplicate methods and feature envy. (2019). Available at: https://github.com/apache/dubbo/pull/5506.
    [13]
    Dubbo. 2019. Refactoring to remove feature envy. (2019). Available at: https://github.com/apache/dubbo/pull/5559.
    [14]
    Dubbo. 2019. refactoring to remove feature envy. (2019). Available at: https://github.com/apache/dubbo/pull/5529.
    [15]
    Dubbo. 2019. Rewrite UTs. (2019). Available at: https://github.com/apache/dubbo/commit/66fbd320.
    [16]
    Eduardo Fernandes. 2019. Stuck in the middle: Removing obstacles to new program features through batch refactoring. In 41st ICSE: Doctoral Symposium (2019). 1--4.
    [17]
    Eduardo Fernandes, Johnatan Oliveira, Gustavo Vale, Thanis Paiva, and Eduardo Figueiredo. 2016. A review-based comparative study of bad smell detection tools. In 20th EASE (2016). 18:1-18:12.
    [18]
    Eduardo Fernandes, Anderson Uchôa, Ana Carla Bibiano, and Alessandro Garcia. 2019. On the alternatives for composing batch refactoring. In 3rd IWoR, co-located: 41st ICSE (2019). 1--4.
    [19]
    Eduardo Fernandes, Gustavo Vale, Leonardo Sousa, Eduardo Figueiredo, Alessandro Garcia, and Jaejoon Lee. 2017. No code anomaly is an island: Anomaly agglomeration as sign of product line instabilities. In 16th ICSR (2017). 48--64.
    [20]
    Francesca Fontana, Marco Mangiacavalli, Domenico Pochiero, and Marco Zanoni. 2015. On experimenting refactoring tools to remove code smells. In 16th XP, Scientific Workshops (2015). 1--7.
    [21]
    Martin Fowler. 1999. Refactoring: Improving the Design of Existing Code (1 ed.). Addison-Wesley Professional.
    [22]
    Everton T. Guimarães, Alessandro F. Garcia, and Yuanfang Cai. 2015. Architecture-sensitive heuristics for prioritizing critical code anomalies. In 14th International Conference on Modularity (2015), Robert B. France, Sudipto Ghosh, and Gary T. Leavens (Eds.). ACM, 68--80.
    [23]
    Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. 2014. An empirical study of refactoring: Challenges and benefits at Microsoft. TSE (2014) 40, 7 (2014), 633--649.
    [24]
    Yun Lin, Xin Peng, Yuanfang Cai, Danny Dig, Diwen Zheng, and Wenyun Zhao. 2016. Interactive and guided architectural refactoring with search-based recommendation. In FSE (2016). 535--546.
    [25]
    Tom Mens and Tom Tourwé. 2004. A survey of software refactoring. TSE (2004) 30, 2 (2004), 126--139.
    [26]
    Mohamed Wiem Mkaouer, Marouane Kessentini, Slim Bechikh, Kalyanmoy Deb, and Mel Ó Cinnéide. 2014. Recommendation system for software refactoring using innovization and interactive dynamic optimization. In 29th ASE (2014). 331--336.
    [27]
    Emerson Murphy-Hill, Chris Parnin, and Andrew Black. 2012. How we refactor, and how we know it. TSE (2012) 38, 1 (2012), 5--18.
    [28]
    Willian Oizumi, Alessandro Garcia, Leonardo Sousa, Bruno Cafeo, and Yixue Zhao. 2016. Code anomalies flock together: Exploring code anomaly agglomerations for locating design problems. In 38th ICSE (2016). 440--451.
    [29]
    Willian Nalepa Oizumi, Leonardo da Silva Sousa, Anderson Oliveira, Alessandro Garcia, O. I. Anne Benedicte Agbachi, Roberto Felicio Oliveira, and Carlos Lucena. 2018. On the identification of design problems in stinky code: experiences and tool support. J. Braz. Comp. Soc. (2018) 24, 1 (2018), 13:1-13:30.
    [30]
    Willian Nalepa Oizumi, Alessandro F. Garcia, Leonardo da Silva Sousa, Bruno Barbieri Pontes Cafeo, and Yixue Zhao. 2016. Code anomalies flock together: exploring code anomaly agglomerations for locating design problems. In 38th ICSE (2016), Laura K. Dillon, Willem Visser, and Laurie Williams (Eds.). ACM, 440--451.
    [31]
    Roberto Felicio Oliveira, Leonardo da Silva Sousa, Rafael Maiani de Mello, Natasha M. Costa Valentim, Adriana Lopes, Tayana Conte, Alessandro F. Garcia, Edson Cesar Cunha de Oliveira, and Carlos José Pereira de Lucena. 2017. Collaborative Identification of Code Smells: A Multi-Case Study. In 39th ICSE-SEIP (2017). IEEE Computer Society, 33--42.
    [32]
    Roberto Felicio Oliveira, Rafael Maiani de Mello, Eduardo Fernandes, Alessandro Garcia, and Carlos Lucena. 2020. Collaborative or individual identification of code smells? On the effectiveness of novice and professional developers. IST (2020) 120 (2020).
    [33]
    Matheus Paixão, Anderson Uchôa, Ana Carla Bibiano, Daniel Oliveira, Alessandro Garcia, Jens Krinke, and Emilio Arvonio. 2020. Behind the Intents: An In-depth Empirical Study on Software Refactoring in Modern Code Review. In 17th MSR (2020).
    [34]
    Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Fausto Fasano, Rocco Oliveto, and Andrea De Lucia. 2018. A large-scale empirical study on the lifecycle of code smell co-occurrences. IST (2018) 99 (2018), 1--10.
    [35]
    Fabio Palomba, Andy Zaidman, Rocco Oliveto, and Andrea De Lucia. 2017. An exploratory study on the relationship between changes and refactoring. In 25th ICPC (2017). IEEE, 176--185.
    [36]
    José Amancio M Santos, João B Rocha-Junior, Luciana Carla Lins Prates, Rogeres Santos do Nascimento, Mydiã Falcão Freitas, and Manoel Gomes de Mendonça. 2018. A systematic review on the code smell effect. JSS (2018) 144 (2018), 450--477.
    [37]
    Danilo Silva, Nikolaos Tsantalis, and Marco Tulio Valente. 2016. Why we refactor? Confessions of GitHub contributors. In 24th FSE (2016). 858--870.
    [38]
    Leonardo Sousa, Diego Cedrim, Alessandro Garcia, Willian Oizumi, Ana Carla Bibiano, Daniel Tenorio, Miryung Kim, and Anderson Oliveira. 2020. Characterizing and Identifying Composite Refactorings: Concepts, Heuristics and Patterns. In 17th MSR (2020).
    [39]
    Leonardo Sousa, Anderson Oliveira, Willian Oizumi, Simone Barbosa, Alessandro Garcia, Jaejoon Lee, Marcos Kalinowski, Rafael de Mello, Baldoino Fonseca, Roberto Oliveira, Carlos Lucena, and Rodrigo Paes. 2018. Identifying design problems in the source code: A Grounded Theory. In 40th ICSE (2018). 921--931.
    [40]
    Gábor Szőke, Csaba Nagy, Lajos Fülöp, Rudolf Ferenc, and Tibor Gyimóthy. 2015. FaultBuster: An automatic code smell refactoring toolset. In 15th SCAM (2015). 253--258.
    [41]
    Daniel Tenorio, Ana Carla Bibiano, and Alessandro Garcia. 2019. On the customization of batch refactoring. In 3rd IWoR, co-alocated ICSE (2019). IEEE Press, 13--16.
    [42]
    Nikolaos Tsantalis, Theodoros Chaikalis, and Alexander Chatzigeorgiou. 2018. Ten years of JDeodorant: Lessons learned from the hunt for smells. In P25th SANER (2018). 4--14.
    [43]
    Nikolaos Tsantalis, Matin Mansouri, Laleh Eshkevari, Davood Mazinanian, and Danny Dig. 2018. Accurate and efficient refactoring detection in commit history. In 40th ICSE (2018). 483--494.
    [44]
    Michele Tufano, Fabio Palomba, Gabriele Bavota, Rocco Oliveto, Massimiliano Di Penta, Andrea De Lucia, and Denys Poshyvanyk. 2017. When and why your code starts to smell bad (and whether the smells go away). TSE (2017) 43, 11 (2017), 1063--1088.
    [45]
    Santiago A. Vidal, Willian Nalepa Oizumi, Alessandro Garcia, J. Andres Diaz-Pace, and Claudia Marcos. 2019. Ranking architecturally critical agglomerations of code smells. Sci. Comput. Program. (2019) 182 (2019), 64--85.
    [46]
    Aiko Yamashita and Leon Moonen. 2013. Do developers care about code smells? An exploratory survey. In 20th WCRE (2013). 242--251.
    [47]
    Norihiro Yoshida, Tsubasa Saika, Eunjong Choi, Ali Ouni, and Katsuro Inoue. 2016. Revisiting the relationship between code smells and refactoring. In 24th ICPC (2016). 1--4.

    Cited By

    View all
    • (2023)On the impact of single and co-occurrent refactorings on quality attributes in android applicationsJournal of Systems and Software10.1016/j.jss.2023.111817205(111817)Online publication date: Nov-2023
    • (2023)Towards a catalog of composite refactoringsJournal of Software: Evolution and Process10.1002/smr.2530Online publication date: 22-Jan-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
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICPC '20: Proceedings of the 28th International Conference on Program Comprehension
    July 2020
    481 pages
    ISBN:9781450379588
    DOI:10.1145/3387904
    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: 12 September 2020

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Code refactoring
    2. code metric
    3. code smell
    4. composite refactoring
    5. incomplete composite
    6. internal quality attribute
    7. quantitative study

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Funding Sources

    • Conselho Nacional de Desenvolvimento Científico e Tecnológico
    • Fundação Carlos Chagas Filho de Amparo à Pesquisa do Estado do Rio de Janeiro
    • Coordenação de Aperfeiçoamento de Pessoal de Nível Superior

    Conference

    ICPC '20
    Sponsor:

    Upcoming Conference

    ICSE 2025

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)19
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 27 Jul 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)On the impact of single and co-occurrent refactorings on quality attributes in android applicationsJournal of Systems and Software10.1016/j.jss.2023.111817205(111817)Online publication date: Nov-2023
    • (2023)Towards a catalog of composite refactoringsJournal of Software: Evolution and Process10.1002/smr.2530Online publication date: 22-Jan-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)On the Influential Interactive Factors on Degrees of Design Decay: A Multi-Project Study2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER53432.2022.00093(753-764)Online publication date: Mar-2022
    • (2022)Toward Understanding the Impact of Refactoring on Program Comprehension2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER53432.2022.00090(731-742)Online publication date: Mar-2022
    • (2022)Completeness of Composite Refactorings for Smell Removal2022 IEEE/ACM 44th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)10.1109/ICSE-Companion55297.2022.9793758(264-268)Online publication date: May-2022
    • (2021)Look Ahead! Revealing Complete Composite Refactorings and their Smelliness Effects2021 IEEE International Conference on Software Maintenance and Evolution (ICSME)10.1109/ICSME52107.2021.00033(298-308)Online publication date: Sep-2021
    • (2021)Characterizing refactoring graphs in Java and JavaScript projectsEmpirical Software Engineering10.1007/s10664-021-10023-326:6Online publication date: 18-Sep-2021
    • (2020)Recommending Composite Refactorings for Smell RemovalProceedings of the XXXIV Brazilian Symposium on Software Engineering10.1145/3422392.3422423(72-81)Online publication date: 21-Oct-2020
    • (2020)Behind the IntentsProceedings of the 17th International Conference on Mining Software Repositories10.1145/3379597.3387475(125-136)Online publication date: 29-Jun-2020
    • 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