SlideShare ist ein Scribd-Unternehmen logo
1 von 95
Downloaden Sie, um offline zu lesen
Planning Messages in Sequence Diagrams and
 Analyzing the Consistency of Use Cases and
Class Diagrams Automatically using Design by
                 Contract
                MS Thesis Defense

                 Yaser Sulaiman

                     Advisor
                Dr. Moataz Ahmed

                December 29, 2012
title
“I made this [letter] very long, because I did not have the
leisure to make it shorter.”
                                              —Blaise Pascal




                                                               2
        Photo by y.caradec
Under the right conditions,
sequence diagram generation is a
       planning problem



                               3
4
Photo by roeyahram
Background


    Sequence Diagram Generation as a Planning Problem

                            Literature Review


                            Research Questions

Communiqué: A Library for Planning Messages in Sequence Diagrams


                               Experiments

                               Conclusions
                                                               5
Photo by Kitty Terwolbeck
Background




                                      6
Photo by nickwheeleroz
Function




            System

Structure              Behavior




                                  7
Use Cases



Sequence
Diagrams




           System
                         State
  Class
                       Transition
Diagrams
                       Diagrams




                                    8
Class          Sequence
Use Case
              Diagram         Diagram



                  vs.

       Use Case
                        Sequence
                        Diagram
        Class
       Diagram
                                         9
Design by Contract (DbC)




                           10
11
Photo by my brother Maher
The C in DbC


      Contracts (preconditions +
 postconditions) semantically specify
the relation between routines & callers



                                    12
DbC (Eiffel) in Action

-- A pop routine of a limited-capacity
-- stack.
pop(): T
  require
    not empty
  do
    ..
  ensure
    not full
    count = old count - 1
  end
                                     13
Object Constraint Language (OCL)



    UML       DbC       OCL




                               14
OCL in Action

-- Assuming Stack has Boolean
-- isEmpty() & isFull() methods &
-- integer count attribute.
context Stack::pop(): T
  pre: not self.isEmpty()
  post: not self.isFull() and
    self.count = self.count@pre - 1

                                      15
Automated Planning



s0   a1   s1    a2   s2   a3   …   ag   sg




               Σ = (𝑆, 𝐴, 𝛾)
                                             16
s0   a1   s1   a2   s2   a3   …   ag   sg




                                            17
Forward State-Space Search



   s0      …       sg


                             18
Backward State-Space Search



    s0      …       sg


                              19
Languages

  Design by Contract                  Automated Planning
                             Stanford Research Institute Problem Solver
          Eiffel
                                    Action Description Language
Object Constraint Language
                               Planning Domain Definition Language




                                                                   20
PDDL in Action


(:action pop
    :parameters (?s Stack)
    :precondition (> (count ?s) 0)
    :effect (decrease (count ?s) 1)
)


                                      21
Sequence Diagram Generation as a Planning Problem




                                                     22
Photo by miuenski
Correspondence between Planning
           and DbC

  Automated Planning       Design by Contract
       Initial State      Use Case Preconditions
          Goal            Use Case Postconditions
         Actions                 Methods
   Action Preconditions   Method Preconditions
      Action Effects      Method Postconditions




                                                    23
States as Object Diagrams




                            24
s0   a1   s1   a2   s2   a3   …   ag   sg




                                            25
Literature Review




                                        26
Photo by cj&erson
Paper                   Focus                                    Main Idea

                                                A parser to translate a manually normalized use case to
   Liwu Li (2000)         Model Generation
                                                message records
Köster, Six & Winter                            Using refined activity diagrams to couple use cases & class
                         Consistency Analysis
       (2001)                                   models
                                                Using set theory & first-order logic to check consistency
Li, Liu & He (2005)      Consistency Analysis
                                                between the use case model & the conceptual class model
                                                Using a queue & BFS to detect inconsistencies between well-
 Long et al. (2005)      Consistency Analysis
                                                formed class & sequence diagrams
                                                A context-free grammar for use case, activity & class
