DOI: 10.1145/3821432 ISSN: 1049-331X
When Tools Overlook Domain Knowledge: An Empirical Study of Refactoring in Scientific Software
Rohith Pudari, Ahmed Musa Awon, Neil Ernst, Shurui Zhou
Refactoring is a critical process for improving code quality, but anecdotal evidence has shown that refactoring in scientific software (
Sci-SW
) is not always feasible. The inherently exploratory nature of
Sci-SW
development, characterized by evolving requirements and limited adoption of traditional software engineering practices, could present significant challenges to refactoring. However, there is no systematic study exploring refactoring practices in
Sci-OSS
. To bridge this gap, we explore the effectiveness of three state-of-the-art refactoring detection tools: RefDiff (C), RefactoringMiner (Java), and PyRef (Python) to detect refactorings in scientific open-source software (
Sci-OSS
). Our findings reveal that these tools have significant limitations, detecting fewer refactorings in
Sci-OSS
than non-scientific OSS (
Non-Sci-OSS
). Through a mixed-method approach, we identified that 67.54% of undetected refactorings in
Sci-OSS
require domain knowledge. To complement our analysis of the refactoring changes, we conducted surveys with 47 practitioners experienced in refactoring
Sci-OSS
and 14 follow-up interviews to gain deeper insights into the associated challenges. Our results revealed seven novel challenges for
Sci-OSS
-refactoring, including a domain knowledge gap. These findings emphasize the necessity for specialized tools and strategies to support refactoring in
Sci-OSS
effectively.