Reducing Code Complexity through Code Refactoring and Model-Based Rejuvenation
Autor: | Arjan J. Mooij, Mathijs Schuts, Jeroen Ketema, Steven Klusener |
---|---|
Jazyk: | angličtina |
Rok vydání: | 2020 |
Předmět: |
Reverse engineering
Code review Industrial Innovation Computer science business.industry 020207 software engineering Cyclomatic complexity 02 engineering and technology Code complexity computer.software_genre Software Embedded software Code refactoring 020204 information systems 0202 electrical engineering electronic engineering information engineering Code (cryptography) Rejuvenation Code generation Software engineering business computer |
Zdroj: | SANER |
Popis: | 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. |
Databáze: | OpenAIRE |
Externí odkaz: |