Chanda et al. (2009)     Consistency Analysis
                                                diagrams
   Yue, Briand &                                A systematic review focusing on transforming textual
                          Model Generation
   Labiche (2010)                               requirements to analysis models in the context of MDD
   Yue, Briand &                                A technique to automatically derive analysis models from
                          Model Generation
   Labiche (2010)                               use cases while maintaining traceability links
  Ghezzi, Mocci &                               Using symbolic model checking to cross-validate algebraic
                         Consistency Analysis
 Salvaneschi (2010)                             specifications against intensional behavior models
                                                Using the B method to automatically analyze the consistency
de Sousa et al. (2010)   Consistency Analysis
                                                of requirements
                          RE & Automated
Vaquero et al. (2011)                           itSIMPLE: an IDE for automated planning applications
                             Planning
 Sulaiman & Ahmed         RE & Automated        Using itSIMPLE to demonstrate treating sequence diagram
       (2012)                Planning           generation as a planning problem
                                                                                                          27
Vaquero et al.
Requirements &
                                    Automated
  Knowledge
                                     Planning
 Engineering
                 Sulaiman & Ahmed




                                                28
Message            Receiver             Parameter

0:   (LOGIN PROFILE) [1]
1:   (ACTIVATE ACCOUNT PROFILE) [1]
2:   (WITHDRAW ACCOUNT PROFILE AMOUNT) [1]
3:   (LOGOUT PROFILE) [1]

           But what about the Sender?



                                                29
Research Questions




                                         30
Photo by Oberazzi
Q1: How can sequence diagrams be automatically
generated from DbC’ed use cases and class diagrams?

  Q2: How can that process be used to analyze the
 consistency between use cases and class diagrams?

Q3: Which contract language should be used to enable
                 those processes?

  Q4: How do the automatically-generated sequence
 diagrams compare to the manually-generated ones?

                                                 31
Communiqué: A Library for Planning Messages in Sequence Diagrams




                                                               32
Available on Github
http://git.io/communique



Implemented in
                            Ruby

     Logo by Yukihiro Matsumoto    33
Use Case
                             Sequence
                Communiqué
                             Diagram
Class Diagram
   Instance




                                        34
35
Forward-search(s0, g)
  n ← [s0, the empty plan]
  Enqueue(n, f(n))

  until queue is empty
    s, π ← Dequeue-min()
    if s satisfies g then return π
    applicable ← {m | precond(m) is true in s}
    if applicable = ϕ then next
    for each m ϵ applicable
      n ← [γ(s, m), π.m]
      Enqueue(n, f(n))

  return failure

                                                 36
s0

    …
    …
…        …
…        …

    …
         sg



              37
The Evaluation (or Objective)
                  Function
Cost so far; depth of n; # of previous message passes



            −& 𝑔 𝑛 ,  &&&&&&&&&&&&DFS
      𝑓 𝑛 =  &𝑔 𝑛 ,   &&&&&&&&&&&&BFS
             &𝑔 𝑛 + ℎ 𝑛 ,          A∗

              Estimated cost to goal; estimated # of remaining message passes


                                                                       38
h(n) = # objects not satisfying their
               goals



                                  39
h(n) is not admissible: it may
overestimate the cost of reaching
             the goal



                                40
h(n) non-admissibility
                ⇒
           planner non-optimality



                              41
To determine the sender of a
   message, Communiqué uses the
links between the objects along with
        some rules of thumb


                                 42
Sender-Selection Assumptions
           The Actor initiates the use case

      Boundary objects interact with the Actor

Dependent objects are responsible for the objects they
                       create

           A sender must already be active

      A sender must have a link to the receiver
                                                   43
OCL-Like Ruby Expressions for
      Pre- & Postconditions

context Stack::pop(): T
  pre: not self.isEmpty()
  post: not self.isFull() and
    self.count = self.count@pre - 1

pop = DbcMethod.new(:pop)
pop.precondition = Proc.new { self.is_empty? }
pop.postcondition = Proc.new { @count -= 1 }



                                                 44
Experiments


                                45
Photo by kanonn
The original models were not
DbC’ed; I added what I believed to
   be commonsense contracts



                                46
Experiment #1

Simple Sequence Diagrams



                           47
Properties Management System* –
          Class Diagram




          *   Aman et al. Senior Project   48
Add Property                 Modify Property




Select Featured Property           Delete Property         Modify Announcement




                                                                          49
