COMPUTING SEMINAR


Title:Part1: Cjj: a subset of C++ compliant with Java
Part2: Reverse Engineering of the UML Class Diagram from C++ Code in Presence of Weakly Typed Containers
Speakers:Paolo Tonella / ITC-irst
Date :Wednesday 12 July 2000 at 16:00hrs
Place :IT Auditorium, bldg 31/3-005
Information:http://wwwinfo.cern.ch/seminars
Organiser:G.Folger / IT

ABSTRACT

Part 1:

The C++ programming language offers a wide range of coding alternatives to programmers. Some language characteristics inherited from C are potential sources of problems during the evolution of the system. Global variables, arbitrary branches, pointers, memory management instructions and macro directives are examples of them. The resulting code may be difficult to understand, maintain and test, if such language features are used without proper discipline. The Java language was designed with the explicit goal of excluding all troublesome features that can be found in C++, by disregarding some of them (e.g., globals), and disciplining other ones (e.g., pointers). For several companies the migration to Java is not strategically feasible. Nevertheless, the adoption of its philosophy within C++ code could help improve the quality of the software. In this talk a subset of C++, named Cjj, is presented which is compliant with Java, in that it enforces a Java-like programming style, while forbidding all C++ constructs that are in contrast with it. A tool for the verification of the compliance of an input source with Cjj was developed. It verifies if any of the constraints defining Cjj is violated.

Part 2:

The Unified Modeling Language (UML) is becoming a standard for the design and development of object oriented systems. Its usage during the inception step of the development process allows describing the system at a high level, thereby hiding irrelevant details and providing a common language for discussing about design rationale and alternative decisions. UML diagrams, and in particular the most frequently used one, the class diagram, represent a valuable source of information even after the delivery of the system, when it enters the maintenance phase. Several tools provide a reverse engineering engine to recover it directly from the code. In this talk, an algorithm is proposed for the improvement of the accuracy of the UML class diagram extracted from the code. Specifically, important information about inter-class relations may be missed in a reverse engineered class diagram, when weakly typed containers, i.e., containers collecting objects whose type is the top of the inheritance hierarchy, are employed. In fact, the class of the contained objects is not directly known, and therefore no relation with it is apparent from the container declaration. The container type inference algorithm we propose is based on a flow insensitive propagation of type information along all variables that can store a reference to the contained objects. Details are provided for its implementation with reference to the C++ language. A tool was then developed for the reverse engineering of the UML class diagram from C++ code, which exploits the proposed algorithm.