Composition of UML Described Refactoring Rules Presented by Chin-Yi Tsai.

Slides:



Advertisements
Similar presentations
Semantics Static semantics Dynamic semantics attribute grammars
Advertisements

Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Feb 2003 R McFadyen1 Contracts (Ch 13) Used to help understand requirements more completely based on assertions; assertions are applicable to any.
Paper Title: On the Precise Meaning of the OCL Constraints Presented by Alla Dove.
Basic Concepts in Component-Based Software Engineering
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Software Testing and Quality Assurance
Software Testing and Quality Assurance
Architecture-driven Modeling and Analysis By David Garlan and Bradley Schmerl Presented by Charita Feldman.
Software Testing and Quality Assurance
Software Factory Assembling Applications with Models, Patterns, Frameworks and Tools Anna Liu Senior Architect Advisor Microsoft Australia.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Software Testing and Quality Assurance
Describing Syntax and Semantics
1 Scenario-based Analysis of UML Design Class Models Lijun Yu October 4th, 2010 Oslo, Norway.
A Survey of Software Refactoring Tom Mens, Tom Tourwé
Ontology Development Kenneth Baclawski Northeastern University Harvard Medical School.
1 Introduction to Modeling Languages Striving for Engineering Precision in Information Systems Jim Carpenter Bureau of Labor Statistics, and President,
1 COSC 4406 Software Engineering COSC 4406 Software Engineering Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Nipissing University, 100.
Introduction to MDA (Model Driven Architecture) CYT.
1 MDWE'2008, Toulouse, France, September 30, 2008 A Comparative Analysis of Transformation Engines for User Interface Development Juan Manuel González.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
1 A Model-Driven Approach For Information System Migration Raymonde Le Delliou 1, Nicolas Ploquin 2, Mariano Belaunde 3, Reda Bendraou 4, Louis Féraud.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
Object Oriented Analysis and Design using the UML CIS 520 Advanced Object-Oriented Design.
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Verification of behavioural elements of UML models using B Truong, Ninh-Thuan and Souquieres, Jeanine In Proceedings of the 2005 ACM Symposium on.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Deriving Operational Software Specification from System Goals Xin Bai EEL 5881 Course Fall, 2003.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
CS251 – Software Engineering Lecture 9: Software Design Slides by Mohammad El-Ramly, PhD
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin.
Requirements Engineering-Based Conceptual Modelling From: Requirements Engineering E. Insfran, O. Pastor and R. Wieringa Presented by Chin-Yi Tsai.
1 Devon M. Simmonds, Computer Science Department Design by Contract Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington.
MDA & RM-ODP. Why? Warehouses, factories, and supply chains are examples of distributed systems that can be thought of in terms of objects They are all.
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Rigorous Testing by Merging Structural and Behavioral UML Representations Presented by Chin-Yi Tsai.
Andrey Karaulov, Alexander Strabykin Institute for System Programming Russian Academy of Sciences SYRCoSE: Spring Young Researchers Colloquium on Software.
DISCUSSION ABOUT REGISTRATION OF RM-ODP LIBRARY EXAMPLE BASED ON MFI Yuan Lin, Wang Jian, Wang Chong, Liang Peng, Feng Zaiwen.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
A UML-Based Pattern Specification Technique Presented by Chin-Yi Tsai IEEE TRANSACTION ON SOFTWARE ENGINEERING, VOL. 30, NO. 3, MARCH 2004 Robert B. France,
Model Checking Early Requirements Specifications in Tropos Presented by Chin-Yi Tsai.
Component-Based Software Engineering Components and Interfaces Paul Krause and Sotiris Moschoyiannis.
Implementation Topics Describe –Characteristics of good implementations –Best practices to achieve them Understand role of comments Learn debugging techniques.
Security analysis of COM with Alloy
TQS - Teste e Qualidade de Software (Software Testing and Quality) Test Case Design – Model Based Testing João Pascoal.
SEAA 2014 Automatic Production of Transformation Chains Using Structural Constraints on Output Models Cuauhtémoc Castellanos Etienne Borde Thomas Vergnaud.
Web Ontology Language for Service (OWL-S)
Transformational Software Evolution by Assertions
Programming Languages 2nd edition Tucker and Noonan
Evaluating Compuware OptimalJ as an MDA tool
Semantics In Text: Chapter 3.
ISWIM For Testing – A Model Driven Approach
Programming Languages 2nd edition Tucker and Noonan
Chapter 9: Implementation
Presentation transcript:

