New trends and ideas
Does migrating a monolithic system to microservices decrease the technical debt?

https://doi.org/10.1016/j.jss.2020.110710Get rights and content

Highlights

  • A comparison of Technical Debt before and after the migration to microservices.

  • The introduction of a new microservice temporarily increases the Technical Debt.

  • Despite the increased costs, the system based on microservices is easier to maintain.

Abstract

Background:

The migration from a monolithic system to microservices requires a deep refactoring of the system. Therefore, such a migration usually has a big economic impact and companies tend to postpone several activities during this process, mainly to speed up the migration itself, but also because of the demand for releasing new features.

Objective:

We monitored the technical debt of an SME while it migrated from a legacy monolithic system to an ecosystem of microservices. Our goal was to analyze changes in the code technical debt before and after the migration to microservices.

Method:

We conducted a case study analyzing more than four years of the history of a twelve-year-old project (280K Lines of Code) where two teams extracted five business processes from the monolithic system as microservices. For the study, we first analyzed the technical debt with SonarQube and then performed a qualitative study with company members to understand the perceived quality of the system and the motivation for possibly postponed activities.

Results:

The migration to microservices helped to reduce the technical debt in the long run. Despite an initial spike in the technical debt due to the development of the new microservice, after a relatively short period of time the technical debt tended to grow slower than in the monolithic system.

Introduction

Migration to microservices has become very popular over the last years. Companies migrate for different reasons, for example because they expect to improve the quality of their system or to facilitate software maintenance (Taibi et al., 2017).

Companies commonly adopt an initial migration strategy to extract components from their monolithic system as microservices, making use of simplified microservices patterns (Taibi et al., 2017, Taibi et al., 2018). As an example, it is common for companies to initially connect the microservices directly to the legacy monolithic system and not to adopt message buses. However, when the system starts to grow in complexity, they usually start re-architecting their system, considering different architectural patterns (Taibi et al., 2017, Taibi et al., 2018, Knoche and Hasselbring, 2018). The migration from a monolithic system to microservices is commonly performed on systems that are being actively developed. Therefore, in several cases, the development of new features is prioritized over refactoring of the code, which generates technical debt (TD) every time an activity is postponed (Cunningham, 1992, Li et al., 2015) and increases the cost of software maintenance.

Companies migrate to microservices to facilitate maintenance (Taibi et al., 2017). However, recent surveys have confirmed that maintenance costs increase after migration (Taibi et al., 2017, Soldani et al., 2018). Therefore, the goal of this paper is to understand whether the overall code TD of a system increases or decreases after migration to microservices, and whether the type of TD varies after the migration.

In this work, we report a case study where we monitored the code TD of an SME (small and medium-sized enterprise) that migrated their legacy monolithic system to an ecosystem of microservices. The company was interested in evaluating their TD with SonarQube,1 which is one of the most commonly used tools for analyzing code TD. They asked us to monitor the evolution of TD in a project they are developing, during the migration to microservices. The analysis focused on the three types of TD proposed by SonarQube: reliability remediation cost (time to remove all the issues that can generate faults), maintainability remediation cost (time to remove all the issues that increase the maintenance effort), and security vulnerability remediation cost (time to remove all the security issues). Moreover, we implemented a qualitative study by conducting a focus group with two development teams, the software architect, and the product manager. The goal was to deeply understand the causes of the changes in the distribution of the types of TD issues and the motivations for any postponed activities.

To the best of our knowledge, only a limited number of studies have investigated the impact of postponed activities on TD, especially in the context of microservices (de Toledo et al., 2019). This work will help companies to understand how TD grows and changes over time while at the same time opening up new avenues for future research on the analysis of TD interest.

This paper is structured as follows: Section 2 briefly introduces the background and related work on microservices and TD, while Section 3 reports the existing work in this topic. In Section 4, we present the case study design, defining the research questions and describing the study context with the data collection and the data analysis protocol. In Section 5, we show the results we obtained, followed by a discussion of them in Section 6. In Section 7, we identify the threats to the validity of our study, and in Section 8, we draw conclusions and provide an outlook on possible future work.

Section snippets

Background

