Font Size: a A A

Research And Implementation Of The Class Hierarchy Analysis For Java Language Based On Concept Lattice

Posted on:2006-10-17Degree:MasterType:Thesis
Country:ChinaCandidate:J XiongFull Text:PDF
GTID:2168360155953126Subject:Computer system architecture
Abstract/Summary:PDF Full Text Request
Object-oriented programming developed as the dominant programming methodology during the mid-1980s. Although most object-oriented systems start off with a clean and well-designed state, with the change of the requirement, these systems to some extent gradually decay in quality. These decayed legacy systems are often hard to maintain, improve, and expand because there is a general lack of understanding of the system; the designers of the system have left the organization, so there is no one left to explain how it works. Such a lack of understanding can be exacerbated by inadequate documentation, or manuals getting lost over the years. Integration with newer systems may also be difficult because new software may use completely different technologies. In order to maintain and improve such legacy system, people have to reread and reunderstand its source code. However, this hard task may cost tremendous. To levitate the money and human cost of maintaining legacy system, this paper promotes a new tool based on FCA (Formal concept analysis) to generate diagrams of class for the code maintainers to help them gain better understanding of the code. And thus they could find the defect of the system and get the refactoring solution for the bug. As we know, class is the key definition in an Object-oriented language. In a legacy system with object-oriented programming language, there are usually thousand and thousand classes with complicated structure and relationships. Understanding these classes becomes the main obstacle for maintainers. Fortunately, FCA could be an effective methodology to analyze the structure and relationship between these classes. In general, FCA(Formal concept analysis) is a method of data analysis that takes an input matrix specifying a set of objects and the properties thereof, and finds both all the "natural" clusters of properties and all the "natural" clusters of objects in the input data, where a "natural" property cluster is a set of properties in the input matrix that are individually necessary and jointly sufficient for picking out some non-empty subset of the objects in the input data, and a "natural" object cluster is a set of objects in the input matrix that can be picked out exactly by one of the natural property clusters. Thus, we could find the relationship clearly between the classes by FCA. In this paper, we present the mapping rules from Java source code to Concept Lattice model based on FCA. We use a top-down algorithm based on optimal-Bordat algorithms. First, by analyzing a single Java class, we get the set of its fields and the set of its methods. Then, we could form the binary relationship between these two sets according to which fields could be accessed by certain methods. According to this relationship, we could establish the context of the class and the concept lattice of the class. However, the procedure of establishment of the context of a complex class is difficult, for we have to filter and select which information of class is useful for our analysis. In this paper,we use the new term called "Subcontext", which is the sub context of the complete context. We not only present how to create subcontext in the analysis of the context of a class, we also give several example to prove creating a subcontext for the selection option is an efficient way to simplify the procedure of establishing the context. With the help of FCA and our mapping rules, our tool could generate diagram of concept lattice (Hasse diagram) for the legacy system with Java programming language. In general, our tool could work with three steps for analyzing a class: Learning its interface, examining its implementation, and then inspecting its code. Firstly, learning the interface of the analyzed class. A class implements (or realizes) one or more interfaces. Each interface specifies operation signatures of some of the methods of the class. An interface of a class describes the possible behaviors of objects of the class from user's point of view. According to the interface of the analyzed class, we could construct the context of the class and the concept lattice of the class. At this procedure, we could divide the concepts in the concept lattice into several layers, the concepts of each layers have similar topological properties. Thus, we import the term of "horizontally decomposable lattice"based on layers. Besides, we also import the term of "Abstract concept". In an Abstract lattice, methods that use the same set of fields are in the same concept, and sets of the methods that are used together are in the same cluster. By examining Abstract lattice, we can find redundant relationship between concepts. After procedure one, we could gain basic idea about the structure of a class, especially the part that exposes to other class.
Keywords/Search Tags:Implementation
PDF Full Text Request
Related items