Composition of UML Described Refactoring Rules Presented by Chin-Yi Tsai

2 Outline Introduction Introduction Refactoring Refactoring Composition of Refactorings Composition of Refactorings Related Work Related Work Conclusion Conclusion

3 Introduction Refactoring can be seen as a process of improving structure of a software without changing its behavior. Refactoring can be seen as a process of improving structure of a software without changing its behavior. From W.F. Opdyke, “ Refactoring: A Program Restructuring Aid in Designing Object-Oriented Application Frameworks, ” PhD thesis, Univ. of Illinois at Urbana-Champaign, From W.F. Opdyke, “ Refactoring: A Program Restructuring Aid in Designing Object-Oriented Application Frameworks, ” PhD thesis, Univ. of Illinois at Urbana-Champaign, As corner stone for XP and agile process As corner stone for XP and agile process The refactoring process: The refactoring process: Identify where the software should be refactored Identify where the software should be refactored Which refactoring Which refactoring Guarantee that the applied refactoring perserves behavior Guarantee that the applied refactoring perserves behavior Apply the refactoring Apply the refactoring Assess the effect of the refactoring on quality Assess the effect of the refactoring on quality Maintain the consistency Maintain the consistency Refactoring techniques: Refactoring techniques: Assertions (preconditions, postconditions, and invariants) Assertions (preconditions, postconditions, and invariants) Graph transformation Graph transformation Model transformation (MDA) At the same level of abstraction Instances of the same meta-model

4 Introduction (cont ’ d) Use OCL and UML metamodel to define rules for refactoring UML model. Use OCL and UML metamodel to define rules for refactoring UML model. To check if a sequence of transformation is successfully applicable for a given mode before the transformations are executed on it. To check if a sequence of transformation is successfully applicable for a given mode before the transformations are executed on it.

5 Refactoring The behavior preservation is assured by so called “ preconditions ” and “ postconditions ”. The behavior preservation is assured by so called “ preconditions ” and “ postconditions ”. OCL constraints can be used to describe these pre and postconditions. OCL constraints can be used to describe these pre and postconditions. Refactoting Refactoting Code Code UML model UML model Database schemas Database schemas Software architecture Software architecture Software requirements Software requirements

6 Description of the “ Abstraction ” Transformation Instances of metamodel elements

7 context Package def: classes: Set(Class) = self.ownedClassifier->select(oclIsTypeOf(Class))->collect(c|c.oclAsType(Class)) def: generalizations: Set(Generalization)= self.ownedClassifier->collect(generalization) def: interfaces: Set(Interfaces::Interface)= self.ownedClassifier->select(oclIsTypeOf(Interfaces::Interface)) ->collect(c|c.oclAsType(Interfaces::Interface)) context Package::abstraction (product:String, absProduct:String) pre: classes->exists(name= product) and not classes->exists(name= absProduct) not interfaces->exists(name= absProduct) post: let: absProd:Class=classes->select(name=absProduct)->any(true) in let: gen:Generalization=generalizations->select(g|g.specific.name= product and g.general.name= absProduct)->any(true) in absProd.isAbstract=true and absProd.oclIsNew() and gen.oclIsNew()

8 Description of the “ Interface Extraction ” Transformation