Experiment #2

More Complex Sequence Diagrams



                            50
Weather Station System* – Class
           Diagram




       *   Ian Sommerville. Software Engineering   51
Weather Station System –
       Sequence Diagram
Textbook’s Diagram   Communiqué’s Output




                                      52
2Bwatch* – Class Diagram




  *   Bruegge and Dutoit. OOSE using UML, Patterns & Java   53
2Bwatch – Sequence Diagram




                             54
Did you notice something wrong?




                             55
56
I didn’t*.. until I saw Communiqué’s
                 output



           *   After all, I’m not a software engineer   57
Textbook’s Diagram   Communiqué’s Output




                                      58
There is no association to support sending refresh() as
       it appears in the book’s sequence diagram

                                                   59
Now, what would Communiqué do?


                                 60
Textbook’s Diagram   Communiqué’s New Output




                                        61
“You’re doing
                       it wrong!”




                                 62
Photo by philomythus
Textbook’s Diagram   Communiqué’s New Output




                                        63
“Success!”



                                                   64
Photo used with permission from Laney G
Experiment #3

Effects of Noise

        “Irrelevant” methods

                               65
Always applicable




                    Does nothing


                                   66
These methods has an effect similar
  to that of a large class diagram



                                67
MeetingsMate* – Class Diagram




         *   Al Akel et al. Senior Project   68
MeetingsMate – Sequence Diagram




                              69
70
71
72
# of noise methods


DFS explored 𝑂(𝑚) states, but the solution was of
                length 𝑂(𝑚)

 BFS found the optimal solution, but it explored
                  𝑂(𝑐 𝑚 ) states

 Best-first search explored 𝑂(𝑚) and found the
                 optimal solution


                                             73
Experiment #4

Non-Optimality of Communiqué’s
      Best-First Search


                            74
h(n) non-admissibility
                ⇒
           planner non-optimality



                              75
76
Optimal Diagram   Communiqué’s Output




                                   77
f(n) = g(n) + h(n)

                                           s0   0+3
prepare_to_satisfy_all_objects_at_once()          satisfy_objects_1_and_2()




                 1+3            s1                      s2        1+1


satisfy_all_objects_at_once()                                prepare_to_satisfy_object_3()




                 2+0         sg1                        s3        2+1


                                                             satisfy_object_3()




                                                        sg2       3+0

                                                                                         78
f(n) = g(n) + h(n)

                                           s0   0+3
prepare_to_satisfy_all_objects_at_once()          satisfy_objects_1_and_2()




                 1+3            s1                      s2        1+1


satisfy_all_objects_at_once()                                prepare_to_satisfy_object_3()




                 2+0         sg1                        s3        2+1


                                                             satisfy_object_3()




                                                        sg2       3+0

                                                                                         79
Experiment #5

Object Instantiation



                       80
Oh how meta!

               81
82
Experiment #6

Failure Handling



                   83
If Communiqué fails to find a
solution, it points to possible
  sources of inconsistencies



                                  84
85
86
Conclusions
                                    87
Photo by Peter Zoon
Action Planners           Message-Passing
                                                     Communiqué
                          Action Planners
                                                       Planner
                         Typically, predefined
State Representation                                  A set of objects
                            state variables
    Specification                                     OCL-like
                                                      OCL-like Ruby
                        STRIPS, ADL, or PDDL
     Language                                          expressions
                                                    Preconditions plus
    Constraints           Preconditions only          semantic class
                                                       relationships
Creation of New State
                        Typically, not supported   Object instantiations*
    Components




                                                                            88
Limitations*




*   “It’s not a bug; it’s a feature.”   89
Instantaneous State Transitions




                              90
Sender-Selection Inaccuracies

Textbook’s Diagram   Communiqué’s Output




                                      91
Other Limitations
Non-Optimality of Communiqué’s Best-First Search

             Limited Message Types

             Limited Actor Support

      No Support for Combined Fragments

        Not Comparing States for Equality

          Possible Bias in Experiments

     Using Ruby for Inputs and Raw Outputs
                                                   92
Future Work
    Handle Time Explicitly

   Design a Better Heuristic

Try Other Planning Algorithms &
          Approaches

