Static Control-Flow Analysis for Reverse Engineering of UML Sequence Diagrams Atanas (Nasko) Rountev Ohio State University with Olga Volgin and Miriam.

Slides:



Advertisements
Similar presentations
Data-Flow Analysis II CS 671 March 13, CS 671 – Spring Data-Flow Analysis Gather conservative, approximate information about what a program.
Advertisements

School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
Course Outline Traditional Static Program Analysis –Theory Compiler Optimizations; Control Flow Graphs Data-flow Analysis – today’s class –Classic analyses.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Program Representations. Representing programs Goals.
Software Design Process A Process is a set of related and (sequenced) tasks that transforms a set of input to a set of output. Inputs Outputs Design Process.
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
Course project presentations No midterm project presentation Instead of classes, next week I’ll meet with each group individually, 30 mins each Two time.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Cpeg421-08S/final-review1 Course Review Tom St. John.
A High Performance Application Representation for Reconfigurable Systems Wenrui GongGang WangRyan Kastner Department of Electrical and Computer Engineering.
Previous finals up on the web page use them as practice problems look at them early.
Loop invariant detection using SSA An expression is invariant in a loop L iff: (base cases) –it’s a constant –it’s a variable use, all of whose single.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Regression Test Selection for AspectJ Software Guoqing Xu and Atanas.
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Precision Going back to constant prop, in what cases would we lose precision?
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
PRESTO Research Group, Ohio State University Interprocedural Dataflow Analysis in the Presence of Large Libraries Atanas (Nasko) Rountev Scott Kagan Ohio.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Path Testing + Coverage Chapter 9 Assigned reading from Binder.
Understanding Parallelism-Inhibiting Dependences in Sequential Java Programs Atanas (Nasko) Rountev Kevin Van Valkenburgh Dacong Yan P. Sadayappan Ohio.
Object-Oriented Analysis and Design An Introduction.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 3.
Computer Science 340 Software Design & Testing UML Sequence Diagrams.
Coverage Criteria for Testing of Object Interactions in Sequence Diagrams Atanas (Nasko) Rountev Scott Kagan Jason Sawin Ohio State University.
Rethinking Soot for Summary-Based Whole- Program Analysis PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Dacong Yan.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal Extracting Sequence Diagrams from Execution Traces using Interactive Visualization.
Static Detection of Loop-Invariant Data Structures Harry Xu, Tony Yan, and Nasko Rountev University of California, Irvine Ohio State University 1.
CASE/Re-factoring and program slicing
CBSE'051 Component-Level Dataflow Analysis Atanas (Nasko) Rountev Ohio State University.
J.E. Rivera, D. Ruiz-González, F. López-Romero, J. Bautista, and A. Vallecillo MtATL 09 Nantes, July 09.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Automatically detecting and describing high level actions within methods Presented by: Gayani Samaraweera.
OMT Modeling 1. Object Model : presented by the object model and the data dictionary. 2. Dynamic Model: presented by the state diagrams and event flow.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
1 Control Flow Analysis Topic today Representation and Analysis Paper (Sections 1, 2) For next class: Read Representation and Analysis Paper (Section 3)
Program Representations. Representing programs Goals.
SAD2 - UML Lecturer: Dr. Dimitrios Makris 1st Lecture
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
1 Control Flow Graphs. 2 Optimizations Code transformations to improve program –Mainly: improve execution time –Also: reduce program size Can be done.
Cleaning up the CFG Eliminating useless nodes & edges This lecture describes the algorithm Clean, presented in Chapter 10 of EaC2e. The algorithm is due.
Lossless Decomposition and Huffman Codes Sophia Soohoo CS 157B.
Sept 12ICSM'041 Precise Identification of Side-Effect-Free Methods in Java Atanas (Nasko) Rountev Ohio State University.
1 Unified Modeling Language Michael K. Wildes University of California, Riverside – Extension Program Presentation 2.
Object Naming Analysis for Reverse- Engineered Sequence Diagrams Atanas (Nasko) Rountev Beth Harkness Connell Ohio State University.
Interaction Models (2): Activity Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh.
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
Static Analysis of Object References in RMI-based Java Software
Basic Program Analysis
UML(Unified Modeling Language)
Atanas (Nasko) Rountev Ohio State University
Object-Oriented Analysis and Design
Unified Modeling Language
Building a Whole-Program Type Analysis in Eclipse
Online Shopping APP.
Factored Use-Def Chains and Static Single Assignment Forms
Control Flow Analysis CS 4501 Baishakhi Ray.
System Sequence Diagrams
Demand-Driven Context-Sensitive Alias Analysis for Java
Software Design Lecture : 15.
Control Flow Analysis (Chapter 7)
Interactive Exploration of Reverse-Engineered UML Sequence Diagrams
Presentation transcript:

Static Control-Flow Analysis for Reverse Engineering of UML Sequence Diagrams Atanas (Nasko) Rountev Ohio State University with Olga Volgin and Miriam Reddoch

