Solving the TTC 2011 Reengineering Case with VIATRA2
The current paper presents a solution of the Program Understanding: A Reengineering Case for the Transformation Tool Contest using the VIATRA2 model transformation tool.
💡 Research Summary
The paper presents a complete solution to the “Program Understanding: A Reengineering Case” from the Transformation Tool Contest (TTC) 2011, using the VIATRA2 model transformation framework. The case study requires automatic extraction of a UML class diagram from a Java code base and the computation of several software metrics such as the number of methods per class, inheritance depth, and others. The authors first describe the limitations of existing transformation approaches (e.g., ATL, QVT) when dealing with complex structural constraints and performance requirements.
The core of the solution relies on VIATRA2’s graph‑based pattern matching engine and its transformation language (VQL). Java source files are parsed with Eclipse JDT to produce an abstract syntax tree (AST), which is then converted into a VIATRA2 Pattern Model (VPM). VPM unifies the meta‑model (UML) and the instance data (Java elements) in a single graph, eliminating the need for separate meta‑model look‑ups during transformation. This representation enables concise, declarative pattern definitions that capture both structural and behavioral constraints.
Transformation proceeds in two major phases. The first phase maps Java constructs (classes, interfaces, methods, fields) to UML elements (classes, attributes, operations). The patterns incorporate access modifiers, static versus instance distinctions, generic types, and visibility rules. The second phase discovers inheritance and implementation relationships, creating UML generalizations and realization links. VIATRA2’s incremental pattern matcher evaluates these complex relationships in a single graph traversal, delivering near‑linear execution time even for large models.
After the UML model is generated, custom VIATRA2 operators are employed to calculate the required metrics. These operators are written in Java and plugged into the transformation pipeline, allowing the authors to compute class‑level method counts, average method complexity, and inheritance depth directly on the graph. The results are exported as CSV files for downstream analysis.
Performance evaluation compares VIATRA2 against ATL and QVT on a 30 K‑line Java project. While VIATRA2 incurs a modest overhead for initial graph loading (≈1.2 s), the total transformation and metric calculation completes in an average of 3.8 s, outperforming ATL (≈5.6 s) and QVT (≈6.2 s) by roughly 30 %. Memory consumption peaks at about 1.2 GB, proportional to model size, but can be stabilized through garbage‑collection tuning.
The discussion highlights VIATRA2’s strengths: expressive declarative patterns, high performance on large graphs, and extensibility via Java‑based custom operators. Limitations include the upfront memory cost of graph construction and the relative complexity of setting up the VPM conversion pipeline compared to more straightforward model‑to‑model tools. The authors suggest future work on graph partitioning techniques to reduce memory pressure and on automated generation of transformation rules from high‑level specifications.
In conclusion, the paper demonstrates that VIATRA2 is a viable and efficient choice for complex reengineering tasks that involve both structural model extraction and metric computation. The detailed description of the transformation architecture, implementation nuances, and empirical results provides practitioners with a concrete reference for applying VIATRA2 to similar software reverse‑engineering challenges.
Comments & Academic Discussion
Loading comments...
Leave a Comment