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

Behind the Intents: An In-depth Empirical Study on Software Refactoring in Modern Code Review

Published: 18 September 2020 Publication History

Abstract

Code refactorings are of pivotal importance in modern code review. Developers may preserve, revisit, add or undo refactorings through changes' revisions. Their goal is to certify that the driving intent of a code change is properly achieved. Developers' intents behind refactorings may vary from pure structural improvement to facilitating feature additions and bug fixes. However, there is little understanding of the refactoring practices performed by developers during the code review process. It is also unclear whether the developers' intents influence the selection, composition, and evolution of refactorings during the review of a code change. Through mining 1,780 reviewed code changes from 6 systems pertaining to two large open-source communities, we report the first in-depth empirical study on software refactoring during code review. We inspected and classified the developers' intents behind each code change into 7 distinct categories. By analyzing data generated during the complete reviewing process, we observe: (i) how refactorings are selected, composed and evolved throughout each code change, and (ii) how developers' intents are related to these decisions. For instance, our analysis shows developers regularly apply non-trivial sequences of refactorings that crosscut multiple code elements (i.e., widely scattered in the program) to support a single feature addition. Moreover, we observed that new developers' intents commonly emerge during the code review process, influencing how developers select and compose their refactorings to achieve the new and adapted goals. Finally, we provide an enriched dataset that allows researchers to investigate the context and motivations behind refactoring operations during the code review process.

References

