Refactoring cross-project code duplication in an industrial software product line: A case study from RDW
Jesper van der Zwaag, Frank Driesens, Bouwe Postma, Andrea Capiluppi · Journal of Systems and Software · 2025
Code duplication across projects is a common challenge in Software Product Line (SPL) development, impacting maintainability and efficiency. This paper reports on an applied research project conducted within RDW, The Netherlands Vehicle Authority, aimed at addressing cross-project code duplication in a multi-application SPL environment. The objective of this work was to investigate the impact of refactoring cross-project duplicated code on maintainability, code reuse, and technical debt within RDW’s Electronic Services System (EDS), composed of 62 applications. We used an action research approach, focusing on two applications to identify, refactor, and package duplicated features into reusable components. SonarQube was used to detect and quantify duplication, and the effectiveness of refactoring was evaluated using code duplication reduction metrics and developer feedback. The refactoring effort led to the removal of 38% of the duplicated code on average, improving code reuse by 33%. Efficiency gains were observed in the second application due to the experience from the first intervention, reducing the time required for code maintenance and updates by 89%. While the study demonstrates that systematically addressing cross-project code duplication in SPLs improves maintainability and reduces technical debt, it also highlights a key limitation: refactoring efforts need to be undertaken early to be feasible. As the number of applications in RDW’s system steadily expanded to 80, the engineers reported that the required refactoring work, although highly beneficial, has become too extensive and time-consuming to be practical. The effort was ultimately left too late, making large-scale refactoring no longer a viable solution. Future strategies should focus on early duplication identification, architectural solutions such as modularization or microservices, and automated dependency management to prevent similar challenges from arising.