Applying SOLID principles for the refactoring of legacy code: An experience report

The presence of technical debt in legacy systems is an inevitable consequence of years of development. Metrics play a significant role in informing the prioritisation process of maintenance activities to reduce this debt. However, it is important to note that not all metrics are equally important or...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:The Journal of systems and software 2025-02, Vol.220, p.112254, Article 112254
Hauptverfasser: Yanakiev, Ivan, Lazar, Bogdan-Mihai, Capiluppi, Andrea
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The presence of technical debt in legacy systems is an inevitable consequence of years of development. Metrics play a significant role in informing the prioritisation process of maintenance activities to reduce this debt. However, it is important to note that not all metrics are equally important or readily available in real industrial settings. This paper summarises an experience report of refactoring activities performed at a Dutch partnering company, aimed at identifying, prioritising and repaying parts of the architectural technical debt accumulated in two decades of development. Given the size of the refactoring task, a data-driven prioritisation was necessary, and based on the impact that the maintenance activity would have on the base system. However, the metrics available from the monitoring of the system formed a limited set, and were not always focused on architectural aspects. Even so, the impact analysis was performed and resulted in the selection of a subset of components that needed urgent maintenance. The refactoring of the identified components was centred around the well-known SOLID design principles, particularly the Dependency Inversion (DI) principle. Additionally, a set of recurring actions was established into ‘refactoring patterns’ and systematically applied to more than 5,000 source, header and custom domain language files. This work, albeit limited to the period where the activity was planned for, was well received by the industrial collaborator. The patterns have proven very valuable in the process of maintaining such a large project scope. The data-driven approach and the identified patterns have helped the team navigate this large space and consistently refactor similar architectural issues that fall under the same category. •Experience report on architectural TD: The paper reports on identifying, prioritising, and repaying 20 years of architectural Technical Debt at ASML.•Data-Driven prioritisation: The refactoring used a data-driven approach to prioritise components needing maintenance by impact.•Implementation of SOLID principles: Refactoring focused on SOLID principles, especially Dependency Inversion, to enhance code maintainability.•Refactoring patterns: The study applied recurring refactoring patterns to over 5,000 files, aiding large-scale maintenance efforts.
ISSN:0164-1212
DOI:10.1016/j.jss.2024.112254