[1]
Everton LG Alves, Myoungkyu Song, and Miryung Kim. 2014. RefDistiller: a refactoring aware code review tool for inspecting manual refactoring edits. In 22nd FSE. 751--754.
[2]
Alberto Bacchelli and Christian Bird. 2013. Expectations, outcomes, and challenges of modern code review. In 35th ICSE. 712--721.
[3]
Gabriele Bavota, Bernardino De Carluccio, Andrea De Lucia, Massimiliano Di Penta, Rocco Oliveto, and Orazio Strollo. 2012. When does a refactoring induce bugs? an empirical study. In 12th SCAM. 104--113.
[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. J. Syst. Softw. (JSS) 107 (2015), 1--14.
[5]
Moritz Beller, Alberto Bacchelli, Andy Zaidman, and Elmar Juergens. 2014. Modern code reviews in open-source projects: Which problems do they fix?. In 11th MSR. 202--211.
[6]
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. 1--11.
[7]
Ana Carla Bibiano, Vinicius Soares, Daniel Coutinho, Eduardo Fernandes, João Correia, Kleber Santos, Anderson Oliveira, Alessandro Garcia, Rohit Gheyi, Baldoino Fonseca, Márcio Ribeiro, Caio Barbosa, and Daniel Oliveira. 2020. How Does Incomplete Composite Refactoring Affect Internal Quality Attributes?. In 28th IEEE/ACM International Conference on Program Comprehension (ICPC).
[8]
Aline Brito, Andre Hora, and Marco Tulio Valente. 2019. Refactoring Graphs: Assessing Refactoring over Time. In 26nd SANER. 504--507.
[9]
Diego Cedrim, Leonardo da Silva Sousa, Alessandro F. Garcia, and Rohit Gheyi. 2016. Does refactoring improve software structural quality? A longitudinal study of 25 projects. In Proceedings of the 30th Brazilian Symposium on Software Engineering, SBES 2016, Maringá, Brazil, September 19-23, 2016, Eduardo Santana de Almeida (Ed.). ACM, 73--82.
[10]
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. 465--475.
[11]
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 Proceedings of the 31st Brazilian Symposium on Software Engineering, SBES 2017, Fortaleza, CE, Brazil, September 20-22, 2017, José Carlos Maldonado, Fabiano Cutigi Ferrari, Uirá Kulesza, and Tayana Uchôa Conte (Eds.). ACM, 74--83.
[12]
Couchbase. 2020. Review 58223 from the couchbase-java-client system. (2020). Available at: http://review.couchbase.org/#/c/58223/.
[13]
Daniel Alencar Da Costa, Shane McIntosh, Weiyi Shang, Uirá Kulesza, Roberta Coelho, and Ahmed E Hassan. 2016. A framework for evaluating the results of the szz approach for identifying bug-introducing changes. IEEE Trans. Softw. Eng. (TSE) 43, 7 (2016), 641--657.
[14]
Leonardo da Silva Sousa, Willian Oizumi, Anderson Oliveira, Alessandro Garcia, Diego Cedrim, and Carlos Lucena. 2020. When Are Smells Indicators of Architectural Refactoring Opportunities? A Study of 50 Software Projects. In Proceedings of the 28th IEEE International Conference on Program Comprehension (ICPC 2020), co-located with ICSE 2020, Seoul, South Korea, October 2020. ACM, 1--12.
[15]
Eclipse. 2019. Example of review 99067 from the jgit software project. (2019). Available at: https://git.eclipse.org/r/#/c/99067/.
[16]
Eduardo Fernandes, Anderson Uchôa, Ana Carla Bibiano, and Alessandro Garcia. 2019. On the alternatives for composing batch refactoring. In 3rd IWOR. 9--12.
[17]
Isabella Ferreira, Eduardo Fernandes, Diego Cedrim, Anderson Uchôa, Ana Carla Bibiano, Alessandro Garcia, João Lucas Correia, Filipe Santos, Gabriel Nunes, Caio Barbosa, and others. 2018. The buggy side of code refactoring: Understanding the relationship between refactorings and bugs. In 40th ICSE: Poster Track. 406--407.
[18]
Martin Fowler, Kent Beck, John Brant, and Opdykem Willian. 1999. Refactoring: Improving the Design of Existing Code. 431 pages.
[19]
Xi Ge, Saurabh Sarkar, Jim Witschey, and Emerson Murphy-Hill. 2017. Refactoring-aware code review. In VL/HCC. 71--79.
[20]
Gerrit. 2006. Gerrit Code Review Platform. https://www.gerritcodereview.com. (2006). Accessed in: July 2019.
[21]
Mark Harman and Laurence Tratt. 2007. Pareto optimal search based refactoring at the design level. In 9th GECCO. 1106--1113.
[22]
Kim Herzig and Andreas Zeller. 2013. The impact of tangled code changes. In 10th MSR. 121--130.
[23]
Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. 2014. An empirical study of refactoring: Challenges and benefits at Microsoft. IEEE Trans. Softw. Eng. (TSE) 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 24th FSE. 535--546.
[25]
Jabier Martinez, Tewfik Ziadi, Tegawendé F Bissyandé, Jacques Klein, and Yves Le Traon. 2016. Name suggestions during feature identification: the variclouds approach. In 20th SPLC. 119--123.
[26]
Panita Meananeatra. 2012. Identifying refactoring sequences for improving software maintainability. In 27th ASE. 406--409.
[27]
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. 331--336.
[28]
Rodrigo Morales, Aminata Sabane, Pooya Musavi, Foutse Khomh, Francisco Chicano, and Giuliano Antoniol. 2016. Finding the best compromise between design quality and testing effort during refactoring. In 23rd SANER, Vol. 1. 24--35.
[29]
Emerson Murphy-Hill, Chris Parnin, and Andrew P Black. 2012. How we refactor, and how we know it. IEEE Trans. Softw. Eng. (TSE) 38, 1 (2012), 5--18.
[30]
Stas Negara, Nicholas Chen, Mohsen Vakilian, Ralph E Johnson, and Danny Dig. 2013. A comparative study of manual and automated refactorings. In 27th ECOOP. 552--576.
[31]
Willian Nalepa Oizumi, Leonardo da Silva Sousa, Anderson Oliveira, Luiz Carvalho, Alessandro Garcia, Thelma Elita Colanzi, and Roberto Felicio Oliveira. 2019. On the Density and Diversity of Degradation Symptoms in Refactored Classes: A Multi-case Study. In 30th IEEE International Symposium on Software Reliability Engineering, ISSRE 2019, Berlin, Germany, October 28-31, 2019, Katinka Wolter, Ina Schieferdecker, Barbara Gallina, Michel Cukier, Roberto Natella, Naghmeh Ivaki, and Nuno Laranjeiro (Eds.). IEEE, 346--357.
[32]
Johnatan Oliveira, Rohit Gheyi, Melina Mongiovi, Gustavo Soares, Márcio Ribeiro, and Alessandro Garcia. 2019. Revisiting the refactoring mechanics. Inf. Softw. Technol. 110 (2019), 136--138.
[33]
Ali Ouni, Marouane Kessentini, Mel Ó Cinnéide, Houari Sahraoui, Kalyanmoy Deb, and Katsuro Inoue. 2017. MORE: A multi-objective refactoring recommendation approach to introducing design patterns and fixing code smells. J. Softw.: Evol. Process 29, 5 (2017), e1843.
[34]
Ali Ouni, Marouane Kessentini, Houari Sahraoui, Katsuro Inoue, and Kalyanmoy Deb. 2016. Multi-criteria code refactoring using search-based software engineering: An industrial case study. ACM Trans. Softw. Eng. Methodol (TOSEM) 25, 3 (2016), 23.
[35]
Matheus Paixao, Jens Krinke, Donggyun Han, and Mark Harman. 2018. CROP: Linking code reviews to source code changes. In 15th MSR. 46--49.
[36]
Matheus Paixao, Jens Krinke, DongGyun Han, Chaiyong Ragkhitwetsagul, and Mark Harman. 2017. Are developers aware of the architectural impact of their changes?. In 32nd ASE. 95--105.
[37]
Matheus Paixao, Jens Krinke, DongGyun Han, Chaiyong Ragkhitwetsagul, and Mark Harman. 2019. The Impact of Code Review on Architectural Changes. IEEE Transactions on Software Engineering (2019).
[38]
Matheus Paixao and Paulo Henrique Maia. 2019. Rebasing in Code Review Considered Harmful: A Large-Scale Empirical Investigation. In 19th International Conference on Source Code Analysis and Manipulation (SCAM). IEEE, 45--55.
[39]
Matheus Paixao, Anderson Uchôa, Ana Carla Bibiano, Daniel Oliveira, Alessandro Garcia, Jens Krinke, and Emilio Arvonio. 2020. Replication package for the paper: "Behind the Intents: An In-depth Empirical Study on Software Refactoring in Modern Code Review". (2020). https://zenodo.org/record/3710975 Accessed: 2020-03-16.
[40]
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. Inform. Softw. Tech. (IST) 99 (2018), 1--10.
[41]
Fabio Palomba, Andy Zaidman, Rocco Oliveto, and Andrea De Lucia. 2017. An Exploratory Study on the Relationship between Changes and Refactoring. In 25th ICPC. 176--185.
[42]
Paula Rachow. 2019. Refactoring Decision Support for Developers and Architects Based on Architectural Impact. In ICSA-C. 262--266.
[43]
Peter C Rigby. 2012. Open source peer review-lessons and recommendations for closed source. IEEE Software (2012).
[44]
Peter C Rigby and Christian Bird. 2013. Convergent contemporary software peer review practices. In 9th FSE. 202--212.
[45]
A-D Seriai, Marianne Huchard, Christelle Urtado, Sylvain Vauttier, and others. 2013. Mining features from the object-oriented source code of software variants by combining lexical and structural similarity. In 14th IRI. 586--593.
[46]
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 - FSE 2016.ACM Press, New York, New York, USA, 858--870.
[47]
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 International Conference on Mining Software Repositories (ICSE).
[48]
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. 253--258.
[49]
Daniel Tenorio, Ana Carla Bibiano, and Alessandro Garcia. 2019. On the customization of batch refactoring. In Proceedings of the 3rd International Workshop on Refactoring, IWOR@ICSE 2019, Montreal, QC, Canada, May 28, 2019, Nikolaos Tsantalis, Yuanfang Cai, and Serge Demeyer (Eds.). IEEE / ACM, 13--16.
[50]
Adrian Trifu and Radu Marinescu. 2005. Diagnosing design problems in object oriented systems. In 12th WCRE. 10-pp.
[51]
Nikolaos Tsantalis, Theodoros Chaikalis, and Alexander Chatzigeorgiou. 2018. Ten years of JDeodorant: Lessons learned from the hunt for smells. In 25th SANER. 4--14.
[52]
Nikolaos Tsantalis, Victor Guana, Eleni Stroulia, and Abram Hindle. 2013. A multidimensional empirical study on refactoring activity. In 23rd CASCON. IBM Corp., 132--146.
[53]
Nikolaos Tsantalis, Matin Mansouri, Laleh M Eshkevari, Davood Mazinanian, and Danny Dig. 2018. Accurate and efficient refactoring detection in commit history. In 40th ICSE. 483--494.
[54]
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). IEEE Trans. Softw. Eng. (TSE) 43, 11 (2017), 1063--1088.
[55]
Claes Wohlin, Per Runeson, Martin Höst, Magnus C Ohlsson, Björn Regnell, and Anders Wesslén. 2012. Experimentation in software engineering. Springer Science & Business Media.

