June 10, 2003

Reverse Engineering from Existing Codebases

Existing reverse engineering tools - as I know them - including Borland/Together Control Center aren't suitable for retrieving models from code. One big issue is that the actual relevance of information highly depends on the kind of model, and on the level of abstraction. In most cases reverse engineering tools create UML representations that represent exactly the original code. Except from displaying details of - say - method bodies, such a UML model doesn't provide any abstraction.

Although I apply forward engineering within my development projects I have to build initial models for my forward development approach. That is where reverse engineering comes in.

In order to build an inital model I combine a standard reverse engineering tool with a model-driven, template-based code generator. Via reverse engineering I get an almost 1:1-representation of the code in a form that's suitable as input for the code generator. Now I specify transformation rules in order to define appropriate abstractions on the model. The code generator now creates simple code fragments, that correspond to the desired level of abstraction, which is defined by the transformation rules.
The appropriate code fragments are reverse engineered to receive the UML representation of the appropriate model.
That UML model becomes the source of my forward engineering process. In my opinion innoQ's iQgen served me best, see http://www.innoq.com/iqgen. But this approach should be fine with other tools as well.

Posted by Phillip Ghadir at June 10, 2003 10:35 PM | TrackBack