Use XMI for Inputs and Outputs

                                  93
…</presentation>
  <questions>…



                   94
Sender-Selection Rules
1. If the message is the 1st in the sequence of
   message passes, select the Actor.
2. If the receiver of the message is a boundary
   object, select the Actor.
3. If the receiver of the message is a dependency
   object, select the object’s creator.
4. If the message has more than one candidate
   sender, select the most recently activated
   candidate sender.
5. If the message does not have any candidate
   sender, select the Actor.
                                                    95

Weitere ähnliche Inhalte

Was ist angesagt?

MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...
MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...
MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...Dagmar Monett
 
2 tri partite model algebra
2 tri partite model algebra2 tri partite model algebra
2 tri partite model algebraAle Cignetti
 
ICSM04 Poster.ppt
ICSM04 Poster.pptICSM04 Poster.ppt
ICSM04 Poster.pptPtidej Team
 
What the matrix can tell us about the social network.
What the matrix can tell us about the social network.What the matrix can tell us about the social network.
What the matrix can tell us about the social network.David Gleich
 
CCIA'2008: On the dimensions of data complexity through synthetic data sets
CCIA'2008: On the dimensions of data complexity through synthetic data setsCCIA'2008: On the dimensions of data complexity through synthetic data sets
CCIA'2008: On the dimensions of data complexity through synthetic data setsAlbert Orriols-Puig
 
3D visualization with VTVK and MayaVi2
3D visualization with VTVK and MayaVi23D visualization with VTVK and MayaVi2
3D visualization with VTVK and MayaVi2zukun
 

Was ist angesagt? (8)

Phd Defense 2007
Phd Defense 2007Phd Defense 2007
Phd Defense 2007
 
MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...
MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...
MATHEON D-Day: Numerical simulation of integrated circuits for future chip ge...
 
Class01
Class01Class01
Class01
 
2 tri partite model algebra
2 tri partite model algebra2 tri partite model algebra
2 tri partite model algebra
 
ICSM04 Poster.ppt
ICSM04 Poster.pptICSM04 Poster.ppt
ICSM04 Poster.ppt
 
What the matrix can tell us about the social network.
What the matrix can tell us about the social network.What the matrix can tell us about the social network.
What the matrix can tell us about the social network.
 
CCIA'2008: On the dimensions of data complexity through synthetic data sets
CCIA'2008: On the dimensions of data complexity through synthetic data setsCCIA'2008: On the dimensions of data complexity through synthetic data sets
CCIA'2008: On the dimensions of data complexity through synthetic data sets
 
3D visualization with VTVK and MayaVi2
3D visualization with VTVK and MayaVi23D visualization with VTVK and MayaVi2
3D visualization with VTVK and MayaVi2
 

Andere mochten auch

08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 
Agile Software Development With SCRUM
Agile Software Development With SCRUMAgile Software Development With SCRUM
Agile Software Development With SCRUMAlexey Krivitsky
 
Contracting for Agile Software Development
Contracting for Agile Software DevelopmentContracting for Agile Software Development
Contracting for Agile Software Developmentcspag67
 
Intro Agile Software Development with Scrum for Campus Party 2009
Intro Agile Software Development with Scrum for Campus Party 2009Intro Agile Software Development with Scrum for Campus Party 2009
Intro Agile Software Development with Scrum for Campus Party 2009Antonio Silveira
 
Lecture#08 sequence diagrams
Lecture#08 sequence diagramsLecture#08 sequence diagrams
Lecture#08 sequence diagramsbabak danyal
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSAshita Agrawal
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialCreately
 
High Quality Software Development with Agile and Scrum
High Quality Software Development with Agile and ScrumHigh Quality Software Development with Agile and Scrum
High Quality Software Development with Agile and ScrumLemi Orhan Ergin
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbolsKumar
 
OOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMSOOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMSMikel Raj
 
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...Ivano Malavolta
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Overview of Agile Methodology
Overview of Agile MethodologyOverview of Agile Methodology
Overview of Agile MethodologyHaresh Karkar
 

Andere mochten auch (17)

08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
Uml sequence diagrams
Uml sequence diagramsUml sequence diagrams
Uml sequence diagrams
 
