Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Planning-Based Approach for Automating Sequence Diagram Generation

Planning-Based Approach for Automating Sequence Diagram Generation

The slideshow I used to defend my Computer Science M.S. Thesis, which at the time of the defense had a terrible title that was later officially changed to Planning-Based Approach for Automating Sequence Diagram Generation.

Yaser Sulaiman

December 29, 2012
Tweet

More Decks by Yaser Sulaiman

Other Decks in Research

Transcript

  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. 2 Photo by y.caradec “I made this [letter] very long,

    because I did not have the leisure to make it shorter.” —Blaise Pascal title
  3. 5 Photo by Kitty Terwolbeck Research Questions Communiqué: A Library

    for Planning Messages in Sequence Diagrams Experiments Conclusions Background Sequence Diagram Generation as a Planning Problem Literature Review
  4. DbC (Eiffel) in Action 13 -- A pop routine of

    a limited-capacity -- stack. pop(): T require not empty do .. ensure not full count = old count - 1 end
  5. OCL in Action 15 -- 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
  6. Automated Planning 16 s 0 a1 s 1 s 2

    … s g a2 a3 ag Σ = (, , )
  7. Languages 20 Design by Contract Automated Planning Eiffel Object Constraint

    Language Stanford Research Institute Problem Solver Action Description Language Planning Domain Definition Language
  8. PDDL in Action 21 (:action pop :parameters (?s Stack) :precondition

    (> (count ?s) 0) :effect (decrease (count ?s) 1) )
  9. Correspondence between Planning and DbC 23 Automated Planning Design by

    Contract Initial State Use Case Preconditions Goal Use Case Postconditions Actions Methods Action Preconditions Method Preconditions Action Effects Method Postconditions
  10. 27 Paper Focus Main Idea Liwu Li (2000) Model Generation

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

    2: (WITHDRAW ACCOUNT PROFILE AMOUNT) [1] 3: (LOGOUT PROFILE) [1] Message Receiver Parameter But what about the Sender?
  12. 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
  13. 35

  14. 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
  15. = −& , &&&&&&&&&&&&DFS & , &&&&&&&&&&&&BFS & + ℎ

    , A∗ The Evaluation (or Objective) Function 38 Cost so far; depth of n; # of previous message passes Estimated cost to goal; estimated # of remaining message passes
  16. To determine the sender of a message, Communiqué uses the

    links between the objects along with some rules of thumb 42
  17. Sender-Selection Assumptions 43 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
  18. OCL-Like Ruby Expressions for Pre- & Postconditions 44 pop =

    DbcMethod.new(:pop) pop.precondition = Proc.new { self.is_empty? } pop.postcondition = Proc.new { @count -= 1 } context Stack::pop(): T pre: not self.isEmpty() post: not self.isFull() and self.count = self.count@pre - 1
  19. The original models were not DbC’ed; I added what I

    believed to be commonsense contracts 46
  20. 56

  21. 59 There is no association to support sending refresh() as

    it appears in the book’s sequence diagram
  22. 70

  23. 71

  24. 72

  25. 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 # of noise methods
  26. 76

  27. 78 s0 0 + 3 s2 1 + 1 s3

    2 + 1 s1 1 + 3 sg1 2 + 0 satisfy_objects_1_and_2() prepare_to_satisfy_object_3() prepare_to_satisfy_all_objects_at_once() satisfy_all_objects_at_once() f(n) = g(n) + h(n) sg2 3 + 0 satisfy_object_3()
  28. 79 s0 0 + 3 s2 1 + 1 s3

    2 + 1 s1 1 + 3 sg1 2 + 0 satisfy_objects_1_and_2() prepare_to_satisfy_object_3() prepare_to_satisfy_all_objects_at_once() satisfy_all_objects_at_once() f(n) = g(n) + h(n) sg2 3 + 0 satisfy_object_3()
  29. 82

  30. If Communiqué fails to find a solution, it points to

    possible sources of inconsistencies 84
  31. 85

  32. 86

  33. 88 Action Planners Message-Passing Planner State Representation Typically, predefined state

    variables A set of objects Specification Language STRIPS, ADL, or PDDL OCL-like Ruby expressions Constraints Preconditions only Preconditions plus semantic class relationships Creation of New State Components Typically, not supported Object instantiations* Communiqué Action Planners State Representation Typically, predefined state variables A set of objects Specification Language STRIPS, ADL, or PDDL OCL - like Ruby expressions Constraints Preconditions only Preconditions plus semantic class relationships Creation of New State Components Typically, not supported Object instantiations *
  34. 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 Other Limitations 92
  35. Future Work Handle Time Explicitly Design a Better Heuristic Try

    Other Planning Algorithms & Approaches Use XMI for Inputs and Outputs 93
  36. 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