Cited By

View all
  • (2024)A Meta-Study of Software-Change IntentionsACM Computing Surveys10.1145/3661484Online publication date: 25-Apr-2024
  • (2024)Barriers for Students During Code Change ComprehensionProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639227(1-13)Online publication date: 20-May-2024
  • (2024)Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical StudyProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3623306(1-13)Online publication date: 20-May-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
MSR '20: Proceedings of the 17th International Conference on Mining Software Repositories
June 2020
675 pages
ISBN:9781450375177
DOI:10.1145/3379597
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 September 2020

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Code Review Mining
  2. Developers' Intents
  3. Refactoring

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Funding Sources

  • Coordenação de Aperfeiçoamento de Pessoal de Nível Superior
  • Conselho Nacional de Desenvolvimento Científico e Tecnológico

Conference

MSR '20
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)58
  • Downloads (Last 6 weeks)7
Reflects downloads up to 02 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)A Meta-Study of Software-Change IntentionsACM Computing Surveys10.1145/3661484Online publication date: 25-Apr-2024
  • (2024)Barriers for Students During Code Change ComprehensionProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639227(1-13)Online publication date: 20-May-2024
  • (2024)Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical StudyProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3623306(1-13)Online publication date: 20-May-2024
  • (2024)Towards Sustainable Cloud Software Systems through Energy-Aware Code Smell Refactoring2024 IEEE 17th International Conference on Cloud Computing (CLOUD)10.1109/CLOUD62652.2024.00034(223-234)Online publication date: 7-Jul-2024
  • (2023)Modern Code Reviews—Survey of Literature and PracticeACM Transactions on Software Engineering and Methodology10.1145/358500432:4(1-61)Online publication date: 26-May-2023
  • (2023)A Survey of Refactoring Techniques to Maximize Code Coverage Metric2023 15th International Congress on Advanced Applied Informatics Winter (IIAI-AAI-Winter)10.1109/IIAI-AAI-Winter61682.2023.00015(32-36)Online publication date: 11-Dec-2023
  • (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)Fulfilling Industrial Needs for Consistency among Engineering ArtifactsProceedings of the 45th International Conference on Software Engineering: Software Engineering in Practice10.1109/ICSE-SEIP58684.2023.00028(246-257)Online publication date: 17-May-2023
  • (2023)Towards Strengthening Software Library Interfaces with Granular and Interactive Type MigrationsProceedings of the 45th International Conference on Software Engineering: Companion Proceedings10.1109/ICSE-Companion58688.2023.00063(230-234)Online publication date: 14-May-2023
  • (2023)Beyond the Code: Investigating the Effects of Pull Request Conversations on Design Decay2023 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM)10.1109/ESEM56168.2023.10304805(1-12)Online publication date: 26-Oct-2023
  • 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