300 likes | 449 Views
Extracting Sequence Diagrams from Execution Traces using Interactive Visualization. Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal. Example of Design Diagram. Corresponding Automated- RE Diagram. Presentation Agenda. Context and motivation Overview
E N D
Extracting Sequence Diagrams from Execution Traces using Interactive Visualization Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal
Presentation Agenda • Context and motivation • Overview • Trace generation and combination • Sequence diagram extraction • Evaluation
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
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
Overview Generation of Execution Traces T1 Use−case Scenarios T2 T3 Combination of Execution Traces • Objective and working hypothesis • Extraction of sequence diagrams for the purpose of redocumentation for existing use case scenarios Source Code Combined Trace Interactive Visualization User Input Sequence Diagram
Trace Generation and Combination • Generating traces from a scenario • Determination of execution variants • Code Instrumentation • Method body, loop block, conditional block • Example • _, PanelDraw [21668571], _, StartDraw [T1M1], _ • PanelDraw [21668571], Figure [3916193], StartDraw [T1M1], Figure [T1M2], _ … • PanelDraw [21668571], Circle [17282414], StartDraw [T1M1], Circle [T1M9], <%(State.getFiguretype()==MODE_CERCLE)%> …
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 Smith-Waterman algorithm
Trace Generation and Combination • Combining traces • Example
Trace Generation and Combination • Combining traces • Example
Sequence Diagram Extraction • Extraction = set of successive interaction cycles • Each cycle • Automated basic transformations • User interactions using interaction views
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
Sequence diagram Extraction • User interactions using interaction views • Global view • Messages
Sequence Diagram Extraction • User interactions using interaction views • Global view • Placement
Sequence Diagram Extraction • User interactions using interaction views • Global view • Placement
Sequence Diagram Extraction • User interactions using interaction views • Diagram view
Sequence Diagram Extraction • User interactions using interaction views • Interactions • Navigation
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
Sequence Diagram Extraction • User interactions using interaction views • Recommending fragment merges
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)
Evaluation • Results • Participants
Evaluation • Results • Messages
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
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