Agile Software Development With SCRUM
Agile Software Development With SCRUMAgile Software Development With SCRUM
Agile Software Development With SCRUM
 
Diagrams
DiagramsDiagrams
Diagrams
 
Contracting for Agile Software Development
Contracting for Agile Software DevelopmentContracting for Agile Software Development
Contracting for Agile Software Development
 
Intro Agile Software Development with Scrum for Campus Party 2009
Intro Agile Software Development with Scrum for Campus Party 2009Intro Agile Software Development with Scrum for Campus Party 2009
Intro Agile Software Development with Scrum for Campus Party 2009
 
Lecture#08 sequence diagrams
Lecture#08 sequence diagramsLecture#08 sequence diagrams
Lecture#08 sequence diagrams
 
Sequence diagrams in UML
Sequence diagrams in UMLSequence diagrams in UML
Sequence diagrams in UML
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram Tutorial
 
High Quality Software Development with Agile and Scrum
High Quality Software Development with Agile and ScrumHigh Quality Software Development with Agile and Scrum
High Quality Software Development with Agile and Scrum
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbols
 
OOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMSOOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMS
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Overview of Agile Methodology
Overview of Agile MethodologyOverview of Agile Methodology
Overview of Agile Methodology
 

Ähnlich wie Planning-Based Approach for Automating Sequence Diagram Generation

My M.S. Thesis Proposal
My M.S. Thesis ProposalMy M.S. Thesis Proposal
My M.S. Thesis ProposalYaser Sulaiman
 
Collaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph ClusteringCollaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph ClusteringWaqas Nawaz
 
Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...
Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...
Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...LLGYeo
 
03 ooad uml-03
03 ooad uml-0303 ooad uml-03
03 ooad uml-03Niit Care
 
Software Architecture: views and viewpoints
Software Architecture: views and viewpointsSoftware Architecture: views and viewpoints
Software Architecture: views and viewpointsHenry Muccini
 
An Automatic Approach to Translate Use Cases to Sequence Diagrams
An Automatic Approach to Translate Use Cases to Sequence DiagramsAn Automatic Approach to Translate Use Cases to Sequence Diagrams
An Automatic Approach to Translate Use Cases to Sequence DiagramsMohammed Misbhauddin
 
10.1.1.70.8789
10.1.1.70.878910.1.1.70.8789
10.1.1.70.8789Hoài Bùi
 
212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Umlguestac67362
 
Representative Previous Work
Representative Previous WorkRepresentative Previous Work
Representative Previous Workbutest
 
Representative Previous Work
Representative Previous WorkRepresentative Previous Work
Representative Previous Workbutest
 
Extending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective LanguagesExtending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective Languagesfranciscoortin
 
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011Alberto Lluch Lafuente
 
Reverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLsReverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLsDavid Méndez-Acuña
 
Library of Coupled Operators
Library of Coupled OperatorsLibrary of Coupled Operators
Library of Coupled OperatorsSander Vermolen
 
Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...
Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...
Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...Pirouz Nourian
 

Ähnlich wie Planning-Based Approach for Automating Sequence Diagram Generation (20)

My M.S. Thesis Proposal
My M.S. Thesis ProposalMy M.S. Thesis Proposal
My M.S. Thesis Proposal
 
Collaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph ClusteringCollaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph Clustering
 
Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...
Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...
Object Oriented Programming Implementation of Scalar, Vector, and Tensor Vari...
 
03 ooad uml-03
03 ooad uml-0303 ooad uml-03
03 ooad uml-03
 
Software Architecture: views and viewpoints
Software Architecture: views and viewpointsSoftware Architecture: views and viewpoints
Software Architecture: views and viewpoints
 
An Automatic Approach to Translate Use Cases to Sequence Diagrams
An Automatic Approach to Translate Use Cases to Sequence DiagramsAn Automatic Approach to Translate Use Cases to Sequence Diagrams
An Automatic Approach to Translate Use Cases to Sequence Diagrams
 
10.1.1.70.8789
10.1.1.70.878910.1.1.70.8789
10.1.1.70.8789
 
212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml212101 Object Oriented Analysis Design Through Uml
212101 Object Oriented Analysis Design Through Uml
 
