A Visual Tool-Based Approach to porting C++ Code
21st February 2011, 15:30 - 16:30
Amphi Emeraude, Télécom ParisTech - 46 rue Barrault Paris 13 - Metro Corvisart (how to get there ?)
The sheer number of changes needed to port a code base when one of more of its dependencies need to be replaced by either a new version or another framework make it viable to develop tools that perform all or most of the required changes automatically in a reliable way. The purpose of this thesis was to research ways to support developers in the process of automated refactoring of large code bases.
To this extent the type of refactoring activities involved was studied. Furthermore, a semi-automated code refactoring system based on queries and rules was developed. Transformations work directly on the source by means of insert and replace actions but are still correct due to the semantic understanding of the code by the framework.
Additionally, new visualization techniques are proposed to support the process of iterative refactoring. The results of these are implemented in a tool for the C/C++ language, developed as an extension of the KDevelop IDE. Finally, the effectiveness and usefulness of the tool was demonstrated on a large industrial code base and concrete refactoring operations involved in the process of porting C++ code. The tool is able to deal with large and complex code bases. It was tested with a subset of the queries and transformations needed for a Qt3 to Qt4 port on kdelibs 3.5 which contains about 750K lines of code. The project overview visualization gives a clear overview of the results for the queries on the project and can easily show results for up to hundreds of files. The file impact visualization gives a space efficient overview of the structure of a source file and at the same time it gives clear visual hints of potential conflicting changes. Finally, transformations were specified for about fifteen of the more complex changes in a Qt port.
The approach taken for transformations worked particularly well when changes are localized. For more structural changes to the code transformations on the AST and AST pretty printing would be required. The project overview visualization is really helpful in estimating porting effort. Finally, the file impact visualization extended the infrastructure by enabling code complexity analysis in addition to the main task of automated refactoring.
Bertjan Broeksema is a Ph.D. candidate at IBM in Paris (Formerly ILOG) working with prof. Alex Telea from the University of Groningen and Thomas Baudel from IBM. Bertjan received a master degree in Software Engineering and Distributed systems at the university of Groningen. He wrote his master thesis with the title “A visual tool based approach to porting C++ code” at KDAB where he also worked as a C++/Qt software engineer. His current research interests are synthetic data generation and visual analytics in the context of business rule management systems.