Nasko Rountev - PASTE'05 2 Example of a UML Sequence Diagram start:X m1() p:A m2() n:A m3() create() m4() opt

Nasko Rountev - PASTE'05 3 UML Sequence Diagrams  Popular UML artifacts for modeling of object interactions  Design-time sequence diagrams  Reverse-engineered sequence diagrams  Based on existing code  Iterative development; design recovery for software maintenance; software testing  Implemented in some commercial UML tools  Together ControlCenter (Borland)  EclipseUML (Omondo)

Nasko Rountev - PASTE'05 4 Reverse-Engineering Analyses  Dynamic analysis: tracks a set of representative run-time executions  Several research tools  Static analysis: examines only the code  Commercial tools (deficiencies)  Some research work (not comprehensive)  REDPRESTO  RED tool for Java: PRESTO group at OSU  URL: presto.cse.ohio-state.edu/red  Call chain analysis; control-flow analysis; object naming analysis; visualization and navigation; test coverage measurements

Nasko Rountev - PASTE'05 5 Representation of Intraprocedural Flow of Control  Given: the methods whose bodies will be used to construct the diagram intra  How should we represent the intraprocedural flow of control inside these bodies?  Solution: algorithm for mapping a method’s CFG to UML 2.0 interaction fragments  Any reducible exception-free CFG  Precise mapping: preserves all call sequences  Subsequent diagram transformations  Lossless vs. lossy  Visualization and exploration

Nasko Rountev - PASTE'05 6 UML 2.0 Interaction Fragments  Opt, alt, loop, break; added generalized break

Nasko Rountev - PASTE'05 7 Analysis Stages CFG Phase I: Preprocessing Phase II: Fragment Construction Phase III: Transformations Data Structure for Fragments

Nasko Rountev - PASTE'05 8 Phase I: Preprocessing  Post-dominance tree  Node n 2 post-dominates n 1 if all paths from n 1 to exit go through n 2  Immediate post-dominator; parent in the tree  Analyze branch nodes  What is the merge point for all branches?  Analyze loops  Nesting relationships  What is the merge point for all loop exits?

Nasko Rountev - PASTE'05 9 Post-dominance Tree

Nasko Rountev - PASTE'05 10 Branch Nodes and Branch Successors  Branch successor: node where the outgoing paths for a branch node merge the branch successor of 3 is 6

Nasko Rountev - PASTE'05 11 Loops and Loop Successors the loop successor of L is 12  Reducible CFG: contains only natural loops  Loop successor: merge point of all paths exiting the loop

Nasko Rountev - PASTE'05 12 Branch/Loop Successors Inside Loop L  Consider only edges inside L  Create a post-dominance tree for L and use it for:  branch successors for nodes in L  loop successors for loops nested in L the branch successor of 7 is 10

Nasko Rountev - PASTE' : s != null 2 : s = e.getChars() 1 : i = -1 4 : e = s.charAt(0) 5 : i = patterns.indexOf(e) 7 : statusArray[i] !=0 6 : i>=0 8 : e1 = patterns.elementAt(i) 11 : fixEntry(e1) 9: e1 != null 12: exit 10 : patterns.removeElementAt(i) F T T F T F T F PatternEntry:getChars() TOP OPT ALT cond: statusArray[i] !=0 cond: s != null Vector:elementAt(i) String:charAt(0) Vector:indexOf(e) LOOP cond: e1 != nullBREAK MergeCollation:fixEntry(e1) breaks_from: LOOP BREAK 1 breaks_from: LOOP cond: i<0 cond: i>= 0 Vector:removeElementAt(i) Phase II: Fragment Construction

Nasko Rountev - PASTE'05 14 Various Issues  UML additions  Multi-level break fragments  Multiple method exits  Opt-like fragments: return fragments  Algorithm uses control dependencies  Exceptions (Java)  “throw e”: similar to method exit - throw fragment  Ignore catches and implicit exceptions  Node replication: the same CFG node may have to produce multiple identical elements  e.g. due to short-circuit evaluation

Nasko Rountev - PASTE'05 15 Average Running Time per Method [milliseconds]

Nasko Rountev - PASTE'05 16 Methods Requiring Return/Throw Fragments

Nasko Rountev - PASTE'05 17 Methods Requiring Multi-level Break Fragments

Nasko Rountev - PASTE'05 18 Methods Requiring Node Replication

Nasko Rountev - PASTE'05 19 Summary and Future Work  General and fast algorithm  Creates detailed and precise representation  Subsequent simplifications [OSU-CISRC-3/04-TR12]  Lossless: e.g. merge a fragment with the surrounding fragment [OSU-CISRC-3/04-TR12]  Lossy: e.g. give up on multi-level breaks [VISSOFT’05]  Interactive visualization [VISSOFT’05]  Collapse and un-collapse fragments; slice the diagram w.r.t. a fragment of interest RED  Re-implement in Eclipse and make public, together with the other analyses in RED

Nasko Rountev - PASTE'05 20 Questions?