22 July 2009 COMPSAC 2009 1 Tool Support for Design Pattern Recognition at Model Level Hong Zhu (1), Ian Bayley (1), Lijun Shan (2) and Richard Amphlett.

Slides:



Advertisements
Similar presentations
May 23, 2004OWL-S straw proposal for SWSL1 OWL-S Straw Proposal Presentation to SWSL Committee May 23, 2004 David Martin Mark Burstein Drew McDermott Deb.
Advertisements

1 Verification by Model Checking. 2 Part 1 : Motivation.
Diagram Definition: an Overview Third OMG/Eclipse Symposium 25 March 2012 Maged Elaasar, Senior Software Engineer.
1 Knowledge Representation Introduction KR and Logic.
Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.
Design Patterns.
Chapter 7 System Models.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
1 Jérôme Euzenat 655 avenue de lEurope, Montbonnot Saint-Martin, France Interoperability in an open semantic web (was:
Language Specification using Metamodelling Joachim Fischer Humboldt University Berlin LAB Workshop Geneva
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Conceptual / semantic modelling
Formal Models of Computation Part III Computability & Complexity
A Formal Descriptive Semantics of UML Lijun Shan Dept of Computer Science National University of Defense Technology, Changsha, China Hong Zhu Department.
Recognition of Patterns in Software Designs Models via Logic Inferences Hong Zhu Department of Computing and Electronics Oxford Brookes University Oxford.
A Calculus of Design Patterns Hong Zhu Dept. of Computing and Electronics Oxford Brookes University Oxford OX33 1HX, Uk
A Formal Descriptive Semantics of UML and Its Applications Hong Zhu Department of Computing and Electronics School of Technology.
Laws of Pattern Composition Hong Zhu and Ian Bayley Department of Computing and Electronics Oxford Brookes University Oxford OX33 1HX, Uk
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
Visual Model-based Software Development EUD-Net Workshop, Pisa, Italy September 23 rd, 2002 University of Paderborn Gregor Engels, Stefan Sauer University.
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn 2.4 The Z Notation [Reference: M. Spivey: The Z Notation, Prentice Hall]
Programming Language Concepts
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
McGill University School of Computer Science Ph.D. Candidate in the Modelling, Simulation and Design Lab MSDL09 De-/Re-constructing Model Transformation.
Knowledge Extraction from Technical Documents Knowledge Extraction from Technical Documents *With first class-support for Feature Modeling Rehan Rauf,
Configuration management
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing Semantics (Chapter 17) Muhammed Al-Mulhem March 1, 2009.
June, 2006 The 11th CAiSE06 International Workshop on Exploring Modeling Methods in Systems Analysis and Design (EMMSAD06), Luxembourg Ontological.
Quadratic Inequalities
Solving Equations How to Solve Them
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software processes 2.
آزمایشگاه مهندسی نرم افزار
SIMOCODE-DP Software.
What You Should Learn • Represent and classify real numbers.
25 seconds left…...
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Week 1.
Systems Analysis and Design in a Changing World, Fifth Edition
We will resume in: 25 Minutes.
14-1 © Prentice Hall, 2004 Chapter 14: OOSAD Implementation and Operation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh.
1Model Driven Architecture – 3. März 2008 – Siegfried Nolte 1.UML – What is it and what is it good for ? 2.MDA – What is it and what is it good for ? 3.MDA.
From Model-based to Model-driven Design of User Interfaces.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
Semantics Static semantics Dynamic semantics attribute grammars
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Train Control Language Teaching Computers Interlocking By: J. Endresen, E. Carlson, T. Moen1, K. J. Alme, Haugen, G. K. Olsen & A. Svendsen Synthesizing.
1 / 28 Harmony: An Approach and Tool for Combining Semi-formal and Formal Notations in Software Specification CS 791z Topics on Software Engineering Instructor’s.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
1 Scenario-based Analysis of UML Design Class Models Lijun Yu October 4th, 2010 Oslo, Norway.
Requirements Expression and Modelling
1 COSC 4406 Software Engineering COSC 4406 Software Engineering Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Nipissing University, 100.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Hong Zhu Dept of Computing and Communication Technologies Oxford Brookes University Oxford, OX33 1HX, UK TOWARDS.
Hong Zhu Department of Computing and Communication Technologies Oxford Brookes University, Oxford OX33 1HX, UK COMPSAC 2012 PANEL.
Semantics In Text: Chapter 3.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
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,
1 Modeling Formalism (Modeling Language Foundations) System Modeling Assessment & Roadmap Working Group Meeting – SE DSIG Reston – March, 2016 Yves BERNARD.
SysML v2 Formalism: Requirements & Benefits
Presentation transcript:

22 July 2009 COMPSAC Tool Support for Design Pattern Recognition at Model Level Hong Zhu (1), Ian Bayley (1), Lijun Shan (2) and Richard Amphlett (1) (1) School of Technology, Oxford Brookes University, Oxford OX33 1HX, UK (2) Dept. of Computer Science, National University of Defense Technology, Changsha, China

22 July COMPSAC 2009 Outline Motivation and Related works Tool support to the application of DPs Formalisation of DPs Our Previous work Specification of DPs Semantics of UML models The proposed approach Bridge the gaps The tool LAMBDES-DP Experiments Conclusion and future work

22 July COMPSAC 2009 Motivation Design Patterns (DPs) Reusable solutions to commonly occurring design problems Represented in Alexandrian form Synopsis, Context, Forces, Solution, Consequences, Implementation, Examples, Related patterns Proper use can improve software quality and development productivity Reduce ambiguity Automated tool support Explained in informal English Clarified with illustrative diagrams Specific code examples

22 July COMPSAC 2009 Existing works 1: Tool support Instantiation of patterns widely available in modelling tools Pattern recognition tools Code level: More than a dozen reported in the literature (Dong, Zhao and Peng, SERP 2007) Well-known examples: HEDGEHOG (Blewitt, Bundy and Stark, ASE 2005) FUJABA (Niere, et al. ICSE 2002) PINOT (Shi and Olsson, ASE 2006) Design/Model level (Kim and Lu, ICECCS06): Translate RBML and UML into Prolog (Kim and Shen, SAC07, SQJ 2008): RBMLCC Plug-in to IBM Rational Rose Pattern specified by metamodel in RBML Apply it to 7 of the 23 GoF patterns Class diagram only Low level of abstraction Late in development process Hard to improve precision and recall rate

22 July COMPSAC 2009 Existing works 2: Formalisation of DPs Le Guennec et al. (UML 2000): the extension of the UML meta- model and OCL Eden (2001): the graphical language LePUS Mapelsden et al. (CRPIT 02): Design Pattern Modeling Language Taibi (2003, 2006) and Mikkonen (ICSE98): the use of predicate logic and temporal logic Kim, France, Ghosh, and Song (COMPSAC 2003): Role-based metamodelling language RBML Bayley and Zhu (SEFM07, COMPSAC08, QSIC08): first order logic And many other works, e.g. Lano et al. (1996), Lauder and Kent (1998), Mak, et al. (ICSE04), Zdun and Avgeriou (OOPLSA05), etc.

22 July COMPSAC 2009 Previous work 1: Specification of DPs Formal meta-modelling in first order logic (Bayley and Zhu 2007, 2008) The abstract syntax of UML diagrams specified in GEBNF (Graphically Extended BNF). A first-order predicate logic (FOL) language systematically derived from the abstract syntax definition Specifying design patterns in the FOL as predicate on UML diagrams and pattern instantiation is predicate satisfaction. Advantages: Expressiveness: Both structural feature and behavioural features in the same FOL Variants of patterns can be specified All 23 GoF patterns are specified Readability: More readable than its rivals Facilitate reasoning, operations and transformations of DPs to formally prove their properties and relationships to compose patterns

22 July COMPSAC 2009 Example: Template Method pattern =

22 July COMPSAC 2009 Previous work 2: Semantics of UML models Descriptive semantics of modelling language (Shan and Zhu, 2008) The formal semantics of UML is resolved into two aspects: descriptive semantics: defines which systems are instances of a model. e.g. the system consists of two classes A and B, and A is a subclass of B. functional semantics: defines the basic modeling concepts, e.g. If class X is a subclass of Y, then all instances of X are also instances of Y. It describes the system without referring to what is meant by class and subclass. It defines the notion of class and subclass. Perhaps uses axioms on the dynamic behaviour of systems.

22 July COMPSAC 2009 Translation of models into First Order Logic Signature mapping: rules to derive symbols of FOL from the metamodel Axiom mapping: rules to derive statements in the FOL from the metamodel that must be true for all valid models Translation mapping: rules to translate a graphical model into predicates in FOL that it is true if and only if a system is an instance of the model Hypothesis mapping: rules that selected by the user to be applied in order to characterise the context in which the model is used

22 July COMPSAC 2009 Example: The following is a subset of the predicates generated from the diagram

22 July COMPSAC 2009 Bridging the Gap Differences between the FOL for DP spec and the FOL for UML semantics Syntactic difference Semantic difference Predicates in a DP specification are evaluated on UML models Predicates in the descriptive semantics of UML models are evaluated on software systems DP specification is translated into the syntax of FOL for descriptive semantics

22 July COMPSAC 2009 Example: The specification of Template Method can be translated into:

22 July COMPSAC 2009 P is a pattern. Spec(P) is the formal specification of P. The descriptive semantics of model m. System s is an instance of model m. System s satisfies the specification. Recognition of a pattern at design level becomes a logic inference problem.

22 July COMPSAC 2009 The Tool LAMBDES-DP

22 July COMPSAC 2009 Experiments: 1. Use StarUML to produce design instances as UML diagrams and export them as XMI representations. 2. Use LAMBDES to convert these XMI representations to FOL; 3. Use LAMBDES to check these FOL representations for consistency errors, revising them until there are no more errors; 4. For each pattern, use LAMBDES-DP to determine if the model conforms to (i.e. implies the specification of) the pattern. Three possible outcomes: Proof Found, meaning definitely yes, Completion Found, meaning definitely no, and Time Out, meaning that no proof was found in the maximum time limit that SPASS allows, which is 990 seconds.

22 July COMPSAC 2009 Subjects of the experiments Patterns: 23 Patterns in GoF book Design Instances: Two sets of design instances were produced manually from the diagrams in the GoF book. Set 1 (Class Only): contains a class diagram for each of the 23 patterns in the book. Set 2 (Class + Seq): contains class and sequence diagrams for the only 6 patterns in the book that contain both.

22 July COMPSAC 2009 Overview of the Design Instances: ClassOnly Set

22 July COMPSAC 2009 Overview of the Design Instances: Class+Seq Set

22 July COMPSAC 2009 Experiment Results ClassOnlyClass+Seq Recall (False negative error rate) 0% Precision (False positive error rate) < 22%0% Conclusion: Recognition of patterns at design level can be accurate with good precision and recall rate; Behavioural feature is crucial for accurate specification and hence the recognition of patterns, as we have argued in (Bayley and Zhu, COMPSAC 2008);

22 July COMPSAC 2009 Future work Improvement of the efficiency of LAMBDES-DP SPASS cannot handle the inference of large logic systems (when it has more than 1000 formulas, which is equivalent to models that have more than 10 elements.) Enhance LAMBDES-DP functionality Pattern composition Pattern directed refactoring at design level Reasoning about patterns Experiment with industrial real systems Integration with code level tools Some tools extract information from code and represent the extracted information in the form of first order logic predicates

22 July COMPSAC 2009 References I. Bayley and H. Zhu. Formalising design patterns in predicate logic. In Proc. of SEFM07, pp 25–36. I. Bayley and H. Zhu. On the composition of design patterns. Proc. of QSIC08, pp27–36. I. Bayley and H. Zhu. Specifying behavioural features of design patterns in first order logic. Proc. of COMPSAC08, pp203–210. L. Shan and H. Zhu. A formal descriptive semantics of UML. Proc. of ICFEM09, pp375–396. L. Shan and H. Zhu, Semantics of Metamodels in UML, Proc. of TASE09. (In press)