Formal Foundations for Software Evolution Programming Technology Lab Tom Mens

Slides:



Advertisements
Similar presentations
1 A Graph Rewriting Formalism for Object-Oriented Software Evolution Tom Mens FWO Postdoctoral Fellow Programming Technology Lab Vrije.
Advertisements

1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 11 Brief introduction to the UML Specification (Based on UML Superstructure.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Software Project Management
1 Reuse Contracts Patrick Steyaert Programming Technology Lab Vrije Universiteit Brussel WWW:
Introduction to Software Evolution and Maintenance
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
Feb. 23, 2004CS WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004.
© Copyright Eliyahu Brutman Programming Techniques Course.
1 Object-Oriented Design. 2 Objectives F To become familiar with the process of program development. F To the relationship types: association, aggregation,
The Software Product Life Cycle. Views of the Software Product Life Cycle  Management  Software engineering  Engineering design  Architectural design.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
A Domain-Independent Formalism for Software Evolution Tom Mens Programming Technology Lab Vrije Universiteit Brussel February, 2000.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
A Survey of Software Refactoring Tom Mens, Tom Tourwé
ICT Management page 1MBA BORM - BORM © - Business Object Relation Modeling Know-How Fund of British Council, ČVUT v Praze, ČZU Praha,
Object-oriented Software Engineering with Reuse Contracts Koen De Hondt, Carine Lucas, Kim Mens, Tom Mens, Patrick Steyaert, Roel Wuyts Programming Technology.
Yu SunUniversity of Alabama at Birmingham PAR Works Jeff Gray University of Alabama Montpellier, France July 3rd, 2013 This research is supported.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 A Discipline of Software Design.
What is a life cycle model? Framework under which a software product is going to be developed. – Defines the phases that the product under development.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
A Novel Approach to Architectural Recovery in Evolving Object- Oriented Systems PhD thesis Koen De Hondt December 11, 1998.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Model-Driven Analysis Frameworks for Embedded Systems George Edwards USC Center for Systems and Software Engineering
University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013.
Lecture 3 Uses Cases Topics UML Use Cases pop quiz Readings: Chapter 3 January 24, 2008 CSCE 492 Software Engineering.
Formal Foundations for Software Evolution Programming Technology Lab Tom Mens
A language to describe software texture in abstract design models and implementation.
Composition of UML Described Refactoring Rules Presented by Chin-Yi Tsai.
Object Oriented Analysis and Design using the UML CIS 520 Advanced Object-Oriented Design.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
1 Software Development Software Engineering is the study of the techniques and theory that support the development of high-quality software The focus is.
Object Oriented Reverse Engineering JATAN PATEL. What is Reverse Engineering? It is the process of analyzing a subject system to identify the system’s.
Object-Oriented Analysis and Design. Lesson 1: Introduction to Software Engineering.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
Chapter 5: Software Re-Engineering Omar Meqdadi SE 3860 Lecture 5 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
A Formal Model for Object-Oriented Software Reuse Kim Mens Programming Technology Lab Vrije Universiteit Brussel FNRS MeetingMay 6th, 1997.
Katholieke Universiteit Leuven112 April 2000 Research Topics in Software Evolution Dr. Tom Mens FWO Postdoctoral Fellow Programming Technology Lab Vrije.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
February 2000Programming Technology Lab, Vrije Universiteit Brussel Reuse Contracts Managing the evolution of reusable components Dr. Tom Mens Programming.
Reuse Contracts A Historic Overview Dr. Tom Mens Programming Technology Lab Vrije Universiteit Brussel Course OOSE.RC EMOOSE
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
EMEA Beat Schwegler Architect Microsoft EMEA HQ Ingo Rammer Principal Consultant thinktecture
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
October 19, 1998Doctoral Symposium OOPSLA’98 Kim Mens Intentional annotations for evolving object-oriented software Kim Mens Programming Technology Lab.
2000 Research Overview Dr. Kim Mens Programming Technology Lab Vrije Universiteit Brussel.
4 June 1998, Mulhouse, France > ‘98 International Workshop Tom Mens Carine Lucas & Patrick Steyaert Programming Technology.
Methodology Review Chapter 7 Part 2: Design Methodology Object-Oriented Modeling and Design Byung-Hyun Ha
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
A Formalism for Transformational Software Evolution Programming Technology Lab Vrije Universiteit Brussel, Belgium Tom Mens
Introduction to Software Engineering 1. Software Engineering Failures – Complexity – Change 2. What is Software Engineering? – Using engineering approaches.
Unit 1 - Introducing Abstract Data Type (ADT) Part 1.
Object-Oriented Software Engineering Using UML, Patterns, and Java,
State Digrams in UML: A Formal Senmatics using Graph Transformations
Transformational Software Evolution by Assertions
AGTIVE Workshop Conditional Graph Rewriting as a Domain-Independent Formalism for Software Evolution Tom Mens Programming Technology Lab Vrije Universiteit.
Introduction to UML.
Chapter 20 Object-Oriented Analysis and Design
Design Tips.
Analysis models and design models
Public PhD Defense A Formal Foundation for Object-Oriented
Reuse Contracts: Managing the Evolution of Reusable Assets
Software Development Process Using UML Recap
Presentation transcript:

Formal Foundations for Software Evolution Programming Technology Lab Tom Mens

January 2001© Programming Technology Lab 2 Need better tool support for  version control  e.g. upgrading application frameworks  collaborative software development  software merging  change management  change propagation  change impact analysis  ripple effect ...  evolution at a high level of abstraction  evolution of design patterns  architectural evolution ... object-oriented software evolution

January 2001© Programming Technology Lab 3 Need better tool support for  co-evolution between different phases  maintaining consistency  checking compliance between architecture and design, design and implementation,...  re-engineering of legacy systems  program comprehension  reverse engineering  migration ...  empirical research on software evolution  based on change metrics  predictive models ...

January 2001© Programming Technology Lab 4 Tool support must be  scalable  applicable to large-scale software systems  “A major challenge for the research community is to develop a good theoretical understanding an underpinning for maintenance and evolution, which scales to industrial applications.” [Bennett&Rajlich 2000]  language-independent  independent of the programming or modelling language  generally applicable in all phases of the software life- cycle

January 2001© Programming Technology Lab 5 Reuse Contracts Use graph rewriting to provide a formal foundation for software evolution based on reuse contracts

January 2001© Programming Technology Lab 6 Benefits of Reuse Contracts 1.Document reuse and evolution 2.Deal with upgrade problems 3.Provide support for software merging 4.Provide support for framework refactoring 5.Are independent of kind of software artifact  analysis, architecture, design, implementation

January 2001© Programming Technology Lab 7 1. Documenting Reuse DesktopFolder position contents move: add: addMany: SizedFolder add: item size reuse Extension(size, attribute) Refinement(add, size, update) size =+ item.size

January 2001© Programming Technology Lab 8 DesktopFolder position contents move: add: addMany: 1. Documenting Evolution evolution Coarsening(addMany, add, calls) DesktopFolder position contents move: add: addMany:

January 2001© Programming Technology Lab 9 2. Dealing with Upgrade Problems DesktopFolder position contents move: add: addMany: evolution DesktopFolder position contents move: add: addMany: reuse size not updated when adding many items SizedFolder add: item size size =+ item.size SizedFolder add: item size size =+ item.size

January 2001© Programming Technology Lab Dealing with Upgrade Problems DesktopFolder position contents move: add: addMany: evolution DesktopFolder position contents move: add: addMany: SizedFolder add: size reuse Coarsening(addMany, add, calls) Extension(size, attribute) Refinement(add, size, update) inconsistent operation conflict

January 2001© Programming Technology Lab 11 Conflict Table 2. Dealing with Upgrade Problems extension refinement coarsening extensionrefinementcoarsening no conflicts inconsistent operations interface conflicts operation capture, unanticipated recursion operation capture, inconsistent operations no conflicts operation capture, inconsistent operations  extension/cancellation: adding/removing an operation or attribute  refinement/coarsening: adding/removing invocation or attribute access  abstraction/concretisation: making an operation abstract/concrete

January 2001© Programming Technology Lab Support for Software Merging DesktopFolder position contents move: add: addMany: evolution DesktopFolder v1 contents add: addMany: evolution Extension(position, attribute) Extension(move:, method) Coarsening(addMany, add, calls) Extension(size, attribute) Refinement(add, size, update) inconsistent operation conflict DesktopFolder v2a contents size add: addMany:

January 2001© Programming Technology Lab Support for FW Refactoring Refactoring conflict ! After merging, size in NestingFolder accidentally overrides size in Folder, which has a different behaviour! CreateSubclass FolderFile totalSizesize NestingFolder size size calculates number of items in a folder FolderFile totalSizesize both calculate item size in bytes PullUpVariable FolderFile DesktopItem size

January 2001© Programming Technology Lab Independent of software artifact «interaction» linkResolving :Browser:Document browser {resolveLink invokes} getURL «provider» WebNavigation «interaction» mouseClicking :Browser:Document doc {handleClick invokes} mouseClick self {mouseClick invokes} resolveLink «collaboration» «interface» Browser handleClick getURL «interface» Document mouseClick resolveLink doc browser {participant extension} {participant refinement} «client» PDFNavigation «collaboration» «interface» Document gotoPage«added» {resolveLink invokes} gotoPage «added» «interaction» linkResolving :Browser:Document browser {resolveLink invokes} getURL «removed» {participant coarsening}

January 2001© Programming Technology Lab 15 Problems with reuse contracts  How to scale up to higher-level transformations  e.g. dealing with class collaborations  How to apply to other domains  e.g. software architectures  Solution: Provide a formal foundation for reuse contracts

January 2001© Programming Technology Lab 16 Reuse Contract Formalism  Represent software artifacts by graphs  Represent software evolution by graph rewriting  Domain-independent formalism  Independent of the target language  Independent of the phase in the life-cycle  Lightweight formalism to facilitate tool support  Formal characterisation of evolution conflicts  Prototype tool implemented in Prolog

January 2001© Programming Technology Lab 17 Graphs G Triangle «class» Circle «class» «is-a» intersects «operation» «assoc» center radius «attribute» «has-a» vertices {3} Point «class»Shape «class» area «operation» perimeter «operation» x «attribute» distanceTo «operation» y «attribute» «is-a»  Internal Graph Representation +intersects(c: Circle) -radius Circle +distanceTo(p: Point) -x -y Point Triangle +area() +perimeter() Shape center vertices3  Example: UML class diagram  Node types:  «class»  «attribute»  «operation»  «interface»  Edge types:  «assoc»  «has-a» (aggregation)  «is-a» (generalisation)  «implements»

January 2001© Programming Technology Lab 18 Type Graph v e node type edge type implements nested operation attribute interface class assoc, has-a, is-a is-a uses invokes nested  Used to specify domain-specific constraints

January 2001© Programming Technology Lab 19 P m R area «operation» radius «attribute» «uses» G Circle «class» area «operation» «uses» perimeter «operation» radius «attribute» H Circle «class» area «operation» «uses» perimeter «operation» radius «attribute» «uses» L area «operation» radius «attribute» Graph Rewriting  Used to specify software evolution graph productionleft-hand side right-hand side (negative) precondition (positive) postcondition graph rewriting embedding in context result graphinitial graph

January 2001© Programming Technology Lab 20  Use restricted set of graph productions  AddNode  DropNode  AddEdge  DropEdge  RetypeNode  RetypeEdge  RelabelNode  RelabelEdge Primitive Graph Productions AddEdge (area,radius,«uses») R area «operation» radius «attribute» «uses» L area «operation» radius «attribute» DropNode (Triangle.area,«operation») R Triangle L «operation» area Triangle

January 2001© Programming Technology Lab 21 Syntactic Conflicts P1P1 P 2 = DropNode(area,«operation») P 1 = AddEdge(area,radius,«uses») P2P2 P1P1 P2P2 Undefined source conflict Syntactic conflict if P 1 and P 2 are not parallel independent G Circle «class» area «operation» perimeter «operation» radius «attribute» «uses» > G2G2 Circle «class» perimeter «operation» radius «attribute» «uses» G1G1 Circle «class» area «operation» perimeter «operation» radius «attribute» «uses»

January 2001© Programming Technology Lab 22 Syntactic Conflict Table Complete fine-grained characterisation of syntactic conflicts AC 3 AddN (v,  ) DropN (v,  ) AddE (e,v,w,  ) AddE (e,u,v,  ) DropE (e,v,w,  ) DropE (e,u,v,  ) RetypeN (v, ,   ) RetypeE (e,v,w, ,   ) RetypeE (e,u,v, ,   ) AddNode (v,  ) AC 1  DropNode (v,  )  AC 2 AC 3 AC 4  AC 9  AddEdge (e,v,w,  )  AC 5  AddEdge (e,u,v,  )  AC 4  AC 5  DropEdge (e,v,w,  )  AC 6  AC 10 if  =   DropEdge (e,u,v,  )  AC 6  AC 10 if  =  RetypeNode (v, ,   )  AC 9  AC 7  RetypeEdge (e,v,w, ,   )  AC 10 if  =   AC 8 if  =   RetypeEdge (e,u,v, ,   )  AC 10 if  =   AC 8 if  = 

January 2001© Programming Technology Lab 23  Based on the formal notion of  pushouts and pullbacks  Fine-grained conflict characterisation  By detecting occurrence of graph patterns in result graph Semantic Conflicts addManyaddsize « updates » « calls » {added during reuse} {removed during evolution} inconsistent method conflict « class » ? « class » ? « inherits » {added by developer 2} {added by developer 1} cyclic inheritance

January 2001© Programming Technology Lab 24 Structural Conflicts InsertClass (Shape,Quadrangle, [Square,Rectangle]) AddSubclass(Shape,Parallellogram) AddSubclass(Shape,Triangle) Shape SquareRectangle QuadrangleCircle Shape SquareRectangleCircle Shape SquareRectangleCircleTriangleParallellogram More difficult to detect in a general way

January 2001© Programming Technology Lab 25 Using Assertions  Problem  Using a predefined set of graph productions is not generic  Introducing new productions requires changes to conflict table  Does not scale up to composite graph productions  Solution  make formalism independent of chosen productions  define productions based on assertions only  preconditions, postconditions, invariants

January 2001© Programming Technology Lab 26 Example

January 2001© Programming Technology Lab 27 Example ctd. surface attribute a L area operation a radius attribute c f uses R preconditions postconditions invariants

January 2001© Programming Technology Lab 28 Syntactic Conflict Table  Detect syntactic merge conflicts  in terms of transformation preconditions  compare breaches of application conditions  Advantages  more general  does not rely on predefined graph produtions  more scalable  can be used directly for composite or domain-specific graph productions

January 2001© Programming Technology Lab 29 Syntactic Conflict Table -i+isource (e,v) target (e,v) label (i,L) type (i,T) -source (e,v) -target (e,v) -j  if i=j  if j=e  if j=v  if j=e  if j=v  if i=j  if j=v +j C1 if i=j C2 if e=j  if v=j C3 if e=j  if v=j C4 if i=jC5 if i=jC6 if j=v C7 if j=e C8 if j=v C9 if j=e source (f,w) C10 if (e,v)=(f,w)  if v=w  if (e,v)=(f,w)  target (f,w) C11 if (e,v)=(f,w)  if v=w  if (e,v)=(f,w) label (j,L2) C12 if i=j  type (j,T2) C13 if i=j  -source (f,w) C14 if e=f and v  w  -target (f,w) C15 if e=f and v  w

January 2001© Programming Technology Lab 30 Using dependencies  Dependencies can be defined between productions  based on relations between assertions strong satisfaction dependency strong capture dependency weak satisfaction dependency derived assertions

January 2001© Programming Technology Lab 31 Using dependencies  Dependencies can be used to address scalability 1.Reordering productions in a sequence 2.Defining “atomic” composite productions from a sequence of productions 3.Removing redundancy in a production sequence 4.Factoring out commonalities from parallel production sequences 5.Parallellising subsequences

January 2001© Programming Technology Lab Reordering productions

January 2001© Programming Technology Lab Composite productions

January 2001© Programming Technology Lab Removing redundancy  Allows us to simplify a production sequence AddN(b) AddN(a)AddN(b)Rena(c,d)AddE(a,b)Rety(d)DropE(a,b)DropN(a) AddN(a)AddN(b)DropN(a) AddN(a)AddN(b)DropN(a) redundant pair reorder redundant pair

January 2001© Programming Technology Lab Removing Redundancy

January 2001© Programming Technology Lab Factoring out commonalities  Find commonalities in two parallel sequences, and factor out  facilitates merging and conflict detection

January 2001© Programming Technology Lab Factoring out: Example

January 2001© Programming Technology Lab Factoring out: Example

January 2001© Programming Technology Lab Parallellising subsequences RenameN(a,surface,area) AddN(b,perimeter,attribute) RetypeN(a, attribute,operation) RetypeN(b, attribute,operation) AddN(c,radius,attribute) AddE(e,b,c,uses,uses) AddE(f,a,c,uses,uses) DropE(e,b,c) DropN(b)

January 2001© Programming Technology Lab Parallellising subsequences RenameN(a,surface,area) AddN(b,perimeter,attribute) RetypeN(a, attribute,operation) RetypeN(b, attribute,operation) AddN(c,radius,attribute) AddE(e,b,c,uses,uses)AddE(f,a,c,uses,uses) DropE(e,b,c) DropN(b)

January 2001© Programming Technology Lab 41 Validation of Reuse Contracts  Industrial case  One base release line with many customisations for different customer applications  Collaborative software development with parallel changes to base release and customisations x NDR DR WDR 0.1 VTM TV2 WDR 1.0 WDR 2.0

January 2001© Programming Technology Lab 42 Validation of Reuse Contracts  Use reuse contracts to document  evolution of base release line  customisation to different customer applications  evolution of customer applications  Use conflict detection to support  upgrades of customer application to more recent base release  refactoring of base release for easier future customisation  Provide help with consolidation  detect commonalities between different customisations  apply commonalities to base release

January 2001© Programming Technology Lab 43 To Do  User-friendly tool support  Perform large-scale experiments  Validate scalability  Look at conflict resolution techniques  Deal with problem of co-evolution

January 2001© Programming Technology Lab 44 Co-Evolution  Underlying idea  Keep representation of same software artifact at different levels of abstraction (e.g. design and implementation) synchronised during evolution refinement abstract layer concrete layer consistent??? evolution

January 2001© Programming Technology Lab 45 Co-Evolution  needed for collaborative development  when different persons make changes to same software concept at different levels of abstraction  facilitates delta analysis  relate changes at analysis level back to the code and keep them synchronised  address architectural drift and software erosion  use a compliance checking algorithm  detect conflicts between changes at different levels