Extracting Sequence Diagrams from Execution Traces using Interactive Visualization Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal.

Download Report

Transcript Extracting Sequence Diagrams from Execution Traces using Interactive Visualization Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal.

Extracting Sequence Diagrams from
Execution Traces using Interactive Visualization
Hassen Grati, Houari Sahraoui, Pierre Poulin
DIRO, Université de Montréal
2
Example of Design Diagram
Corresponding AutomatedRE Diagram
3
4
Presentation Agenda
•
•
•
•
•
Context and motivation
Overview
Trace generation and combination
Sequence diagram extraction
Evaluation
5
Context and Motivation
• Reverse engineering of analysis and
design models
– Comprehension
– Migration
– Maintenance
• Mature work on static model extraction
– Integrated in commercial tools
– Still few challenges
• Relationship recovery and scope definition
6
Context and Motivation
• Difficulty to extract behavioral models
– Static analysis
• Dynamic language features
– Dynamic analysis
• Implementation details
• Specificity to an execution trace
• Proposal
– Semi-automated reverse engineering with
interactive visualization
7
Overview
• Objective and working hypothesis
– Extraction of sequence diagrams for the purpose of
redocumentation for existing use case scenarios
T1
Use−case
Scenarios
Generation of
Execution Traces
Source
Code
Combined Trace
Combination of
Execution Traces
User
Input
Interactive
Visualization
Sequence
Diagram
T3
T2
8
Trace Generation and
Combination
• Generating traces from a scenario
– Determination of execution variants
– Code Instrumentation
• Method body, loop block, conditional block
– Example
1 _, PanelDraw [21668571], _, StartDraw [T1M1], _
2 PanelDraw [21668571], Figure [3916193], StartDraw
[T1M1], Figure [T1M2], _
…
9 PanelDraw [21668571], Circle [17282414], StartDraw
[T1M1], Circle [T1M9],
<%(State.getFiguretype()==MODE_CERCLE)%>
…
9
Trace Generation and
Combination
• Combining traces
– Recursive alignment of call-tree nodes
– For each pair of aligned methods, enclosed
sequence of method calls are compared
– Sequence alignment using the SmithWaterman algorithm
10
Trace Generation and
Combination
• Combining traces
– Example
11
Trace Generation and
Combination
• Combining traces
– Example
12
Sequence Diagram
Extraction
• Extraction = set of successive
interaction cycles
• Each cycle
– Automated basic transformations
– User interactions using interaction views
13
Sequence Diagram
Extraction
• Automated basic transformations
– Messages = method calls
– Participants = call sender and receiver
– opt/alt/loop boxes = conditional/loop
stacks
– Return messages extracted from the
tree structure
14
Sequence diagram
Extraction
• User interactions using interaction views
– Global view
• Messages
15
Sequence Diagram
Extraction
• User interactions using interaction views
– Global view
• Placement
16
Sequence Diagram
Extraction
• User interactions using interaction views
– Global view
• Placement
17
Sequence Diagram
Extraction
• User interactions using interaction views
– Diagram view
18
Sequence Diagram
Extraction
• User interactions using interaction views
– Interactions
• Navigation
19
Sequence Diagram
Extraction
• User interactions using interaction views
– Interactions
• Renaming objects and messages
• Removing objects and messages
– Tree pruning
– Node removal
• Recommending fragment merges
– Finding recommendations during trace alignments
– Based on polymorphism
20
Sequence Diagram
Extraction
• User interactions using interaction views
• Recommending fragment merges
21
Evaluation
• Setting
– ATM simulation system
• 24 Java classes
• www.math-cs.gordon.edu/local/courses/cs211/ATMExample/
– Three use-case scenarios
• Session, Deposit, and Withdraw
– Three sequence diagrams per scenario
• Design diagram (DD)
• Diagram extracted automatically (ATD) [Briand et al., 03]
• Diagram extracted using interactive visualization (IVD)
22
Evaluation
• Results
– Participants
12
10
8
DD
6
ATD
4
IVD
2
0
All
Relevant
Session
All
Relevant
Deposit
All
Relevant
Withdraw
23
Evaluation
• Results
– Messages
45
40
35
30
25
DD
20
ATD
15
IVD
10
5
0
All
Relevant
Session
All
Relevant
Deposit
All
Relevant
Withdraw
24
Conclusions
• Semi-automated approach
– Dynamic analysis
– Interactive visualization
– Recommendations
• Evaluation on a benchmark
– Concise diagrams with better precision
and less implementation details
– Acceptable interaction time
25
Limitations & Future Work
• Improve scalability of the global view
• Improve the recommendation module
– Incremental learning
• Apply IV to the reverse engineering of
other dynamic models
– State diagram
– Activity diagram
26
Thank you
27
Additional Slides
28
Session Scenario
29
Session Scenario
30
Session Scenario