In this Section, we will first describe the background on microservices and technical debt (TD). Moreover, we will describe SonarQube and the method adopted to calculate TD.

Related work

In this Section, we report on the most relevant related work on migration to microservices and TD.

Companies migrate to microservices in order to ease their software development by improving maintainability and decreasing delivery time (Taibi et al., 2017, Soldani et al., 2018). However, migration to microservices is not an easy task. Companies commonly start this migration without having any experience with microservices, and only in few cases do they hire a consultant to support them during

Case study design

We designed our empirical study as a case study based on the guidelines defined by Runeson and Höst (2009). In this Section, we will describe the case study design, including the goal and the research questions, the study context together with the case and subject selection, the data collection, and the data analysis procedure.

Results

In this Section, we present the main outcomes of our study.

To answer our RQs, we first analyzed the data collected with SonarQube (RQ1.1, RQ2.1) and then we conducted the focus group to provide insights into the reasons for the evolution of TD (RQ1.2, RQ2.2).

As for the SonarQube analysis, the data we used stems from two separate time frames: before the migration (23rd August 2014–30th April 2016) and after the migration (3rd January 2017–20th September 2018). The time period between May and

Discussion

The migration to microservices is a non-trivial task that requires deep re-engineering of the whole system. This heavily impacts on the whole project cost, but should also facilitate maintenance in the long run.

Our case company highlighted that if the system had remained monolithic, they might have missed the deadlines of the annual updates of the system. This was caused by the constant grow of TD, as each year it took longer to adapt the system to the new tax rules. Therefore, despite the

Threats to validity

In this Section, we will introduce the threats to validity following the structure suggested by Yin (2009), reporting construct validity, internal validity, external validity, and reliability. Moreover, we will also debate the different tactics adopted to mitigate them.

Construct Validity concerns the identification of the measures adopted for the concepts studied in this work. We analyzed the TD using the model provided by SonarQube. Therefore, different tools and approaches might have provided

Conclusion

In this work, we compared the technical debt (TD) before and after the migration to microservices of a twelve-year-old software project (280k Lines of Code) developed by an Italian SME. This is one of the first studies investigating Technical Debt in SMEs adopting Microservices (Lenarduzzi et al., 2019b).

We conducted a case study to investigate the different perspectives of TD during the migration of microservices, including the TD detected at code level by SonarQube and perceived by the

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgment

This research was partially supported by the “SHAPIC ” grant awarded by the Ulla Tuominen Foundation (Finland)

Valentina Lenarduzzi is postdoctoral researcher at the LUT University in Finland. Her primary research interest is related to data analysis in software engineering, software quality, software maintenance and evolution, with a special focus on Technical Debt. She obtained her Ph.D. in Computer Science at the Università degli Studi dell’Insubria, Italy, in 2015. She also spent 8 months as Visiting Researcher at the Technical University of Kaiserslautern and Fraunhofer Institute for Experimental