GraphREL: A Relational Graph Query Processor
GraphREL: A Relational Graph Query ProcessorGraphREL: A Relational Graph Query Processor
GraphREL: A Relational Graph Query Processor
 
Representative Previous Work
Representative Previous WorkRepresentative Previous Work
Representative Previous Work
 
Representative Previous Work
Representative Previous WorkRepresentative Previous Work
Representative Previous Work
 
An Algebra of Hierarchical Graphs
An Algebra of Hierarchical GraphsAn Algebra of Hierarchical Graphs
An Algebra of Hierarchical Graphs
 
Extending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective LanguagesExtending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective Languages
 
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
 
Ix2515851588
Ix2515851588Ix2515851588
Ix2515851588
 
Ix2515851588
Ix2515851588Ix2515851588
Ix2515851588
 
Reverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLsReverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLs
 
Library of Coupled Operators
Library of Coupled OperatorsLibrary of Coupled Operators
Library of Coupled Operators
 
ThesisProposal
ThesisProposalThesisProposal
ThesisProposal
 
Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...
Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...
Point Cloud Processing: Estimating Normal Vectors and Curvature Indicators us...
 

Kürzlich hochgeladen

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Kürzlich hochgeladen (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Planning-Based Approach for Automating Sequence Diagram Generation

  • 1. Planning Messages in Sequence Diagrams and Analyzing the Consistency of Use Cases and Class Diagrams Automatically using Design by Contract MS Thesis Defense Yaser Sulaiman Advisor Dr. Moataz Ahmed December 29, 2012
  • 2. title “I made this [letter] very long, because I did not have the leisure to make it shorter.” —Blaise Pascal 2 Photo by y.caradec
  • 3. Under the right conditions, sequence diagram generation is a planning problem 3
  • 5. Background Sequence Diagram Generation as a Planning Problem Literature Review Research Questions Communiqué: A Library for Planning Messages in Sequence Diagrams Experiments Conclusions 5 Photo by Kitty Terwolbeck
  • 6. Background 6 Photo by nickwheeleroz
  • 7. Function System Structure Behavior 7
  • 8. Use Cases Sequence Diagrams System State Class Transition Diagrams Diagrams 8
  • 9. Class Sequence Use Case Diagram Diagram vs. Use Case Sequence Diagram Class Diagram 9
  • 10. Design by Contract (DbC) 10
  • 11. 11 Photo by my brother Maher
  • 12. The C in DbC Contracts (preconditions + postconditions) semantically specify the relation between routines & callers 12
  • 13. DbC (Eiffel) in Action -- A pop routine of a limited-capacity -- stack. pop(): T require not empty do .. ensure not full count = old count - 1 end 13
  • 14. Object Constraint Language (OCL) UML DbC OCL 14
  • 15. OCL in Action -- Assuming Stack has Boolean -- isEmpty() & isFull() methods & -- integer count attribute. context Stack::pop(): T pre: not self.isEmpty() post: not self.isFull() and self.count = self.count@pre - 1 15
  • 16. Automated Planning s0 a1 s1 a2 s2 a3 … ag sg Σ = (𝑆, 𝐴, 𝛾) 16
  • 17. s0 a1 s1 a2 s2 a3 … ag sg 17
  • 20. Languages Design by Contract Automated Planning Stanford Research Institute Problem Solver Eiffel Action Description Language Object Constraint Language Planning Domain Definition Language 20
  • 21. PDDL in Action (:action pop :parameters (?s Stack) :precondition (> (count ?s) 0) :effect (decrease (count ?s) 1) ) 21
  • 22. Sequence Diagram Generation as a Planning Problem 22 Photo by miuenski
  • 23. Correspondence between Planning and DbC Automated Planning Design by Contract Initial State Use Case Preconditions Goal Use Case Postconditions Actions Methods Action Preconditions Method Preconditions Action Effects Method Postconditions 23
  • 24. States as Object Diagrams 24
  • 25. s0 a1 s1 a2 s2 a3 … ag sg 25
  • 26. Literature Review 26 Photo by cj&erson
  • 27. Paper Focus Main Idea A parser to translate a manually normalized use case to Liwu Li (2000) Model Generation message records Köster, Six & Winter Using refined activity diagrams to couple use cases & class Consistency Analysis (2001) models Using set theory & first-order logic to check consistency Li, Liu & He (2005) Consistency Analysis between the use case model & the conceptual class model Using a queue & BFS to detect inconsistencies between well- Long et al. (2005) Consistency Analysis formed class & sequence diagrams A context-free grammar for use case, activity & class Chanda et al. (2009) Consistency Analysis diagrams Yue, Briand & A systematic review focusing on transforming textual Model Generation Labiche (2010) requirements to analysis models in the context of MDD Yue, Briand & A technique to automatically derive analysis models from Model Generation Labiche (2010) use cases while maintaining traceability links Ghezzi, Mocci & Using symbolic model checking to cross-validate algebraic Consistency Analysis Salvaneschi (2010) specifications against intensional behavior models Using the B method to automatically analyze the consistency de Sousa et al. (2010) Consistency Analysis of requirements RE & Automated Vaquero et al. (2011) itSIMPLE: an IDE for automated planning applications Planning Sulaiman & Ahmed RE & Automated Using itSIMPLE to demonstrate treating sequence diagram (2012) Planning generation as a planning problem 27
  • 28. Vaquero et al. Requirements & Automated Knowledge Planning Engineering Sulaiman & Ahmed 28
  • 29. Message Receiver Parameter 0: (LOGIN PROFILE) [1] 1: (ACTIVATE ACCOUNT PROFILE) [1] 2: (WITHDRAW ACCOUNT PROFILE AMOUNT) [1] 3: (LOGOUT PROFILE) [1] But what about the Sender? 29
  • 30. Research Questions 30 Photo by Oberazzi
  • 31. Q1: How can sequence diagrams be automatically generated from DbC’ed use cases and class diagrams? Q2: How can that process be used to analyze the consistency between use cases and class diagrams? Q3: Which contract language should be used to enable those processes? Q4: How do the automatically-generated sequence diagrams compare to the manually-generated ones? 31
  • 32. Communiqué: A Library for Planning Messages in Sequence Diagrams 32
  • 33. Available on Github http://git.io/communique Implemented in Ruby Logo by Yukihiro Matsumoto 33
  • 34. Use Case Sequence Communiqué Diagram Class Diagram Instance 34
  • 35. 35
  • 36. Forward-search(s0, g) n ← [s0, the empty plan] Enqueue(n, f(n)) until queue is empty s, π ← Dequeue-min() if s satisfies g then return π applicable ← {m | precond(m) is true in s} if applicable = ϕ then next for each m ϵ applicable n ← [γ(s, m), π.m] Enqueue(n, f(n)) return failure 36
  • 37. s0 … … … … … … … sg 37
  • 38. The Evaluation (or Objective) Function Cost so far; depth of n; # of previous message passes −& 𝑔 𝑛 , &&&&&&&&&&&&DFS 𝑓 𝑛 = &𝑔 𝑛 , &&&&&&&&&&&&BFS &𝑔 𝑛 + ℎ 𝑛 , A∗ Estimated cost to goal; estimated # of remaining message passes 38
  • 39. h(n) = # objects not satisfying their goals 39
  • 40. h(n) is not admissible: it may overestimate the cost of reaching the goal 40
  • 41. h(n) non-admissibility ⇒ planner non-optimality 41
  • 42. To determine the sender of a message, Communiqué uses the links between the objects along with some rules of thumb 42
  • 43. Sender-Selection Assumptions The Actor initiates the use case Boundary objects interact with the Actor Dependent objects are responsible for the objects they create A sender must already be active A sender must have a link to the receiver 43
  • 44. OCL-Like Ruby Expressions for Pre- & Postconditions context Stack::pop(): T pre: not self.isEmpty() post: not self.isFull() and self.count = self.count@pre - 1 pop = DbcMethod.new(:pop) pop.precondition = Proc.new { self.is_empty? } pop.postcondition = Proc.new { @count -= 1 } 44
  • 45. Experiments 45 Photo by kanonn
  • 46. The original models were not DbC’ed; I added what I believed to be commonsense contracts 46
  • 48. Properties Management System* – Class Diagram * Aman et al. Senior Project 48
  • 49. Add Property Modify Property Select Featured Property Delete Property Modify Announcement 49
  • 50. Experiment #2 More Complex Sequence Diagrams 50
  • 51. Weather Station System* – Class Diagram * Ian Sommerville. Software Engineering 51
  • 52. Weather Station System – Sequence Diagram Textbook’s Diagram Communiqué’s Output 52
  • 53. 2Bwatch* – Class Diagram * Bruegge and Dutoit. OOSE using UML, Patterns & Java 53
  • 54. 2Bwatch – Sequence Diagram 54
  • 55. Did you notice something wrong? 55
  • 56. 56
  • 57. I didn’t*.. until I saw Communiqué’s output * After all, I’m not a software engineer 57
  • 58. Textbook’s Diagram Communiqué’s Output 58
  • 59. There is no association to support sending refresh() as it appears in the book’s sequence diagram 59
  • 60. Now, what would Communiqué do? 60
  • 61. Textbook’s Diagram Communiqué’s New Output 61
  • 62. “You’re doing it wrong!” 62 Photo by philomythus
  • 63. Textbook’s Diagram Communiqué’s New Output 63
  • 64. “Success!” 64 Photo used with permission from Laney G
  • 65. Experiment #3 Effects of Noise “Irrelevant” methods 65
  • 66. Always applicable Does nothing 66
  • 67. These methods has an effect similar to that of a large class diagram 67
  • 68. MeetingsMate* – Class Diagram * Al Akel et al. Senior Project 68
  • 70. 70
  • 71. 71
  • 72. 72
  • 73. # of noise methods DFS explored 𝑂(𝑚) states, but the solution was of length 𝑂(𝑚) BFS found the optimal solution, but it explored 𝑂(𝑐 𝑚 ) states Best-first search explored 𝑂(𝑚) and found the optimal solution 73
  • 74. Experiment #4 Non-Optimality of Communiqué’s Best-First Search 74
  • 75. h(n) non-admissibility ⇒ planner non-optimality 75
  • 76. 76
  • 77. Optimal Diagram Communiqué’s Output 77
  • 78. f(n) = g(n) + h(n) s0 0+3 prepare_to_satisfy_all_objects_at_once() satisfy_objects_1_and_2() 1+3 s1 s2 1+1 satisfy_all_objects_at_once() prepare_to_satisfy_object_3() 2+0 sg1 s3 2+1 satisfy_object_3() sg2 3+0 78
  • 79. f(n) = g(n) + h(n) s0 0+3 prepare_to_satisfy_all_objects_at_once() satisfy_objects_1_and_2() 1+3 s1 s2 1+1 satisfy_all_objects_at_once() prepare_to_satisfy_object_3() 2+0 sg1 s3 2+1 satisfy_object_3() sg2 3+0 79
  • 82. 82
  • 84. If Communiqué fails to find a solution, it points to possible sources of inconsistencies 84
  • 85. 85
  • 86. 86
  • 87. Conclusions 87 Photo by Peter Zoon
  • 88. Action Planners Message-Passing Communiqué Action Planners Planner Typically, predefined State Representation A set of objects state variables Specification OCL-like OCL-like Ruby STRIPS, ADL, or PDDL Language expressions Preconditions plus Constraints Preconditions only semantic class relationships Creation of New State Typically, not supported Object instantiations* Components 88
  • 89. Limitations* * “It’s not a bug; it’s a feature.” 89
  • 92. Other Limitations Non-Optimality of Communiqué’s Best-First Search Limited Message Types Limited Actor Support No Support for Combined Fragments Not Comparing States for Equality Possible Bias in Experiments Using Ruby for Inputs and Raw Outputs 92
  • 93. Future Work Handle Time Explicitly Design a Better Heuristic Try Other Planning Algorithms & Approaches Use XMI for Inputs and Outputs 93
  • 95. Sender-Selection Rules 1. If the message is the 1st in the sequence of message passes, select the Actor. 2. If the receiver of the message is a boundary object, select the Actor. 3. If the receiver of the message is a dependency object, select the object’s creator. 4. If the message has more than one candidate sender, select the most recently activated candidate sender. 5. If the message does not have any candidate sender, select the Actor. 95