search menu icon-carat-right cmu-wordmark
quotes
2022 Research Review / DAY 3

Refactoring for Software Isolation

Software-reliant systems need to evolve over time to meet new requirements and take advantage of new technology. However, all too often, the structure of software becomes too complicated to allow rapid and cost-effective improvements. This challenge is common in long-lived DoD systems and not uncommon even in newer systems, and it can result in a need to perform large-scale refactoring. As noted in a recent SEI survey [Ivers 2022a], industry practitioners reported that large-scale refactoring exercises lack robust tool support and consume considerable effort (an average of 1,500 staff days).

This project extends our refactoring assistant to refactor Java or C# code, matures its automated software isolation capability, and enhances its usability, solution completeness, and solution quality.

In the FY19–21 Line project Untangling the Knot [Ivers 2022b], we created a refactoring assistant that automates the majority of the work required for software isolation, a key element of large-scale refactoring projects that modularizes existing code for use in new contexts. The refactoring assistant combines static code analysis, formalized refactorings, and a multi-objective genetic algorithm to search hundreds of thousands of combinations of primitive refactorings applied to different code elements to find solutions that solve the software isolation problem in balance with other criteria (e.g., code size, maintainability, or understandability). Results from applying the current prototype to multiple open source and DoD projects demonstrated an ability to scale to at least 1.2M source lines of code and generate solutions that, on average, solve 88% of the structural couplings that hinder software isolation.

We demonstrated an ability to scale to at least 1.2M source lines of code and generate solutions that, on average, solve 88% of the structural couplings that hinder software isolation. We demonstrated an ability to scale to at least 1.2M source lines of code and generate solutions that, on average, solve 88% of the structural couplings that hinder software isolation.

In this project, we have extended the refactoring assistant to address a second programming language and are now able to refactor Java or C# code. We are further maturing the automated software isolation capability of this refactoring assistant and validating this research by applying it to open source projects, and we are assessing success against the following objectives:

  • Usability: Developers using the refactoring assistant will have to review 70% fewer generated refactorings to select and understand their preferred solution.
  • Solution completeness: The refactoring assistant generates solutions that resolve at least 90% of the structural couplings that hinder software isolation.
  • Solution quality: Experienced developers who use the refactoring assistant agree with and use at least 80% of the recommended refactorings in solutions without modification.

In Context

This FY2022–24 project

  • builds on prior DoD line-funded research in software architecture analysis, static code analysis, and identifying technical debt
  • aligns with the CMU SEI technical objective to make software delivery timely so that the cadence of acquisition, delivery, and fielding is responsive to and anticipatory of the operational tempo of DoD warfighters
  • aligns with the DoD software strategy to mitigate technical debt by directly recommending code changes to resolve some forms of technical debt
  • addresses a widespread, recurring need in software organizations (As requirements and technology are never frozen in time, the need to adapt working software to new contexts is likely to remain a common need across many software systems.)
Mentioned in this Article

[Ivers 2022a]
Ivers, James; Nord, Robert L.; Ozkaya, Ipek; Seifried, Chris; Timperley, Christopher S.; & Kessentini, Marouane. Industry Experiences with Large-Scale Refactoring. Foundations of Software Engineering: Software Engineering in Practice (ESEC/FSE). November 2022. https://doi.org/10.48550/arXiv.2202.00173

[Ivers 2022b]
Ivers, James; Seifried, Chris; & Ozkaya, Ipek. Untangling the Knot: Enabling Architecture Evolution with Search-Based Refactoring. 19th IEEE International Conference on Software Architecture (ICSA 2022). March 2022. https://doi.org/10.1109/ICSA53651.2022.00018