The refactoring approach used in Klocwork Insight toolkit

The paper describes refactoring technics used in Klocwork Insight toolkit for C/C++ programming languages. Being the most popular Extract Function refactoring is chosen to describe all stages of refactoring process. Different language elements and constructions are processed during extraction of a n...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Trudy Instituta sistemnogo programmirovaniâ 2018-10, Vol.23, p.107-132
1. Verfasser: Lugovskoy, N.L.
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The paper describes refactoring technics used in Klocwork Insight toolkit for C/C++ programming languages. Being the most popular Extract Function refactoring is chosen to describe all stages of refactoring process. Different language elements and constructions are processed during extraction of a new function and most of them are included as examples. Additionally it's shown that extract function refactoring has to use data-flow analysis to resolve conflicts or different ways of data usage on different conditional branches. Furthermore refactoring has to change and move declarations of variables. So it has to resolve type conflicts and implement declaration order of used types in case type is declared inside function. There are also some points about syntax tree transformations. Such transformations can be automatically mapped to source code changes. Automatically modifying the program’s source code, based on the changes in the syntax tree is commonly known as code transformation, and can be used not only for refactoring purposes. The technic of code transformation used in our approach can be used as a key idea for a new tool for doing non-trivial transformations of source code.
ISSN:2079-8156
2220-6426
DOI:10.15514/ISPRAS-2012-23-7