9 context Package def: implementations:Set(Interfaces::Implementation)= self.ownedClassifier->collect(implementation) context Package::interfaceExtraction (creator:String, creatorInf:String) pre: classes->exists(name= creator) and not classes-> exists(name= creatorInf) and not interfaces-> exists(name= creatorInf) post: let: creatInf:Interface=interfaces->select(name=creatorInf)->any(true) in let: imp:Implementation=implemenations-> select(i:Implementation|i.ilementatingClassifier.name= creator and i.contract.name= creatorInf)->any(true) in let: creat:Class=classes->select(name=creator)->any(true) in creatInf.oclIsNew() and imp.oclIsNew and creat->collect(operation)->select(visibility=VisibilityKind::public)-> forAll(o1:Operation|creatInf->collect(operation)-> exists(o2:Operation|o2.hasSameSignature(o1))) and creatInf->collect(operation)->forAll(c:Operation| c.oclIsNew())

10 Composition of Refactorings The composition of refactorings would allow users of the tool to create their own complex refactorings that fullfill their specific needs. The composition of refactorings would allow users of the tool to create their own complex refactorings that fullfill their specific needs. It is easier to analyze composed refactorings if they are represented by one pre-post pair. It is easier to analyze composed refactorings if they are represented by one pre-post pair.

11

12 Calculate the composite precondition Calculate the composite postcondition

13 The first condition for our chain of refactorings to be legal is that every precondition must evaluate to true on its own system state. The second condition that must be satisfied is that if the postcondition of the first transformation description evaluates to true then the precondition of the second transformation description must also evaluate to true:

14 Example1

15 Example2

16 Example3

17

18 Example of a Composed Refactoring Rule context Package::composed (product:String, absProduct:String, creator:String, creatorInf:String) pre: classes->exists(name= product) and not classes->exists(name= absProduct) and not interfaces-> exists(name= absProduct) classes->exists(name= creator) and not classes-> exists(name= creatorInf) and not interfaces-> exists(name= creatorInf) and not absProduct=creatorInf

19 Example of a Composed Refactoring Rule post: let: absProd:Class=classes->select(name=absProduct)->any(true) in let: gen:Generalization=generalizations->select(g|g.specific.name= product and g.general.name= absProduct)->any(true) in let: creatInf:Interface=interfaces->select(name=creatorInf)->any(true) in let: imp:Implementation=implemenations-> select(i:Implementation|i.ilementatingClassifier.name= creator and i.contract.name= creatorInf)->any(true) in let: creat:Class=classes->select(name=creator)->any(true) in absProd.isAbstract=true and absProd.oclIsNew() and gen.oclIsNew() and creatInf.oclIsNew() and imp.oclIsNew and creat->collect(operation)->select(visibility=VisibilityKind::public)-> forAll(o1:Operation|creatInf->collect(operation)-> exists(o2:Operation|o2.hasSameSignature(o1))) and creatInf->collect(operation)->forAll(c:Operation| c.oclIsNew())

20

21 Related Work Opdyke represents refactorings as combinations of preconditions whose purpose is the preservation of behavior of a program. Opdyke represents refactorings as combinations of preconditions whose purpose is the preservation of behavior of a program. Roberts introduces postconditions into the refactoring process. Roberts introduces postconditions into the refactoring process. Compose refactoring related to design patterns. Compose refactoring related to design patterns. Refactoring: Using OCL expressions applied to the metamodel of UML. Refactoring: Using OCL expressions applied to the metamodel of UML.

22 Conclusion To validate the sequence of these transformations and to find the way of composing these transformations in order to get more complicated transformation that can be applied or used in further composition. To validate the sequence of these transformations and to find the way of composing these transformations in order to get more complicated transformation that can be applied or used in further composition. The future steps will involve the creation of a library of mini transformation descriptions in order to get some foundations for describing more complicated refactorings or design pattern. The future steps will involve the creation of a library of mini transformation descriptions in order to get some foundations for describing more complicated refactorings or design pattern.