Reducing Code Complexity through Code Refactoring and Model-Based Rejuvenation

Over time, software tends to grow more complex, hampering understandability and further development. To reduce accidental complexity, model-based rejuvenation techniques have been proposed. These techniques combine reverse engineering (extracting models) with forward engineering (generating code). U...

Full description

Saved in:
Bibliographic Details
Published in2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER) pp. 617 - 621
Main Authors Mooij, Arjan J., Ketema, Jeroen, Klusener, Steven, Schuts, Mathijs
Format Conference Proceeding
LanguageEnglish
Published IEEE 01.02.2020
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:Over time, software tends to grow more complex, hampering understandability and further development. To reduce accidental complexity, model-based rejuvenation techniques have been proposed. These techniques combine reverse engineering (extracting models) with forward engineering (generating code). Unfortunately, model extraction can be error-prone, and validation can often only be performed at a late stage by testing the generated code. We intend to mitigate the aforementioned challenges, making model-based rejuvenation more controlled. We describe an exploratory case study that aims to rejuvenate an industrial embedded software component implementing a nested state machine. We combine two techniques. First, we develop and apply a series of small, automated, case-specific code refactorings that ensure the code (a) uses well-known programming idioms, and (b) easily maps onto the type of model we intend to extract. Second, we perform model-based rejuvenation focusing on the high-level structure of the code. The above combination of techniques gives ample opportunity for early validation, in the form of code reviews and testing, as each refactoring is performed directly on the existing code. Moreover, aligning the code with the type of model we intend to extract significantly simplifies the extraction, making the process less error-prone. Hence, we consider code refactoring to be a useful stepping stone towards model-based rejuvenation.
DOI:10.1109/SANER48275.2020.9054823