Object-oriented programming has become very popular. The object-oriented features such as inheritance, encapsulation, and dynamic method invocation are very powerful and useful for software development. To support the lower phases of software development such as implementation and maintenance, many techniques and CASE (Computer Aided Software Engineering) tools such as a dependence analyzer for traditional procedural programs have been proposed and implemented. However, many of them are not applicable to object-oriented programs without modification because of the above object-oriented features.
Software engineers who propose this modification or new techniques for object-oriented programs have to verify their techniques by applying them to programs actually. They sometimes need to make routines that analyze source programs syntactically and semantically like as a compiler does. CASE tool developers also need to make these routines for designing and implementing CASE tools. %using proposed techniques. However, making analysis routines is very laborious work. If there are a generic analyzer and a repository that stores enough information of analyzed programs, each CASE tool developer can avoid such laborious work. We call an environment like this a CASE tool platform.
In this thesis, we propose Japid, a new CASE tool platform for an object-oriented language, Java. We establish three research goals with Japid: (1) letting developers free from laborious work such as making a syntax analyzer, (2) providing basic techniques for software development, and (3) developing new techniques for software development.
First, to achieve the research goal (1), we show the design and implementation of Japid. Japid is designed to meet following requirements: (i) providing enough information of source programs for developing CASE tools, (ii) providing a method for restructuring information of analyzed programs, and (iii) supporting changing source programs. The first requirement is related to the software model: what kind of abstract syntax tree is stored to a repository. The software model that we adopt is designed at the fine grain level; we also obtain coarse grained information by selecting and composing fine grained information provided by a platform. The second requirement is about view definition. Japid provides the view definition mechanism. Because a view is defined as classes of Java, a developer can reuse views defined by other developers. The last requirement is important because some CASE tools are developed for changing source programs: for example, a tool that removes unused variables and dead codes. Japid supports changing source programs under some constraints such as syntactic constraints, which guarantee changed programs to be free from syntax errors. This is implemented using the view definition mechanism. We show the effectiveness of Japid by some experiments: Japid provides enough information, API (Application Programming Interface), and acceptable performance for developing CASE tools.
Second, to achieve the research goals (2) and (3), we propose a new
control and data dependence graph, OSDG (Object-Oriented System
Dependence Graph). Dependence analysis is a basic, yet important
technique for software development. The OSDG is built at the
expression-grain level. It can express method composition and a data
dependence in a statement that has multiple occurrences of the same
variable, such as
a = f(a, g(a)). We also propose a method for
decreasing the amount of nodes and edges by changing granularity
of a graph:
we translate a graph that consists of expression nodes into a graph
that consists of statement nodes or of method nodes.
to this method, we can express our concerning point with a precise graph
at a fine grain level and other points with brief graphs at a coarse
grain level. We show implementation of the OSDG using Japid. Japid is
useful for constructing an OSDG because it provides fine grained
information such as statements and expressions.
We define nodes and edges of the OSDG as a user defined view
We also implement a method for changing granularity of a dependence graph
by using Japid.
% the view definition mechanism of Japid.
%This chapter is related with goals (2) and (3).
Finally, to achieve the research goal (3), we propose three approaches to specialization of object-oriented programs. The first approach is class fusion and reduction, which are techniques merging closely associated classes into a single class. The second approach is class slimming, which removes unused methods and variables from classes of a class library or from classes enlarged by class fusion and reduction. The last approach is static analysis of dynamic invocation. It replaces dynamically-dispatched method invocation with statically-dispatched one. These approaches resolve a dilemma of whether to write a program elegantly for easy maintenance or to tune it up for good performance.