Is Refactoring Always a Good Egg? Exploring the Interconnection Between Bugs and Refactorings

Bug fixing and code refactoring are two distinct maintenance actions with different goals. While bug fixing is a corrective change that eliminates a defect from the program, refactoring targets improving the internal quality (i.e., maintainability) of a software system without changing its functiona...

Teljes leírás

Elmentve itt :
Bibliográfiai részletek
Szerzők: Bagheri Amirreza
Hegedűs Péter
Dokumentumtípus: Könyv része
Megjelent: IEEE Computer Society; ACM Pittsburgh (PA) 2022
Sorozat:Proceedings : The 2022 Mining Software Repositories Conference MSR 2022
Tárgyszavak:
doi:10.1145/3524842.3528034

mtmt:33038172
Online Access:http://publicatio.bibl.u-szeged.hu/31944
Leíró adatok
Tartalmi kivonat:Bug fixing and code refactoring are two distinct maintenance actions with different goals. While bug fixing is a corrective change that eliminates a defect from the program, refactoring targets improving the internal quality (i.e., maintainability) of a software system without changing its functionality. Best practices and common intuition suggest that these code actions should not be mixed in a single code change. Furthermore, as refactoring aims for improving quality without functional changes, we would expect that refactoring code changes will not be sources of bugs. Nonetheless, empirical studies show that none of the above hypotheses are necessarily true in practice. In this paper, we empirically investigate the interconnection between bug-related and refactoring code changes using the SmartSHARK dataset. Our goal is to explore how often bug fixes and refactorings co-occur in a single commit (tangled changes) and whether refactoring changes themselves might induce bugs into the system. We found that it is not uncommon to have tangled commits of bug fixes and refactorings; 21% of bug-fixing commits include at least one type of refactoring on average. What is even more shocking is that 54% of bug-inducing commits also contain code refactoring changes. For instance, 10% (652 occurrences) of the Change Variable Type refactorings in the dataset appear in bug-inducing commits that make up 7.9% of the total inducing commits. © 2022 ACM.
Terjedelem/Fizikai jellemzők:5
117-121