On the Co-Occurrence of Refactoring of Test and Source Code
Refactoring is a widespread practice that aims to help improve the quality of a software system without altering its external behaviour. In practice, developers can perform refactoring operations on test and source code. However, while prior work shows that refactoring source code brings many benefits, a limited number of studies empirically investigate refactoring of test code and whether it is co-occurred with source code. To examine those co-occurring refactorings, we conducted an empirical study of 60,465 commits spanning 77 open-source Java projects.
First, we quantitatively analyzed the commits from those projects to identify co-occurring refactoring commits (i.e., commits contain refactorings performed on test and source code). Our results showed that on average 17.9% of refactoring commits are co-occurring refactoring commits, which is twice as much as test code-only refactoring commits. Also, we investigated the type of refactorings applied to test code in those co-occurring commits. We found Change Variable Type and Move Class are the most common refactorings. Second, we trained random forest classifiers to predict when refactoring test code should co-occur with refactoring source code using features extracted from the refactoring source code in ten selected projects. Our results showed that the classifier can accurately predict when test and source code refactoring co-occurs with AUC values between 0.67-0.92. Our analysis also showed that the most important features for our classifier are related to the refactoring size and developer refactoring experience.
Wed 18 MayDisplayed time zone: Eastern Time (US & Canada) change
12:00 - 12:50 | Mining ChallengeMining Challenge / Technical Papers at MSR Main room - even hours Chair(s): Steffen Herbold TU Clausthal | ||
12:00 4mTalk | An Exploratory Study on Refactoring Documentation in Issues Handling Mining Challenge Eman Abdullah AlOmar Stevens Institute of Technology, Anthony Peruma Rochester Institute of Technology, Mohamed Wiem Mkaouer Rochester Institute of Technology, Christian D. Newman Rochester Institute of Technology, Ali Ouni ETS Montreal, University of Quebec Pre-print | ||
12:04 4mTalk | Between JIRA and GitHub: ASFBot and its Influence on Human Comments in Issue Trackers Mining Challenge Ambarish Moharil Eindhoven University of Technology, Dmitrii Orlov Eindhoven University of Technology, Samar Jameel Eindhoven University of Technology, Tristan Trouwen Eindhoven University of Technology, Nathan Cassee Eindhoven University of Technology, Alexander Serebrenik Eindhoven University of Technology Pre-print | ||
12:08 4mTalk | Is Refactoring Always a Good Egg? Exploring the Interconnection Between Bugs and Refactorings Mining Challenge File Attached | ||
12:12 4mTalk | On the Co-Occurrence of Refactoring of Test and Source Code Mining Challenge Pre-print Media Attached | ||
12:16 4mTalk | Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship Between Technical Debt and RefactoringBest Mining Challenge Paper Award Mining Challenge Anthony Peruma Rochester Institute of Technology, Eman Abdullah AlOmar Stevens Institute of Technology, Christian D. Newman Rochester Institute of Technology, Mohamed Wiem Mkaouer Rochester Institute of Technology, Ali Ouni ETS Montreal, University of Quebec Pre-print Media Attached | ||
12:20 4mTalk | Studying the Impact of Continuous Delivery Adoption on Bug-Fixing Time in Apache’s Open-Source Projects Mining Challenge Carlos Diego Andrade de Almeida Federal University of Ceará, Diego N. Feijó Federal University of Ceará, Lincoln Rocha Federal University of Ceará Media Attached | ||
12:24 4mTalk | Which bugs are missed in code reviews: An empirical study on SmartSHARK dataset Mining Challenge fatemeh khoshnoud Department of Computer Science and Engineering and IT; School of Electrical and Computer Engineering, Shiraz University, Ali Rezaei Nasab Department of Computer Science and Engineering and IT; School of Electrical and Computer Engineering, Shiraz University, Zahra Toudeji Department of Computer Science and Engineering and IT; School of Electrical and Computer Engineering, Shiraz University, Ashkan Sami Shiraz University | ||
12:28 22mLive Q&A | Discussions and Q&A Technical Papers |