Extracting Sequence Diagram from Execution Trace of Java Program - PowerPoint PPT Presentation

About This Presentation
Title:

Extracting Sequence Diagram from Execution Trace of Java Program

Description:

We define annotation symbols for each compaction rule ... Gemini:Code clone analyzer. Scheduler: ... The execution trace of Gemini was most compacted one. ... – PowerPoint PPT presentation

Number of Views:274
Avg rating:3.0/5.0
Slides: 28
Provided by: yhi
Category:

less

Transcript and Presenter's Notes

Title: Extracting Sequence Diagram from Execution Trace of Java Program


1
Extracting Sequence Diagram from Execution Trace
of Java Program
Koji Taniguchi , Takashi Ishio,Toshihiro
Kamiya, Shinji Kusumoto, Katsuro
Inoue Osaka University, Japan Japan Science
and Technology Agency, Japan
2
Documents of Evolving Software
  • Software is being changed by fixing bugs,
    modifying functions or adding new functions
  • Owing to such changes
  • No documents may represent the behavior of the
    software correctly because the software is
    repeatedly changed but the documents are not
    updated
  • It makes understanding of program behavior
    difficult.
  • Especially in object oriented programs
  • We need reverse engineering techniques to recover
    some documents from a program.

3
Object Oriented Program Understanding
  • Features of Object Oriented Program
  • Many objects are concerned with a function
  • Owing to dynamic binding and extending, dynamic
    behavior of a program differs from static
    description
  • Message exchanges become more compress as
    increases of objects
  • It is difficult to understand dynamic behavior of
    objects from source codes
  • We need some documents that show dynamic behavior
    of objects

4
Visualizing Dynamic Behavior of Objects
  • UML Sequence Diagram
  • It shows two kind of messages
  • Method Call
  • Object Generation
  • Showing this diagram, we can understand dynamic
    behavior of objects
  • We try to extract sequence diagram by dynamic
    analysis of a program

5
A Problem of Dynamic Analysis
  • The amount of information of an execution trace
    is very huge
  • Because an execution trace is recorded all method
    calls which occurred in loop and recursive call
    structures.
  • If we show all of them in a diagram, we can not
    understand easily
  • We need a method to reduce information
  • We propose a method that detects some repetition
    patterns from execution trace and abstracts them
    by replacing with a representative of a repetition

6
How to Extract Sequence Diagram
  • Get the execution trace
  • Compact the execution trace
  • Draw the Sequence Diagrams from the compacted
    execution trace

7
Step1 Execution Traces
  • The execution trace records the two event Enter
    Method and Exit Method
  • we treat the constructor as the one kind of the
    method
  • Recorded information
  • When a Enter Method event occurred
  • Package name, Class name and Object-ID of a
    callee object
  • Signature of a method.
  • When a Exit Method event occurred
  • The method exit mark

8
Step2 Compaction of Execution Trace
  • Since an execution trace records many
    information, we need a method to reduce it
  • Our method detects some repetitions from
    execution trace and abstracts them by replacing
    with a representative of repetition
  • To compact the execution trace, we propose four
    Compaction Rules
  • Rules that compact some repetition patterns
  • R1 Completely same repetition
  • R2 Allowing different objects repetition
  • R3 Lack of method calls repetition
  • Rule that compacts recursive calls
  • R4 Recursive call structure

9
Rule R1 Completely Same Repetition
  • R1 compacts a repetition of completely same
    method call structure

first time of the repetition
second time of the repetition
10
Rule R2 Allowing Different Objects Repetition
  • R2 compacts a repetition of method call structure
    whose objects may be different

first time of the repetition
second time of the repetition
11
Rule R3 Lack of Method Calls Repetition
  • R3 compacts a repetition of method call structure
    some of whose method calls may be lacked

first time of the repetition
second time of the repetition
12
Rule R4 Recursive Call Structure
  • R4 compacts recursive call structure by
    reconstructing it to be simple
  • R4 also not considers object ID

13
Step3Drawing Sequence Diagram
  • Draw a sequence diagram from a compacted
    execution trace
  • We define annotation symbols for each compaction
    rule
  • Compacted parts are drawn with them in the
    sequence diagram

14
How to draw non-compacted parts
15
Annotation for R1
R1
2
16
Annotation for R2
R2
2
A1
B2,3
a()
b()
17
Annotation for R3
2
R3
?
18
Annotation for R4
R4
R
?
A1,2
B3,4
rec a()
a()
rec a()
b()
19
Case Study
  • Case study processes as followings
  • Get execution traces from four Java program
  • jEditText Editor
  • GeminiCode clone analyzer
  • SchedulerSchedule management tool
  • LogCompactorThe module of our tool that compacts
    execution traces
  • Apply four rules to four execution traces.
  • The order of applying rules is R4?R1?R2?R3
  • Generate Sequence Diagrams

20
Result of Compaction
21
Sequence Diagram
Over View of the Diagram
22
Unified objects
Repetition
23
Summary
  • For Object Oriented program understanding
  • It is necessary to understand dynamic behavior of
    objects.
  • We try to make sequence diagrams from execution
    trace
  • The amount of the program execution trace tends
    to be very large
  • We proposed a method to reduce information by
    compacting repetition part of the execution
    trace.
  • Draw the sequence diagram from the compacted
    execution trace
  • We can extract the simple sequence diagram that
    shows dynamic behavior of objects

24
End
25
Compaction (3)
Method
  • The prot of the methods which recorded the
    compacted execution trace of Gemini
  • The execution trace of Gemini was most compacted
    one.
  • But we can see some repetition of the method
    calls remain.
  • We need the more effective compaction rules

26
(No Transcript)
27
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com