Ivan Yanakiev , Bogdan-Mihai Lazar , Andrea Capiluppi
{"title":"应用 SOLID 原则重构遗留代码:经验报告","authors":"Ivan Yanakiev , Bogdan-Mihai Lazar , Andrea Capiluppi","doi":"10.1016/j.jss.2024.112254","DOIUrl":null,"url":null,"abstract":"<div><div>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.</div><div>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.</div><div>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.</div><div>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.</div><div>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.</div></div>","PeriodicalId":51099,"journal":{"name":"Journal of Systems and Software","volume":"220 ","pages":"Article 112254"},"PeriodicalIF":3.7000,"publicationDate":"2024-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Applying SOLID principles for the refactoring of legacy code: An experience report\",\"authors\":\"Ivan Yanakiev , Bogdan-Mihai Lazar , Andrea Capiluppi\",\"doi\":\"10.1016/j.jss.2024.112254\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>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.</div><div>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.</div><div>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.</div><div>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.</div><div>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.</div></div>\",\"PeriodicalId\":51099,\"journal\":{\"name\":\"Journal of Systems and Software\",\"volume\":\"220 \",\"pages\":\"Article 112254\"},\"PeriodicalIF\":3.7000,\"publicationDate\":\"2024-10-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Systems and Software\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S016412122400298X\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Systems and Software","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S016412122400298X","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
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 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.
期刊介绍:
The Journal of Systems and Software publishes papers covering all aspects of software engineering and related hardware-software-systems issues. All articles should include a validation of the idea presented, e.g. through case studies, experiments, or systematic comparisons with other approaches already in practice. Topics of interest include, but are not limited to:
• Methods and tools for, and empirical studies on, software requirements, design, architecture, verification and validation, maintenance and evolution
• Agile, model-driven, service-oriented, open source and global software development
• Approaches for mobile, multiprocessing, real-time, distributed, cloud-based, dependable and virtualized systems
• Human factors and management concerns of software development
• Data management and big data issues of software systems
• Metrics and evaluation, data mining of software development resources
• Business and economic aspects of software development processes
The journal welcomes state-of-the-art surveys and reports of practical experience for all of these topics.