pxc3874915

Post on 05-Apr-2018

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

  • 8/2/2019 pxc3874915

    1/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    36

    Reverse Engineering Java Code to Class

    Diagram: An Experience Report

    Shivani BudhkarAssistant ProfessorModern College of Engineering, Pune

    Maharashtra, India

    Dr. Arpita GopalProfessor & DirectorSIBAR, Pune

    Maharashtra, India

    ABSTRACTSoftware Engineering research and industry recognize the need

    for practical tools to support reverse engineering activities. Mostof the well-known CASE-tools nowadays support reverseengineering in some way or other. Reverse engineering is firststep towards software Architecture recovery. The most

    commonly used standard today is Unified Modeling Language

    to depict the architecture and design of an application. An UMLclass diagram describes the architecture of object orientedprograms. Class diagram captures the essence of its design.

    Most of the existing systems do not have reliable softwarearchitecture and some legacy systems are designed withoutsoftware architecture design phase. By using reverse engineeringtools we can generate class diagram as part of software

    architecture recovery.

    In this paper we assess capabilities of software reverseengineering tools to generate class diagram from java sourcecode.

    General TermsSoftware Architecture, CASE tools, UML, class diagram

    KeywordsReverse Engineering tools, EA, Reverse, Rose, NOC, NOA,NGR

    1. INTRODUCTIONIn the software engineering domain, UML [10] has grown to a

    widely known and readily used graphical standard forrepresenting various aspects of an object oriented softwaresystem. Its class diagram has proven to be particularly useful.They are the kind of specification that is to be reverse

    engineered in this work, with goal of architecture recovery.

    Reverse engineering is first step towards software Architecturerecovery. Software reverse engineering tools help in softwarearchitecture recovery.

    An UML class diagram describes the architecture of object

    oriented programs. Most of the object oriented systems do not

    have reliable systems architecture or designed without softwarearchitecture design phase. If such systems needs to be migratedinto component based system, reverse engineering is the first

    step. Most of the CASE tools help in reverse engineering withmost of the languages. For migrating into component basedsystem, class diagram need to be recovered from the objectoriented code. It shows classes and relationships between them.

    It is needed for creating components.

    In this paper, we exercised four different reverse engineering

    tools to generate class diagram from given source codes. Ouraim was to assess capabilities of reverse engineering tools togenerate class diagram from java source code, as it will help inreconstructing the software architecture from existing

    implemented software. The idea behind choosing these toolswas assessing different kinds of tools like commercial, noncommercial, open source tools that support reverse engineeringof java code. We have chosen tools Rose [6], ArgoUML[1],

    Reverse[5], Enterprise Architecture[4]

    We have examined these tools on simple java based programs.

    One of the experimented source code is Arithmetic24 Game,which is developed in Java by Huahai Yang [3]. It is a

    simulation of popular traditional card game.

    2. RELATED WORKThere is range of existing tools that can contribute to reverseengineering of java code. Some of the researchers havedeveloped their own tools to generate class diagrams. Various

    empirical studies on comparisons of reverse engineering andinformation extracting tools have been presented [[7]. [2]

    Martin Keschenau [9] compared his own developed toolclass2Uml with non- commercial tools like ArgoUML, Fujaba,Java2Uml, Idea etc. He identified query methods, association

    cardinalities and tried to recover more than just classes,methods.

    Yann Gael [12] compared his tool PTIDEJ with WOMBLEproposed by Jackson and Waingold a tool for lightweight

    extraction of object models i.e. class diagram, CHAVAproposed by Korn et al., a reverse engineering tool dedicated to

    Java applets, which reproduces exactly a program static model[7].

    Ralf Kollmann [11] examined Rose, Idea , Together andFujaba tools from industry and research and found that despiteof the constantly ongoing development, the advanced reverseengineering strategies have not been considered in these tools.

    Industrial and open source CASE tools such as AgroUML,Rational ROSE offer reverse engineering capabilities, but theircapabilities are very limited. They do not clearly define binaryclass relationships. They distinguish graphically the association,

    aggregation, and composition relationships, but their reverseengineering algorithms produce erroneous or inconsistentrelationships[13] Also all the relationships are not properlyextracted. These tools take a very concrete approach.

  • 8/2/2019 pxc3874915

    2/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    37

    3. A CASE STUDY3.1 Examined ToolsFour tools were selected in this study as they support javareverse engineering. These were

    Rational rose - Rational Rose [6] is a widely used commercial

    UML modeling tool. Rational Rose offer reverse engineeringcapabilities, but their capabilities are very limited.Rational Rosesupports reverse engineering of, Java software systems. Whenreverse engineering a Java program, Rose constructs a tree view

    that contains classes, interfaces, and association found at thehighest level. Methods, variables etc. are nested under the ownerclasses. Rose also constructs (on demand) a class diagramrepresentation of the extracted information and generates a

    default layout for it. Additionally, Rose automatically constructsa package hierarchy as a tree view. Rose is able to reverse

    engineer the information from the source code (.java files), bytecode (.class files), jar files, or packed zip files. In Rose, the Java

    reverse engineering module can be given instructions on files,directories, packages, and libraries to be examined.

    ArgoUML - ArgoUML[1] is a widely used open source tool forUML modeling tool. ArgoUML provides a modular reverseengineering framework. Currently Java source code is providedby default and there are modules for Java Jar and class fileimport. Similar to Rose ArgoUML constructs a tree view thatcontains classes, interfaces, and association found at the highest

    level. Methods, variables etc. are nested under the ownerclasses. Using Drag and drop facility user can create classdiagram. Reverse engineering capability of the tool is verylimited as it cannot extract association and interface.

    Reverse - Reverse is non commercial tool to convert java codeto class diagram developed by Neil Johan. [5] .User needs toselect main java file and tool automatically displays class

    diagram. Tool has extracted limited classes, but no interfaces.

    Hence, realization relationships have not been extracted. It wassuccessful in identifying most of the associations.

    Enterprise Architecture (EA) - Enterprise Architecture (EA)

    [4] is widely used commercial UML modeling tool. Tool

    generates tree view of classes and methods. Variables are nested

    under methods. EAs current reverse engineering capabilities

    can only reverse engineer UML semantics such as class

    diagrams and associations.

    3.2 Examined Model PropertiesNumber of Classes (NOC) -This is a general measure for the

    overall size of a software module. Therefore, high NOC valuesmay indicate a more detailed representation.

    Number of Associations (NOA) - NOA is a metric measure ofinterconnectedness in a module. In reverse engineering it is

    important to understand how classes are connected.

    Number of Generalization relationship (NGR) It models isa and is like relationships, enabling you to reuse existing dataand code easily. It is a generalization / specialization

    relationship between classes, which helps to measure howtightly coupled classes are. From reverse engineering point ofview it will help for concluding component structure.

    Handling of Interfaces - An interface is a specifier for theexternally-visible operations of a class, component, or otherclassifier (including subsystems) without specification ofinternal structure [10]. In UML diagrams, interfaces are drawn

    as classifier rectangles (with a stereotype >) or ascircles. The interfaces are attached by a dashed generalizationarrow to classifiers that support it, known as realizationrelationship [10]. This indicates that the class provides

    (implements) all of the operations of the interface. The circlenotation is used when the operations of the interface are hidden.A class that uses or requires the operations supplied by theinterface may be attached to the circle by a dashed arrow

    pointing to the circle. From the reverse engineering point ofview, generation of such dependencies is important forunderstanding the usage of interfaces and for concluding

    component structures and dependencies (e.g., to abstract classdiagrams to a component diagram). Furthermore, different waysof handling interfaces have impact on the NOC

    metric and possibly on the readability of the respective classdiagram[11].

    Role Names - The function of role names at association ends iscomparable to that of attribute names in the sense of giving to anassociation between classes a meaningful descriptor, which

    depends on the end its attached to. Therefore in reverseengineering, role names can hold relevant additional informationabout the system infrastructure. We examine, whether rolenames are used and if, what kind of information they represent.[11]

    4. RESULTS FROM THE TOOLSThe elements found by the CASE tools are summarized in table

    1 and shown in Figure 1 - 4.Classes - Rose, ArgoUML, and Enterprise Architecture wereable to find 19 classes. when applied to the *.java files ofArithmetic24.Tool reverse was able to find out only 17 classes

    as it accepts only main java file for reverse engineering. Thename compartment of the class reverse engineered by all thefour tools contains the name of the actual class. Both theattributes and operations compartments contain the names, typesand visibility (public, private or protected) for Rose, EA, and

    Reverse. But ArgoUML could not identify visibility.

    Associations - Total number of associations found by Rose and

    EA was 12.ArgoUML could not find any association. Reversefound 18 associations and showed mutually dependent classeswith red dashed line. Associations are directed in all casesexcept for ArgoUML. The roll is named by the variable itself.

    Rose and EA could produce roll names. For tool Reverse, associations are directional but do not specify any roles.

    None of the tool can specify multiplicities.

    http://www.neiljohan.com/projects/reverse/http://www.neiljohan.com/projects/reverse/
  • 8/2/2019 pxc3874915

    3/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    38

    Figure 1: Class Diagram of Arithmetic24 game from Rose

  • 8/2/2019 pxc3874915

    4/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    39

    Figure 2: Class Diagram of Arithmetic24 game from ArgoUML

  • 8/2/2019 pxc3874915

    5/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    40

    Figure 3: Class Diagram of Arithmetic24 game from Reverse

  • 8/2/2019 pxc3874915

    6/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    41

    cmp Component Model

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial Version EA 9.0 Unregistered Trial V

    Applet

    ActionListener

    ItemListener

    Observer

    Arithmetic24

    ~ badExpSound :Strin g = "Hah.au"

    ~ BEGINNER_TIME :int = 120 {readOnly}

    ~ clickDeckSound :String = "cli ck1.au"

    ~ clock :Clock

    ~ correctSound :String = "well_ done.au"

    ~ difficultyLevel :Choice

    ~ doneButton :Button

    ~ EXPERT_TIME :int = 60 {readOnly}

    ~ feedB ackLabel :Label

    ~ fillSlotSound :String = "click2.au"

    ~ INTERMEDIATE_TIME : int = 90 {readOnly}

    ~ noSolutionButton :Button

    ~ playi ngBoard :DraggingArea

    ~ score :ScoreKeeper

    ~ soundList :SoundLi st

    ~ timeOutSound :String = "bell.au"

    ~ wrongSound :String = "missed.au"

    + actionP erformed(ActionEvent) :void

    - beginWaitSolution() :void

    - en dWaitSol ution() :void

    + i nit() :void

    + itemS tateChanged(ItemEve nt) :void

    + start() :void

    ~ startLoadingSound s() :void

    + stop() :void

    + update(Observable, Object) :void

    Card

    ~ CLUB :int = 0 {readOnly}

    ~ DIAMOND :int = 1 {readOnly}

    ~ HEART :int = 2 {readOnly}

    ~ SPADE :in t = 3 {readOnly}

    ~ suit :int

    ~ SUIT_NAMES :String ([]) = { ... {readOnly}

    ~ value :int

    + Card(int, int, Image, DraggingArea)

    + Card(int, Image, DraggingArea)

    + Card(int, int, int, Image, DraggingA rea)+ ge tCardValue() :int

    + g etType() :int

    + getV alue() :Integer

    Runnable

    CardDeck

    ~ cardPoi nter :int

    ~ clickable :boolean

    ~ conta iner :DraggingArea

    ~ deck :Vector

    ~ solutions :SynchronizedVecto r ([])

    ~ soluti onThread :Thread

    + CardDeck(int, int, Image, Dragging Area)

    + currentDealNumber() :int

    + currentSol ution() :Vector+ deal() :Card[]

    + di sableClick() :void

    + en ableCli ck() :void

    + i sClickable() :boolea n

    + run() :void

    + setThreadPrio rity(int) :void

    + shuffle() :void

    + stop() :void

    CardSlot

    ~ HEIGHT :int = 99 {readOnly}

    ~ WIDTH :int = 75 {readOnly}

    + CardSlot(int, int)

    + ge tType() :int

    Canvas

    Runnable

    Clock

    ~ actionCommand :String

    ~ actionLi stener :ActionListener = null

    ~ clockThread :Thread = null

    ~ offScreenDi mension :Dimension

    ~ offScreenGraphics :Graphics

    ~ offScreenIm age :Image

    ~ timeLimit :int

    ~ timer :int

    ~ timeUnit :int

    + addActi onListener(ActionLi stener) :void

    + Clock(int)

    + Clock(int, int)

    - createOffScreen() :void

    + getMinimumSize() :Dimension

    + getPreferredSize() :Dimension

    + getTime() :int

    + getTimeLimit() :int

    + pa int(Graphics) :void

    + removeActi onListener(ActionL istener) :void

    + run() :void

    + setActionComm and(String) :void

    + setTimeLimit(int) :void

    + sourceActionEvent() :void

    + start() :void

    + stop() :void

    + update(Graphics) :void

    Panel

    Runnable

    DraggingArea

    ~ animating :boolean

    ~ applet :Applet

    ~ cardDeck :CardDeck

    ~ cardDeckImage :Image

    ~ cardImages :Image ([])

    ~ currentCards :Card ([])

    ~ defaul tCursor :Cursor

    ~ draggingSlots :DraggingSlot ([])

    ~ dragImages :Vector

    ~ dragT hread :Thread

    ~ grabPoint :Point

    ~ handCursor :Cursor

    ~ imageCount :int

    ~ offScreenDim ension :Dimension

    ~ offScreenGraphics :Graphics

    ~ offScreenIm age :Image

    ~ operatorImages :Image ([])

    ~ operators :Operator ([])

    ~ status :PlayingStatus

    ~ theMoving :DraggingImage

    ~ tracker :Medi aTracker

    ~ updateBottom :int

    ~ updateLeft :int

    ~ updateRight :int

    ~ updateTop :int

    + addCards() :void

    # addSlo ts() :void

    + arrangeOperators() :void

    + beginAnimation() :void

    + cl earSlots() :void

    + clipRepaint() :void

    + currentSol ution() :Vector

    + DraggingArea()

    # drawDragImages(Graphics) :void

    # drawDragSlots(Graphics) :void

    + endAnimation() :void

    + getMinimumSize() :Dimension

    + g etPreferredSize() :Dimension

    + i sFullExpression() :boole an

    + loadAllImages() :void

    + pa int(Graphics) :void

    + presentSolu tion() :void

    + removeCards() :void

    + resetClip() :void+ run() :void

    + setStatus(int) :void

    + start() :void

    + stop() :void

    + u pdate(Graphics) :void

    + userCreatedExpression() :Vector

    MouseMotionAdapterDraggingArea::MyMouseMotionAdapter

    + mouseDragged(MouseEvent) :void

    + m ouseMoved(MouseEvent) :void

    MouseAdapter

    DraggingArea::MyMouseAdapter

    + mousePressed(MouseEvent) :void

    + m ouseReleased(MouseEvent) :void

    DraggingImage

    ~ conta iner :DraggingArea

    ~ draggable :boolean

    ~ height :int

    ~ image :Image~ INITIAL_HEIGHT :i nt = 1 {readOnly}

    ~ INITIAL_WIDTH :int = 1 {readOnly}

    ~ slot :DraggingSl ot

    - tmpHeight :int

    - tmpWidth :int

    ~ tracker :Media Tracker

    ~ trueSizeKnown :boolean

    ~ width :int

    ~ x :int

    ~ y :int

    + centerAt(int, int) :void

    + contains(int, int) :boolean

    + d isableDrag() :void

    + DraggingImag e(Image, DraggingArea)

    + DraggingImag e(int, int, Image, DraggingArea)

    + e nableDrag() :void

    + getLocation() :Point

    + getMinimumSize() :Dimension

    + g etPreferredSize() :Dimension

    + ge tSize() :Dimension

    + getSl ot() :DraggingSl ot

    + i sDraggable () :boole an

    + i sSettled() :boolea n

    + pa int(Graphics) :void

    + setLocation(in t, int) :void

    + setSize(int, int) :void

    + settle(Dragging Slot) :void

    + u nsettle() :void

    DraggingSlot

    ~ CARD_SLOT :int = 0 {readOnly}

    ~ emptyColor :Col or = Color.cyan {readOnly}

    ~ fill Color :Color = Color.red {readOnly}

    ~ height :int

    ~ holdenImage :DraggingImage = null

    ~ OPERATOR_SLOT :i nt = 1 {readOnly}

    + type :int

    ~ width :int

    ~ x :int

    ~ y :int

    + contains(int, int) :boolean

    + DraggingSlot()

    + DraggingSlot(int, int, int, int)

    + e mpty() :void

    + fillWith(DraggingImage) :void

    + getHolde nImage() :DraggingImag e

    + getLocation() :Point

    + ge tSize() :Dimension

    + hol ds(Dragging Image) :boolea n

    + i sEmpty() :boolea n

    + kickOff(DraggingIma ge) :void

    + pa int(Graphics) :void

    + remove() :void

    + setLocation(in t, int) :void

    + setSize(int, int) :void

    + underneath(DraggingI mage) :boolea n

    Expression

    - CPAREN :int = 3 {readOnly}

    - currentValue :doubl e

    - DIV :int = 5 {readOnly}

    - EOL :int = 0 {readOnly}

    - INPUT_PRECEDENCE :i nt ([]) = { 0, 0, 100, 0,... {readOnly}

    # i nputExpression :String

    - lastToken :int

    - MINUS :int = 7 {readOnly}

    - MULT :int = 4 {readOnly}

    - OPAREN :int = 2 {readOnly}

    - operatorStack :Stack

    - PLUS :int = 6 {readOnly}

    - postFixStack :Stack

    - STACK_PRECEDENCE :int ([]) = { -1, 0, 0, 99,... {readOnly}

    - theResult :double

    - VALUE :int = 1 {readOnly}

    - applyOperation(int) :void

    + Expression()

    + Expression(String)

    + Expression(Vector)

    - getPostStackTop() :double

    + getVa lue() :double

    - isOperator(char) :boolea n

    - processToken() :void

    + setExpression(String) :void

    Exception

    IllegalExpressionException

    + IllegalExpressionException()

    + IllegalExpressionException(String)

    Observable

    ObservableInteger

    # value :int

    + ObservableInteger(int)

    + set(int) :void

    Operator

    ~ ADD :int = 0 {readOnly}

    ~ CPAREN :int = 5 {readOnly}

    ~ DIV :int = 3 {readOnly}

    ~ MINUS :int = 1 {readOnly}

    ~ MULTI :i nt = 2 {readOnly}

    ~ OP_NAMES :String ([]) = { ... {readOnly}

    ~ OP_NUMBER :int = 6 {readOnly}

    ~ OP_SYMBOLS :char ([]) = { '+', '-', '*'... {readOnly}

    ~ OPAREN :int = 4 {readOnly}

    ~ opId :int

    ~ opSymbol :char

    + ge tOpSymbol () :char

    + ge tType() :int

    + g etValue () :Character

    + Operator(int, Image, DraggingArea)

    + Operator(int, int, int, Image, DraggingArea)

    + Operator(char, Image, DraggingArea)

    OperatorSlot

    ~ HEIGHT :int = 40 {readOnly}

    ~ WIDTH :int = 27 {readOnly}

    + g etType() :int

    + OperatorSlot(int , int)

    PlayingStatus

    ~ DEALED :int = 1 {readOnly}

    ~ ROUND_OVER :int = 2 {readOnly}

    ~ WAITING :int = 0 {readOnly}

    + PlayingStatus()

    + PlayingStatus(int)

    Label

    ScoreKeeper

    ~ BEGINNER :double = 1 {readOnly}

    ~ EXPERT :doubl e = 2 {readOnly}

    ~ HAS_NO :int = -1 {readOnly}

    ~ HAS_RIGHT :int = 2 {readOnly}

    ~ HAS_WRONG :int = -2 {readOnly}

    ~ increase :int

    ~ INTERMEDIATE :doubl e = 1.5 {readOnly}~ levelWeight :double

    ~ NO_HAS :int = -2 {readOnly}

    ~ NO_NO :int = 1 {readOnly}

    ~ score :int

    ~ TIME_OUT :i nt = -1 {readOnly}

    + getScore() :int

    + resetScore() :void

    + ScoreKeeper()

    + setLevelWeig ht(double) :void

    + updateScore(int, double) :void

    Solution

    ~ hasSolution :boolean

    ~ NUM_POSITION :int ([]) = { 1, 4, 8, 11 } {readOnly}

    ~ numbers :Vector

    ~ numCombi n :Integer ([][])~ OP_POSITION :int ([]) = { 2, 6, 10 } {readOnly}

    ~ opCombin :int ([][])

    ~ PAREN_COMBIN :int ([][]) = { { 0, ... {readOnly}

    ~ PAREN_POSITION :int ([]) = { 0, 3, 5, 7, 9... {readOnly}

    ~ the Result :double

    ~ theSolu tion :Vector = null

    ~ TOTAL_P OSITION :int = 13 {readOnly}

    + getSol ution() :Vector

    + hasSoluti on() :boolea n

    - n umberCombina tion() :void

    - operatorCombinati on() :void

    - searchSolution () :void

    + Solution(int, int, int, int)

    java.util .Hashtable

    SoundList

    ~ applet :Applet

    ~ baseURL :URL

    + getClip(String) :AudioClip

    + playClip(String) :void

    + putClip(AudioClip, String) :void

    + SoundLi st(Applet, URL)

    + startLoadi ng(String) :void

    Thread

    SoundLoader

    ~ applet :Applet

    ~ baseURL :URL

    ~ rel ativeURL :String

    ~ soundList :SoundLi st

    + run() :void

    + SoundLoad er(Applet, SoundLi st, URL, String)

    SynchronizedVector

    - available :boolean

    - vector :Vector

    + get() :Vector

    + put(Vector) :void

    + SynchronizedVector()

    interface

    Type

    + CARD :int = 0

    + OPERATOR :int = 1

    + g etType() :int

    ~currentCards

    ~clock

    ~playingBoard

    ~score

    ~soundList

    ~container

    ~solutions~cardDeck

    ~soundList

    ~draggingSlots

    ~operators

    ~status

    ~theMoving

    ~container

    ~slot

    ~holdenImage

    Figure 4: Class Diagram of Arithmetic24 game from EA

  • 8/2/2019 pxc3874915

    7/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    42

    Table 1: Elements found by CASE Tools

    Tools No. of Classes No. of Association No. of Roll names No. of Interfaces No. of Generalization No. of Realizations

    Rational rose 19 12 14 1 6 4

    ArgoUML 19 0 0 0 6 0

    Reverse 17 18 0 0 6 0

    EA 19 12 15 1 6 4

    Generalization - All the four tools were able to recognize

    generalization relationships. All of them found total 6 suchrelationships

    Handling of Interfaces - Rose uses a circle to illustrateinterfaces in the class diagram. The (abstract) methods of theinterfaces are written below the circle, separated with two

    horizontal lines, which is not the style recommended in UML.

    EA illustrates them using class rectangles with astereotype shown above the interface name. This notation is alsoavailable as an option in Rose.

    Both Rose and EA found one interface in the Arithmetic24 corepackage. Both connect the interfaces to the classes that supportthem, that is, the classes that implement the abstract methods

    defined in the interfaces. Rose does that with a solid line (arealization relationship). EA uses a dashed line with a triangleatthe end pointing to the interface (similar to the inheritancenotation).

    However, neither Rose nor EA were able to generate anydependencies between interfaces and the classes that use them(typically shown with a dashed arrow from a class pointing to

    the interface). This is an obvious limitation to understanding theroles of the interfaces. Further, interface dependencies areneeded for abstracting a class diagram into a componentdiagram, understanding the interaction among different

    components, etc. Tools Reverse and ArgoUML could not ableto extract interface.

    5. SUMMARY AND CONCLUSIONIn the present study we have assessed capabilities of foursoftware reverse engineering tools that generate class diagram

    from java source code. We have found that, even, if most of theclasses are identified with simpler relationships, tools havelimited capabilities for identifying indirect or complex

    relationships.

    The motivation for this paper is to find out to what extent toolssupport reverse engineering. In the present study, four tools have

    been compared with regards to their reverse engineeringcapabilities. We have carried out manual comparisons. The

    manual comparison is needed to understand the interpretationsand mappings used to generate a class diagram.

    Examination of the features of some well-known tools ([1], [4],

    [5], [6]) has shown that it is difficult to reverse engineer classdiagrams elements beyond the class boxes themselves or simplerrelationships. Additionally, not all the classes, interfaces,

    multiplicity are properly recovered from the code. We haveexperimented above tools on simple java based programs .Wehave observed that, for the same source code different tools

    gives different results. The same was found in case of

    Arithmetic24 Game. [3]We observed that most of the classes are extracted by all thefour tools but all the relationships have not been extractedproperly. The simpler inheritance, associations and realizationrelationships were extracted. Few of the classes remainedunrelated to any of the classes in the diagram; even if source

    code shows the classes are related. ArgoUML and Reverse wereunable to extract interfaces and realization relationships.

    All the above tools, except Reverse needs to drag and drop the

    classes to complete class diagram, once reverse engineering iscomplete. Reverse automatically generates the class diagram butall classes are not extracted.

    Our examination shows that although all tools provide reverse

    engineering facility, most of them are able to recognize basicfeatures like classes and associations .ArgoUML could not showthat. Several advanced concepts like multiplicity, inverse

    association etc have not been addressed in these tools.

    6. REFERENCES[1] ArgoUML, http://argouml.tigris.org/ is a widely used open

    source tool for UML modeling tool.

    [2] B. Bellay and H. Gall. A comparison of four reverseengineering tools. In 4th Working Conference on ReverseEngineering, pages 211. The Netherlands, 1997.

    [3] http://javaboutique.internet.com/arith24/ :- Arithmetic 24Game, which is developed in Java by Huahai Yang. It is a

    simulation of popular traditional card game.

    [4] http://www.sparxsystems.com/products/ea/downloads.html:- Enterprise Architecture (EA) is widely used commercialUML modeling tool.

    [5] http://www.neiljohan.com/projects/reverse/ :- Reverse isnon commercial tool to convert java code to class diagramdeveloped by Neil Johan.

    [6] IBM Rational Rose Enterprise Edition

    http://argouml.tigris.org/http://javaboutique.internet.com/arith24/http://www.sparxsystems.com/products/ea/downloads.htmlhttp://www.neiljohan.com/projects/reverse/http://www.neiljohan.com/projects/reverse/http://www.sparxsystems.com/products/ea/downloads.htmlhttp://javaboutique.internet.com/arith24/http://argouml.tigris.org/
  • 8/2/2019 pxc3874915

    8/8

    International Journal of Computer Applications (09758887)

    Volume 29No.6, September 2011

    43

    [7] Jeffrey Korn, Yih-Farn Chen and Eleftherios Koutsofios.Chava: Reverse Engineering and Tracking of Java Applets

    [8] M. Armstrong and C. Trudeau. Evaluating ArchitecturalExtractors. In 5th Working Conference on ReverseEngineering, pages 3039. Hawaii, USA, 1998.

    [9] Martin Keschenau. Reverse Engineering of UMLspecifications from java programs, Student ResearchCompetition (OOPSLA04)

    [10]OMG: UML specification version 1.4[11] Ralf Kollmann , Petri Selonen , Eleni Stroulia , Tarja

    Systa_ , Albert Zundorf_A Study on the Current State of

    the Art in Tool-Supported UML-Based Static ReverseEngineering In Elizabeth Burd and Arie van Deursen,editors, Proc. 9thWorking Conference on Reverse

    Engineering. IEEE, Los Alamitos, 2002

    [12]Yann-Ga el Gueheneuc. A reverse Engineering Tool forPrecise class diagram.(2004)

    [13]Yann-Ga el Gueheneuc and Herve Albin-Amiot,Recovering Binary Class Relationships: Putting Icing onthe UML Cake- OOPSLA04, Oct. 24-28, 2004,Vancouver, British Columbia, Canada.

top related