References (63)

  • LiZ. et al.

    A systematic mapping study on technical debt and its management

    J. Syst. Softw.

    (2015)
  • SeamanC. et al.

    Chapter 2 - measuring and monitoring technical debt

  • SoldaniJ. et al.

    The pains and gains of microservices: A systematic grey literature review

    J. Syst. Softw.

    (2018)
  • AbbottM.L. et al.

    The Art of Scalability: Scalable Web Architecture, Processes, and Organizations for the Modern Enterprise

    (2015)
  • AvgeriouP. et al.

    Reducing friction in software development

    IEEE Softw.

    (2016)
  • BognerJ. et al.

    Towards a collaborative repository for the documentation of service-based antipatterns and bad smells

  • BognerJ. et al.

    Limiting technical debt with maintainability assurance: An industry survey on used techniques and differences with service- and microservice-based systems

  • BognerJ. et al.

    Assuring the evolvability of microservices: Insights into industry practices and challenges

  • BrogiA. et al.

    Freshening the air in microservices: Resolving architectural smells via refactoring

  • ChenR. et al.

    From monolith to microservices: A dataflow-driven approach

  • ChhonkerA. et al.

    Microservices architectures and technical debt: A self-adaptation view

  • CojocaruM. et al.

    Attributes assessing the quality of microservices automatically decomposed from monolithic applications

  • CunninghamW.

    The wycash portfolio management system

  • CurtisB. et al.

    Estimating the principal of an application’s technical debt

    IEEE Softw.

    (2012)
  • De AlwisA.A.C. et al.

    Function-splitting heuristics for discovery of microservices in enterprise systems

  • EngelT. et al.

    Evaluation of microservice architectures: A metric and tool-based approach

  • ErderM. et al.

    Continuous Architecture: Sustainable Architecture in an Agile and Cloud-Centric World

    (2016)
  • Floria AuerM.F. et al.

    From monolithic systems to microservices: An assessment framework

    (2020)
  • FowlerM. et al.

    Refactoring: Improving the Design of Existing Code

    (1999)
  • FritzschJ. et al.

    From monolith to microservices: A classification of refactoring approaches

  • GrissomR.J. et al.

    Effect Sizes for Research: A Broad Practical Approach

    (2005)
  • GuoY. et al.

    Exploring the costs of technical debt management – a case study

    Empir. Softw. Eng.

    (2016)
  • GyselM. et al.

    Service cutter: A systematic approach to service decomposition

  • Ilaria PigazziniV.L. et al.

    Towards microservice smells detection

  • ISO/IEC 25010 System and software quality modelsTechnical Report

    (2010)
  • JanesA. et al.

    A continuous software quality monitoring approach for small and medium enterprises

  • KecskemetiG. et al.

    The entice approach to decompose monolithic services into microservices

  • KnocheH. et al.

    Using microservices for legacy software modernization

    IEEE Softw.

    (2018)
  • LenarduzziV. et al.

    Are sonarqube rules inducing bugs?

  • LenarduzziV. et al.

    An empirical study on technical debt in a finnish sme

  • LenarduzziV. et al.

    The technical debt dataset

  • Cited by (0)

    Valentina Lenarduzzi is postdoctoral researcher at the LUT University in Finland. Her primary research interest is related to data analysis in software engineering, software quality, software maintenance and evolution, with a special focus on Technical Debt. She obtained her Ph.D. in Computer Science at the Università degli Studi dell’Insubria, Italy, in 2015. She also spent 8 months as Visiting Researcher at the Technical University of Kaiserslautern and Fraunhofer Institute for Experimental Software Engineering (IESE). Formerly, she was postdoctoral researcher at Free University of Bozen-Bolzano (Italy) and then at Tampere University (Finland). In 2011 she was one of the co-founders of Opensoftengineering s.r.l., a spin-off company of the Università degli Studi dell’Insubria.

    Francesco Lomio is Ph.D. in Signal Processing, working in the Machine Learning Group, at Tampere University in Finland. He is currently working on anomaly detection using deep learning, with applications in computer vision, software engineering and industrial cases. His interests also cover the application of different machine learning approaches, including deep learning, for software code quality and software maintenance. He received his M.Sc. from University of Turin (Italy) with a thesis work on the performance of a neural network based trading algorithm.

    Nyyti Saarimäki Ph.D. student in software engineering at Tampere University in Finland. She received her B.Sc. in mathematics in 2016 and M.Sc. in theoretical computer science in 2018 from Tampere University of Technology. Her main research interests include data analysis and adapting observational study methodologies from epidemiology to empirical software engineering. She received her his M.Sc. from Tampere University of Technology (Finland) with a thesis work on using hierarchical data with decision tree classifiers.

    Davide Taibi is associate Professor at the Tampere University, Finland. He obtained his Ph.D. in Computer Science at the Università degli Studi dell’Insubria, Italy in 2011. His research activities are focused on software quality in cloud-based systems, supporting companies in keeping Technical Debt under control while migrating to cloud-native architectures. Moreover, he is interested in patterns, anti-patterns and “bad smells” that can help companies to avoid issue during the development process both in monolithic systems and in cloud-native ones. Formerly, he worked at the Free University of Bolzano, Technical University of Kaiserslautern, Germany, Fraunhofer IESE — Kaiserslautern, Germany, and Università degli Studi dell’Insubria, Italy. In 2011 she was one of the co-founders of Opensoftengineering s.r.l., a spin-off company of the Università degli Studi dell’Insubria.

    View full text