Abstract and Precise Recovery of UML Class Diagram Constituents
1. Abstract and Precise Recovery of UML Class Diagram Constituents
Problem. Reverse-engineered UML class diagrams are neither abstract nor precise representations of
source code because of the loose definitions of UML constituents Yann-Gaël Guéhéneuc
Département d'informatique
et de recherche opérationnelle
Consequences. Reverse-engineered UML class diagrams are of little interest for software maintainers.
Université de Montréal
CP 6128 succ. Centre Ville
Solution. We perform an exhaustive study of UML class diagrams constituen ts with respect to their Montréal, Québec, H3C 3J7, Canada
recovery from C++, Java, and Smalltalk source code. We implement a tool suite, Ptidej, to reverse E-mail: guehene@iro.umontreal.ca
engineer Java source code abstractly and precisely (C++ is on th e way).
Example
Could be implemented as:
public class A { ... }
ArgoUML Fujaba Rational Rose
public class Example1 {
private A[] listOfAs = new A[10];
private int numberOfAs = 0;
public void addA(final A a) {
this.listOfAs[numberOfAs++] = a;
}
public A getA(final int index) {
return this.listOfAs[index];
Are reverse-engineered as:
}
public void removeA(final A a) {
// ...
}
public static void main(final String[] args) {
final Example1 example1 = new Example1();
example1.addA(new A());
// ... These class diagrams are neither abstract nor precise!
}
} OR
public class Example2 {
private List listOfAs = new ArrayList();
public void addA(final A a) {
this.listOfAs.add(a);
}
public A getA(final int index) {
return (A) this.listOfAs.remove(index);
}
public void removeA(final A a) {
this.listOfAs.remove(a);
}
public static void main(final String[] args) {
final Example2 example2 = new Example2();
example2.addA(new A());
// ...
}
}
Solution
Definitions. We say that something is abstract if it concentrates in itself the
essential qualities of anything more extensive or more general, or of several
things. Precision is the extent to which a given measurement agrees with a
standard value.
Languages. We study the C++, Java, and Smalltalk languages vs. UML
Study. We study the abstract and precise recovery of the UML class diagram
constituents: 36 constituents in 4 categories (classifiers, clas sifier features,
classifiers relationships, and miscellaneous).
Constituents Abstract Precise Tools Constituents Abstract Precise Tools
Attribute ü ü All Composition ü û IDEA, Ptidej
Method ü ü All Association Class û û IDEA
Operation ü ü Ptidej N-ary Association û û IDEA These class diagrams are abstract and precise.
Class ü ü All Multiplicity ü û IDEA, Ptidej
Nested Class û ü IDEA, Ptidej Qualifier ü û IDEA
Type ü ü Ptidej Generalisation û ü All
Implemenetation Class ü ü Ptidej Dependency û û None
Interface ü ü (ûStk ) All Link N/A N/A N/A
Parameterised Class ü (û Stk) ü (ûStk ) None Object N/A N/A N/A
Bound Element ü (û Stk) ü (ûStk ) None Composite Object N/A N/A N/A
Metaclass ü üStk None Derived Element û û None
Powertype û û None Instance Of üStk üStk None
Data Type ü (û Stk) ü (ûStk ) Ptidej Name Compartment N/A N/A N/A
Enumeration ü ü Ptidej List Compartment N/A N/A N/A
Utility Class ü ü Ptidej Class Pathname ü ü All
Binary Association ü ü IDEA, Ptidej, Accessing or Importing ü ü Ptidej, Rose,
Womble Package Together/J
Aggregation ü ü IDEA, Ptidej, Stereotype Declaration ü û None
Womble
Algorithms. We implement algorithms with the PADL meta-model from the Ptidej
tool suite (Pattern Trace, Identification, Detection, and Enhancement in Java).