Preview

Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS)

Advanced search

The refactoring approach used in Klocwork Insight toolkit

https://doi.org/10.15514/ISPRAS-2012-23-7

Abstract

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.

About the Author

N. L. Lugovskoy
ISP RAS, Moscow
Russian Federation


References

1. V. O. Savitsky, D. V. Sidorov, Inkremental'nyj analiz iskhodnogo koda na yazykakh C/C++[Incremental source code analysis for C/C++ languages] Trudy ISP RAN [The Proceedings of ISP RAS], 2012, vol 22, pp. 119-129 (in Russian)

2. Martin Fowler. Refactoring. Improving the Design of Existing Code. Addison-Wesley, 2000

3. Martin Fowler. Refactoring Home Page. http://www.refactoring.com/

4. http://msdn.microsoft.com/en-us/library/0s21cwxk.aspx

5. http://www.refactoring.com/catalog/extractMethod.html

6. http://www.devexpress.com/Subscriptions/DXperience/DXv2/index.xml

7. http://www.wholetomato.com/products/featureRefactoring.asp

8. http://www.eclipse.org/cdt

9. Michael Ruegg. Eclipse CDT refactoring overview and internals. Parallel Tools Platform (PTP) Workshop, Chicago, September, 2012

10. https://developer.apple.com/xcode


Review

For citations:


Lugovskoy N.L. The refactoring approach used in Klocwork Insight toolkit. Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS). 2012;23. (In Russ.) https://doi.org/10.15514/ISPRAS-2012-23-7



Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 2079-8156 (Print)
ISSN 2220-6426 (Online)