Composition Inference for UML Class Diagrams

Composition Inference for UML Class Diagrams Ana Milanova Knowing which associations are compositions is important in a tool for the reverse engineering of UML class diagrams. Firstly, recovery of composition relationships bridges the gap between design and code. Secondly, since composition rela- tionships explicitly state a requirement that certain repre- sentations cannot be exposed, it is important to determine if this requirement is met by component code. Verifying that compositions are implemented properly may prevent serious program °aws due to representation exposure. We propose an implementation-level composition model based on ownership and a novel approach for identifying compositions in Java software. Our approach is based on a static ownership inference; it is parameterized by class anal- ysis and is designed to work on incomplete programs. We present empirical results from one instantiation of our ap- proach. In our experiments, on average 40% of the examined ¯elds account for relationships that are identi¯ed as compo- sitions. We also present a precision evaluation which shows that for our code base our analysis achieves almost perfect precision|that is, it almost never misses composition rela- tionships. The results indicate that precise identi¯cation of interclass relationships can be done with a simple and in- expensive analysis, and thus can be easily incorporated in reverse engineering tools that support iterative model-driven development. Department of Computer Science, Rensselaer Polytechnic Institute, Troy, NY cs-06-06

Composition Inference for UML Class Diagrams

Ana Milanova

Knowing which associations are compositions is important in a tool for the reverse engineering of UML class diagrams. Firstly, recovery of composition relationships bridges the gap between design and code. Secondly, since composition rela- tionships explicitly state a requirement that certain repre- sentations cannot be exposed, it is important to determine if this requirement is met by component code. Verifying that compositions are implemented properly may prevent serious program °aws due to representation exposure. We propose an implementation-level composition model based on ownership and a novel approach for identifying compositions in Java software. Our approach is based on a static ownership inference; it is parameterized by class anal- ysis and is designed to work on incomplete programs. We present empirical results from one instantiation of our ap- proach. In our experiments, on average 40% of the examined ¯elds account for relationships that are identi¯ed as compo- sitions. We also present a precision evaluation which shows that for our code base our analysis achieves almost perfect precision|that is, it almost never misses composition rela- tionships. The results indicate that precise identi¯cation of interclass relationships can be done with a simple and in- expensive analysis, and thus can be easily incorporated in reverse engineering tools that support iterative model-driven development.

Department of Computer Science, Rensselaer Polytechnic Institute, Troy, NY

cs-06-06