Is Refactoring Always a Good Egg? Exploring the Interconnection Between Bugs and Refactorings
Authors/Creators
Description
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.
Notes
Files
ref1_inducing_result.csv
Files
(66.5 kB)
| Name | Size | |
|---|---|---|
|
md5:507c8edfd4521abf7261a207e8784b68
|
6.5 kB | Download |
|
md5:e1063fe574a1c7be69f3d0c426282535
|
2.6 kB | Download |
|
md5:88e8db9511f0c7cce8132a51a993e6eb
|
3.9 kB | Download |
|
md5:159b08e9eaed910171fdc0c667e17dcc
|
4.0 kB | Download |
|
md5:159b08e9eaed910171fdc0c667e17dcc
|
4.0 kB | Download |
|
md5:b70a27314854b4c120cf13c21385bd4e
|
3.2 kB | Download |
|
md5:a8f4b7976ddd7963d7c85941c033c37c
|
4.3 kB | Download |
|
md5:865f32a477e631e1d8000fb435470680
|
3.5 kB | Download |
|
md5:130c2c2d95ee35cb5289e167b9a58701
|
2.9 kB | Download |
|
md5:46cc0ace1c1add1addc2347116a15086
|
8.1 kB | Download |
|
md5:e4e0208b624dd54dd2853c7a307768bd
|
510 Bytes | Preview Download |
|
md5:1a2dc8a43908b31b5c91d14bbd047966
|
805 Bytes | Preview Download |
|
md5:6b1842c213f49e73854c8d757816bd6d
|
3.5 kB | Preview Download |
|
md5:acd20c284965a9f45b03bf77a6fe63b7
|
226 Bytes | Preview Download |
|
md5:02a9f217bf1479263367381f8a5eb8f8
|
2.3 kB | Preview Download |
|
md5:46e922fe81fc195ae851c6e196d1a693
|
966 Bytes | Preview Download |
|
md5:54593f5e5200c3fea9e431fd400dfd6c
|
943 Bytes | Preview Download |
|
md5:5dd9590df66246a6775402eb5986bcdf
|
1.9 kB | Preview Download |
|
md5:2982bfcd8077b64985cc5318aba0fad4
|
1.4 kB | Preview Download |
|
md5:ff5231bf133c455a766d0e54b9bfe276
|
11.0 kB | Preview Download |