Print Email Facebook Twitter Reducing Code Complexity through Code Refactoring and Model-Based Rejuvenation Title Reducing Code Complexity through Code Refactoring and Model-Based Rejuvenation Author Mooij, A.J. Ketema, J. Klusener, S. Schuts, M. Publication year 2020 Abstract 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. Subject Industrial InnovationCode complexityCode generationRejuvenation To reference this document use: http://resolver.tudelft.nl/uuid:c24cbc7e-75d7-4b61-b39b-cd9672653dc8 TNO identifier 874878 Publisher [IEEE] Bibliographical note Saner 2020, 27th IEEE International Conference on Software Analysis, Evolution and Reengineering, London, Ontario, Canada, February 18-21, 2020 Document type conference paper Files To receive the publication files, please send an e-mail request to TNO Library.