View Full Document


Unformatted text preview:

Gadget A Tool for Extracting the Dynamic Structure of Java Programs Juan Gargiulo and Spiros Mancoridis Department of Mathematics Computer Science Drexel University Philadelphia PA USA e mail gjgargiu smancori mcs drexel edu Abstract Source code analysis and inspection does not provide enough information to describe the structure of an objectoriented program completely because there are components and relations that only exist during its runtime This paper presents a tool called Gadget that helps software engineers extract the dynamic structure of objectoriented programs written in the Java programming language The tool uses program profiling filtering and graph clustering techniques In this work we show how Gadget is used to analyze a standard graphical user interface library for Java called Swing This library has a complex structure part of which we expose using data gathered by Gadget during the execution of a simple Java program that uses Swing 1 Introduction As the size of a software system increases so does the complexity of its structure The use of object oriented OO development techniques and languages helps programmers manage this complexity by supporting data abstraction encapsulation polymorphism and reuse However the OO approach makes understanding the structure of these systems more difficult because of features such as dynamic binding and polymorphism Understanding the dynamic structure of a system is helpful during software maintenance The dynamic structure of an OO program shows which objects are created and what messages are sent between these objects at runtime Dynamic analysis can be used to complement static sourcelevel inspection and analysis which may not provide all of the information software engineers need in order to understand an OO system For example the Factory OO design pattern 3 is used to manufacture objects and make these objects accessible to client objects through an abstract interface at runtime Static analysis using a tool such as Chava 6 would only reveal part of the complete design Specifically it would reveal the relationship between the client class and the Factory class but not between the client and the objects that were created by the Factory at runtime This paper describes a tool called Gadget to help software engineers extract the dynamic structure of Java programs In the profiling phase the tool gathers runtime data from the executing program This data captures class loading object creation and method invocation events In the analysis phase the tool uses filtering and abstraction techniques to select classes of interest The instances of these classes and their runtime relations are then displayed as a graph In general one or more features of the target program is analyzed at a time e g the Save feature of a word processing program The recording of events that occur during the execution of a feature is called tracing and the collection of trace data is called a profile The profile is analyzed by the tool and the dynamic structure of the objects and relations involved in the trace is shown as a DDG Dynamic Dependency Graph A DDG is a graph where nodes represent classes or objects and edges represent relations i e method invocation between two objects or between a static class and an object A method invocation can be an object creation i e call to a constructor method or a simple method call Gadget uses a tool from AT T Research called dotty 4 to display the DDGs An example of a DDG is shown in Figure 7 Additionally Gadget uses a clustering algorithm to partition the DDGs thus presenting the dynamic structures in a modular fashion that is easier to understand Figure 1 shows the architecture of Gadget which consists of three main components Control Repository and Profiler The Control and Profiler components execute on different Java Virtual Machines JVMs The Control component contains Gadget s execution and analysis engines i e Gadget Executor and Gadget Analyzer The execution engine is in charge of the execution of Gadget and has some control of the execution of the target program being Target Application Profiler SergProf JVMPI JVM2 Repository Control De Paw Helm Kimelman and Vlissides 12 have created a library for extracting and animating the behavior of OO systems They present summary information about the execution of a program using a chart like visualization They also present techniques to instrument OO programs so that their executions can be traced Profiling Data file Gadget Executor Gadget Analyzer stantiation patterns during the execution of a program His approach requires tracing the execution of the program being analyzed and then visualizing the dynamic data captured by the trace This work is concerned with searching for solutions to the problem of visualizing large data sets of runtime data It also focuses on detecting inconsistencies between the design and implementation of software systems JVM1 USER Figure 1 Software Architecture of Gadget analyzed The analysis engine is in charge of managing the analysis process logic This includes the interaction with the repository and the interaction with the user interface Gadget s repository is an external file that contains data about the execution of the target program This file is first written by the profiler and then read by the analysis engine The Profiler component is in charge of running the target program through the SergProf profiling interface which is our implementation of Sun Microsystem s Java Virtual Machine Profiling Interface JVMPI 13 SergProf traces class loading object allocation method invocation and stack information at the time an object is allocated The structure of the rest of this paper is as follows Section 2 provides an overview of related research Section 3 provides background information about the Pluggable Look and Feel PLAF feature of the Java Swing library Section 4 uses Gadget to extract the structure of the PLAF feature This section presents the basic features of Gadget and shows screen captures of the tool as well as the results of the PLAF feature s analysis Section 5 concludes with a summary of the paper an outline of the contributions made and a list of the limitations of the current version of Gadget 2 Background In this section we outline the body of work that is most closely related to the work presented in this paper At the end of the section we state the distinguishing characteristics of our work Jerding s 5 approach to supporting OO

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...

Join to view Gadget and access 3M+ class-specific study document.

We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Gadget and access 3M+ class-specific study document.


By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?