© SERG Reverse Engineering (Interconnection Styles) Interconnection Styles.

Slides:



Advertisements
Similar presentations
Formal Methods and Testing Goal: software reliability Use software engineering methodologies to develop the code. Use formal methods during code development.
Advertisements

Heuristic Search techniques
Multilevel Hypergraph Partitioning Daniel Salce Matthew Zobel.
Interactive Configuration
Efficient Reachability Analysis for Verification of Asynchronous Systems Nishant Sinha.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
COVERAGE CRITERIA FOR TESTING 1. ill-defined terms in Testing  complete testing  exhaustive testing  full coverage Are poorly defined terms because.
1 An Architecture for Distributing the Computation of Software Clustering Algorithms 2001 Working Conference on Software Architecture (WICSA'01). Brian.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
SubSea: An Efficient Heuristic Algorithm for Subgraph Isomorphism Vladimir Lipets Ben-Gurion University of the Negev Joint work with Prof. Ehud Gudes.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
[ §4 : 1 ] 4. Requirements Processes II Overview 4.1Fundamentals 4.2Elicitation 4.3Specification 4.4Verification 4.5Validation Software Requirements Specification.
Data Structures and Programming.  John Edgar2.
1 Using Heuristic Search Techniques to Extract Design Abstractions from Source Code The Genetic and Evolutionary Computation Conference (GECCO'02). Brian.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
1 CSE 2102 CSE 2102 CSE 2102: Introduction to Software Engineering Ch9: Software Engineering Tools and Environments.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Chapter 1.4 Programming languages Homework Due: Monday, August 11, 2014.
1 Local search and optimization Local search= use single current state and move to neighboring states. Advantages: –Use very little memory –Find often.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
Design of an Evolutionary Algorithm M&F, ch. 7 why I like this textbook and what I don’t like about it!
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
1 A Heuristic Approach Towards Solving the Software Clustering Problem ICSM03 Brian S. Mitchell /
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
1 The Search Landscape of Graph Partitioning Problems using Coupling and Cohesion as the Clustering Criteria Brian S. Mitchell & Spiros Mancoridis
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
Automated Patch Generation Adapted from Tevfik Bultan’s Lecture.
Introduction to Compiling
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Compiler Design Introduction 1. 2 Course Outline Introduction to Compiling Lexical Analysis Syntax Analysis –Context Free Grammars –Top-Down Parsing –Bottom-Up.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.
Automated discovery in math Machine learning techniques (GP, ILP, etc.) have been successfully applied in science Machine learning techniques (GP, ILP,
Written by Changhyun, SON Chapter 5. Introduction to Design Optimization - 1 PART II Design Optimization.
Formal Specification: a Roadmap Axel van Lamsweerde published on ICSE (International Conference on Software Engineering) Jing Ai 10/28/2003.
© SERG Reverse Engineering (REportal) REportal: Reverse Engineering Portal (reportal.cs.drexel.edu)
Modelling the Process and Life Cycle. The Meaning of Process A process: a series of steps involving activities, constrains, and resources that produce.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
CMSC 345 Fall 2000 Requirements Expression. How To Express Requirements Often performed best by working top- down Express general attributes of system.
The Standard Genetic Algorithm Start with a “population” of “individuals” Rank these individuals according to their “fitness” Select pairs of individuals.
AUTOMATIC GENERATION OF MODEL TRAVERSALS FROM METAMODEL DEFINITIONS Authors: Tomaž Lukman, Marjan Mernik, Zekai Demirezen, Barrett Bryant, Jeff Gray ACM.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ALLOY: A Formal Methods Tool Glenn Gordon Indiana University of Pennsylvania COSC 481- Formal Methods Dr. W. Oblitey 26 April 2005.
Software Design and Architecture Muhammad Nasir Software Architecture Documentation
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Mechanisms for Requirements Driven Component Selection and Design Automation 최경석.
Objective of This Course
Analysis models and design models
A Framework for Testing Query Transformation Rules
Software Development Chapter 1.
Programming Logic and Design Eighth Edition
Presentation transcript:

© SERG Reverse Engineering (Interconnection Styles) Interconnection Styles

© SERG Reverse Engineering (Interconnection Styles) Software Design Following the Export (Server) Style SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S

© SERG Reverse Engineering (Interconnection Styles) Software Design Following the Export (Client) Style SS1 M1 M2 use SS2 M3 SS3 M4 M5 use SS4 use M6 use S ec

© SERG Reverse Engineering (Interconnection Styles) Software Design Following the Export Client / Export Style SS1 M1 M2 use SS2 M3 SS3 M4 M5 use SS4 use M6 use S ec export

© SERG Reverse Engineering (Interconnection Styles) Software Design Following the Import Style SS1 M1 M2 use SS2 M3 SS3 M4 M5 use SS4 use M6 use S import

© SERG Reverse Engineering (Interconnection Styles) Software Design Following the Import / Export Style SS1 M1 M2 use SS2 M3 SS3 M4 M5 use SS4 use M6 use S export import

© SERG Reverse Engineering (Interconnection Styles) Software Design Following the Tube Style SS1 M1 M2 use SS2 M3 SS3 M4 M5 use SS4 use M6 use S tube

© SERG Reverse Engineering (Interconnection Styles) Interconnection Style Formalism An ISF specification consists of a finite set of logic rules. There are two kinds of ISF rules: –Permission: Determine the syntactically legal relations between the components of a software design. –Definition: Define new relations based on patterns of entities and relations.

© SERG Reverse Engineering (Interconnection Styles) Interconnection Style Formalism (Cont’d) Each rule consists of a finite set of entities and relations. Entities represent design components and relations represent interconnections between these components.

© SERG Reverse Engineering (Interconnection Styles) Set of Mathematical Relations (Interpret.) Set of Datalog Facts Set of Logic Formulas (Theory) Set of Datalog Rules Satisfies? Union modelnot model Model-Theory View Datalog View Design View satisfies style does not satisfy style SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S input SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S SS1 M1 M2 use SS2 M3 SS3export M4 M5 use SS4 use M6 export use S Wellformed?Yes/no

© SERG Reverse Engineering (Interconnection Styles) Design Example M2 M3M4 M5 use export SS2.1 M6 use SS2 M1 SS1 use SS1.1 use

© SERG Reverse Engineering (Interconnection Styles) Design Example in Datalog

© SERG Reverse Engineering (Interconnection Styles) Formal Definition of ISF The syntax of ISF is described by presenting the visual symbols of the notation. These symbols represent design: –entities –relations –rules The semantics of ISF is described using Datalog.

© SERG Reverse Engineering (Interconnection Styles) Formal Definition of ISF The semantics of ISF is presented bottom- up: –semantics of ISF entities and relations –semantics of ISF rules in terms of the semantics of entities and relations

© SERG Reverse Engineering (Interconnection Styles) ISF Entities ISF entities are depicted as labeled rectangles. Each ISF entity represents a set of typed design components such as: –modules, classes, subsystems, etc. There are three types of entities: label

© SERG Reverse Engineering (Interconnection Styles) Example of an ISF Entity An example of an ISF entity is: Formally: subsystem(SS) –where SS is a free variable. Informally: “The set of all subsystems in a software design.” Subsystem

© SERG Reverse Engineering (Interconnection Styles) ISF Relations ISF relations are depicted as: – labeled edges – nested rectangles Each ISF relation represents a relation of a software design such as: –containment (depicted as nested rectangles) –import –export –inherit, etc.

© SERG Reverse Engineering (Interconnection Styles) ISF Containment Relations subsystem Contain(PSS,SS), subsystem(PSS) subsystem(SS) rtc_contain(PSS,SS), subsystem(PSS) subsystem(SS) e2 e1 1. Entity contains simple entity e2 e1 2. Entity contains transitive entity e2 e1 1. Entity contains permission entity

© SERG Reverse Engineering (Interconnection Styles) ISF Edge Relations e1e2 e1e2 1. Simple Relation r 2. Negated Simple Relation 3. Reflexive Transitive Relation e1e2 r r e1e2 4. Negated Reflexive Transitive Relation r e1 e2 r 5,6. Permission or Definition Relation

© SERG Reverse Engineering (Interconnection Styles) Examples of Edge Relations subsystem use rtc_use(SS1,SS2), subsystem(SS1), subsystem(SS2) use(SS1,SS2), subsystem(SS1), subsystem(SS2) not(use(SS1,SS2)), subsystem(SS1), subsystem(SS2) not(rtc_use(SS1,SS2)), subsystem(SS1), subsystem(SS2) tc_r(X,Y) :- r(X,Y). tc_r(X,Y) :- r(X,Z), tc_r(Z,Y). rtc_c(X,Y) :- X = Y. rtc_r(X,Y) :- tc_r(X,Y).

© SERG Reverse Engineering (Interconnection Styles) ISF Rules: The Export Style (Part 1) ss PERMIT ss export wf_export(PSS,SS) :- ss(PSS), ss(SS), contain(PSS,SS). ill_formed() :- export(X,Y), not(wf_export(X,Y)). wf_contain(PSS,SS) :- ss(PSS),ss(SS). ill_formed() :- contain(X,Y), not(wf_contain(X,Y)). well_formed_design() :- not(ill_formed()).

© SERG Reverse Engineering (Interconnection Styles) ISF Rules: The Export Style (Part 2)

© SERG Reverse Engineering (Interconnection Styles) Export Client / Export Style

© SERG Reverse Engineering (Interconnection Styles) Import / Export Style (Part 1)

© SERG Reverse Engineering (Interconnection Styles) Import / Export Style (Part 2)

© SERG Reverse Engineering (Interconnection Styles) Tube Style (Part1)

© SERG Reverse Engineering (Interconnection Styles) Tube Style (Part 2)

© SERG Reverse Engineering (Interconnection Styles) On the Automatic Recovery of Style-Specific Structural Dependencies

© SERG Reverse Engineering (Interconnection Styles) Introduction Motivation Definitions –MDG –Clustering –Interconnection Styles –ISF Examples Tool

© SERG Reverse Engineering (Interconnection Styles) Motivation Documentation problems: –Missing or inaccurate design documentation –Poorly documented code –Original programmers not available for consultation Program understanding. Need for high-level information –Existing clustering techniques do not produce high- level dependencies. Design validation

© SERG Reverse Engineering (Interconnection Styles) Module Dependency Graph Nodes represent modules Edges represent dependencies between modules (i.e. method invocation, variable reference, etc) Obtained automatically with Cia, Acacia, Chava

© SERG Reverse Engineering (Interconnection Styles) Example: Mini Tunis MDG

© SERG Reverse Engineering (Interconnection Styles) Clustering Aggregate representation of MDG, that groups together modules that are tightly coupled Clusters represent subsystems Obtained automatically with Bunch

© SERG Reverse Engineering (Interconnection Styles) Example: Mini Tunis after clustering

© SERG Reverse Engineering (Interconnection Styles) Structure Graph A clustered system may be visualized as a tree –Edges represent containment, use and style dependencies –Nodes represent modules and subsystems Easier to visualize large systems

© SERG Reverse Engineering (Interconnection Styles) Interconnection Styles Regulate the interactions between modules and subsystems High-level relations not present in source code or clustered system. Can be described formally with the Interconnection Style Formalism (ISF)

© SERG Reverse Engineering (Interconnection Styles) Example: Export Style Export style facilitates the specification of subsystem interfaces. If a subsystem S exports a module M, M belongs to S’s interface. Modules outside of S can use modules belonging to S’s interface.

© SERG Reverse Engineering (Interconnection Styles) Example: Export Style M3 can use M4 because it is exported by SS21 and SS21 is exported by SS2. M6 cannot use M5 because it is not exported by SS21. If M6 did use M5 there would be a stylistic violation.

© SERG Reverse Engineering (Interconnection Styles) ISF Visual notation that allows specification of constraints on configurations of components and dependencies Rules are represented as directed labeled graphs –Nodes: modules and subsystems –Arrows: dependencies and containment relations

© SERG Reverse Engineering (Interconnection Styles) ISF (cont’d) Types of rules: –PERMISSION: define the set of well-formed configurations –DEFINITION: define new relations based on patterns of software components and relations.

© SERG Reverse Engineering (Interconnection Styles) ISF Specification of Export Style

© SERG Reverse Engineering (Interconnection Styles) Example: Mini Tunis after Edge Repair

© SERG Reverse Engineering (Interconnection Styles) Tool Style Editor –Enables the user to define custom interconnection styles visually Edge Repair Utility –Takes structure graph and style and finds the missing structural dependencies automatically –Checks if a design satisfies stylistic constraints

© SERG Reverse Engineering (Interconnection Styles) Integration of Reverse Engineering Tools

© SERG Reverse Engineering (Interconnection Styles) Techniques Edge Repair Rule Checking Code Generation

© SERG Reverse Engineering (Interconnection Styles) Edge Repair Given –Structure GraphStyle definition

© SERG Reverse Engineering (Interconnection Styles) Edge Repair Goal: find the missing style dependencies such that: –Visibility between modules is minimized –No dependency (i.e., use or style) violates any stylistic constraint.

© SERG Reverse Engineering (Interconnection Styles) Algorithms Huge search space (i.e. cannot try all possible combinations) Optimization methods: –Hill climbing: start with a random configuration and find better ones by making small changes –Edge removal: start with “full” configuration and remove edges until no better solution can be found –Genetic algorithm

© SERG Reverse Engineering (Interconnection Styles) Fitness Function Measures the quality of a configuration –Good: Configurations with a large number of well-formed use relations –Bad: Configurations with a large number of ill-formed style dependencies Configurations with high visibility (many see relations)

© SERG Reverse Engineering (Interconnection Styles) Simplistic visibility Computing visibility is an O(N 2 ) operation Frequent operation Approach: simplistic visibility –Approximation to standard visibility –Given by the number of style dependencies –O(1) operation Drawback: does not work for some styles –Non-recursive (permission rules are not defined in terms of other permission rules) –Modules are exposed by direct (i.e., non-transitive) relations with their ancestors.

© SERG Reverse Engineering (Interconnection Styles) Fitness Function ifu: ill-formed use dependencies ifs: ill-formed style dependencies wfu: well-formed use dependencies wfs: well-formed style dependencies MaxS: maximum number of style dependencies in C

© SERG Reverse Engineering (Interconnection Styles) Hill Climbing Start from random configuration of dependencies Select an edge, to add or remove, such that the new configuration is better than the current one Repeat until no better solution can be found

© SERG Reverse Engineering (Interconnection Styles) Edge Removal Start from full configuration Remove edges that makes the current solution better until no better solution can be found

© SERG Reverse Engineering (Interconnection Styles) Hill Climbing vs. Edge Removal Hill Climbing –Adds relations and then removes them (might add unnecessary relations) Edge Removal –Always starts with a full configuration (even if only a few relations are required) –Fewer neighbors to consider as the algorithm advances

© SERG Reverse Engineering (Interconnection Styles) Performance: Hill Climbing vs. Edge Removal Hill ClimbingEdge Removal Compiler (19 nodes) 0.19 s0.14 s Mini Tunis (32 nodes) 0.8 s0.46 s Grappa (117 nodes) 8.5 s3.67 s Incl (212 nodes) s9.2 s

© SERG Reverse Engineering (Interconnection Styles) Genetic Algorithm Encoding Crossover Fitness function Mutation

© SERG Reverse Engineering (Interconnection Styles) Optimizations Pessimistic edge reparability: avoid processing relations that can never exist (e.g., export relations between siblings in the Export Style) Simplistic visibility measurement: based on the number of style dependencies in a configuration (reduces O(N 2 ) operation to O(1)).

© SERG Reverse Engineering (Interconnection Styles) Rule Checking Goal: check well-formedness of a dependency with respect to a permission rule. Can be reduced to a pattern matching problem => the rule is matched to the structure graph.

© SERG Reverse Engineering (Interconnection Styles) Pattern Matching Invalid pattern matches:

© SERG Reverse Engineering (Interconnection Styles) Pattern Matching Algorithm Based on Depth-First Search –State: Set of fixed nodes Set of free nodes –Goal: find a state with no free nodes –Initial state: the set of fixed nodes contains the endpoints of the relation being checked

© SERG Reverse Engineering (Interconnection Styles) Pattern Matching Example Structure Graph Permission Rule

© SERG Reverse Engineering (Interconnection Styles) Choosing the Node to Fix If the node is not connected to a fixed node, it can assume any value (i.e., N possibilities) Choose a node connected to a fixed node to constrain the possible values for the node

© SERG Reverse Engineering (Interconnection Styles) Pessimistic Edge Reparability Algorithm Algorithm: based on the pattern matching –Full configuration with all dependencies as unknown –Repeat until no more unknown dependencies exist Pick a dependency tagged as unknown Check if it is reparable (i.e., perform a pattern match of every related permission rule). If an unknown dependency is found during the match, check its reparability (i.e., recursive call of this algorithm) If a match is found and all involved dependencies are reparable, tag the relation as reparable. If not, tag it as irreparable.

© SERG Reverse Engineering (Interconnection Styles) Code Generation Java code is generated to check each rule –Take advantage of Java’s compile-time and run-time optimizations –Some decision making is performed when the rule is translated instead of when it is checked

© SERG Reverse Engineering (Interconnection Styles) Code Optimization Take advantage of the fact that –Rules are static –Search tree depth is fixed and known for each rule (depends on the number of nodes in the rule). … to determine the order in which rule’s nodes are fixed at translation time.

© SERG Reverse Engineering (Interconnection Styles) Code Optimization (cont’d) When rules look like trees (most times), topological sorting can give a good ordering of nodes.

© SERG Reverse Engineering (Interconnection Styles) Conclusion Tool –find missing high-level dependencies in a system –validate a design against a style specification Further research: –Optimization of edge repair algorithm (e.g., using incremental algorithms) Replace the “simplistic visibility” measurement –Repairing designs by reclustering.