DOC PREVIEW
Gadget

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Gadget: A Tool for Extracting the Dynamic Structure of Java ProgramsJuan Gargiulo and Spiros MancoridisDepartment of Mathematics & Computer ScienceDrexel UniversityPhiladelphia, PA, USAe-mail:gjgargiu,smancori@mcs.drexel.eduAbstractSource code analysis and inspection does not provideenough information to describe the structure of an object-oriented program completely because there are componentsand relations that only exist during its runtime.This paper presents a tool, called Gadget, that helpssoftware engineers extract the dynamic structure of object-oriented programs written in the Java programming lan-guage. The tool uses program profiling, filtering, and graphclustering techniques.In this work we show how Gadget is used to analyze astandard graphical user interface library for Java, calledSwing. This library has a complex structure, part of whichwe expose using data gathered by Gadget during the execu-tion of a simple Java program that uses Swing.1. IntroductionAs the size of a software system increases, so does thecomplexity of its structure. The use of object-oriented (OO)development techniques and languages helps programmersmanage this complexity by supporting data abstraction, en-capsulation, polymorphism, and reuse. However, the OOapproach makes understanding the structure of these sys-tems more difficult because of features such as dynamicbinding and polymorphism.Understanding the dynamic structure of a system is help-ful during software maintenance. The dynamic structure ofan OO program shows which objects are created and whatmessages are sent between these objects at runtime. Dy-namic analysis can be used to complement static source-level inspection and analysis, which may not provide all ofthe information software engineers need in order to under-stand an OO system. For example, the Factory OO designpattern [3] is used to “manufacture” objects and make theseobjects accessible to client objects through an abstract in-terface at runtime. Static analysis, using a tool such asChava [6], would only reveal part of the complete design.Specifically, it would reveal the relationship between theclient class and the Factory class but not between the clientand the objects that were created by the Factory at runtime.This paper describes a tool, called Gadget, to help soft-ware engineers extract the dynamic structure of Java pro-grams. In the profiling phase the tool gathers runtime datafrom the executing program. This data captures class load-ing, object creation, and method invocation events. In theanalysis phase the tool uses filtering and abstraction tech-niques to select classes of interest. The instances of theseclasses and their runtime relations are then displayed as agraph.In general, one or more features of the target program isanalyzed at a time (e.g., the Save feature of a word process-ing program). The recording of events that occur during theexecution of a feature is called tracing, and the collectionof trace data is called a profile. The profile is analyzed bythe tool and the dynamic structure of the objects and rela-tions involved in the trace is shown as a DDG (DynamicDependency Graph). A DDG is a graph where nodes rep-resent classes or objects and edges represent relations (i.e.,method invocation) between two objects or between a staticclass and an object. A method invocation can be an ob-ject creation (i.e., call to a constructor method) or a sim-ple method call. Gadget uses a tool from AT&T Researchcalled dotty [4] to display the DDGs. An example of a DDGis shown in Figure 7.Additionally, Gadget uses a clustering algorithm to par-tition the DDGs, thus presenting the dynamic structures ina modular fashion that is easier to understand.Figure 1 shows the architecture of Gadget, which con-sists of three main components: Control, Repository, andProfiler. The Control and Profiler components execute ondifferent Java Virtual Machines (JVMs). The Control com-ponent contains Gadget’s execution and analysis engines(i.e., Gadget Executor and Gadget Analyzer). The execu-tion engine is in charge of the execution of Gadget and hassome control of the execution of the target program beingProfiling DataJVM2(file)SergProfJVMPITargetApplicationRepositoryProfilerAnalyzerGadgetExecutorGadgetUSERControlJVM1Figure 1. Software Architecture of Gadget.analyzed. The analysis engine is in charge of managingthe analysis process logic. This includes the interactionwith the repository and the interaction with the user inter-face. Gadget’s repository is an external file that containsdata about the execution of the target program. This fileis first written by the profiler and then read by the analy-sis engine. The Profiler component is in charge of runningthe target program through the SergProf profiling interface,which is our implementation of Sun Microsystem’s JavaVirtual Machine Profiling Interface (JVMPI) [13]. SergProftraces class loading, object allocation, method invocationand stack information at the time an object is allocated.The structure of the rest of this paper is as follows: Sec-tion 2 provides an overview of related research. Section 3provides background information about the Pluggable Lookand Feel (PLAF) feature of the Java Swing library. Sec-tion 4 uses Gadget to extract the structure of the PLAF fea-ture. This section presents the basic features of Gadget andshows screen captures of the tool, as well as the results ofthe PLAF feature’s analysis. Section 5 concludes with asummary of the paper, an outline of the contributions made,and a list of the limitations of the current version of Gadget.2. BackgroundIn this section we outline the body of work that is mostclosely related to the work presented in this paper. At theend of the section we state the distinguishing characteristicsof our work.Jerding’s [5] approach to supporting OO program under-standing is based on visualizing object interactions and in-stantiation patterns during the execution of a program. Hisapproach requires tracing the execution of the program be-ing analyzed and then visualizing the dynamic data capturedby the trace. This work is concerned with searching for so-lutions to the problem of visualizing large data sets of run-time data. It also focuses on detecting inconsistencies be-tween the design and implementation of software systems.De Paw, Helm, Kimelman and Vlissides [12] have cre-ated a library for extracting and animating the behaviorof OO systems. They present summary


Gadget

Download Gadget
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

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

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

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

or

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

Already a member?