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.
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
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
20. Languages
Design by Contract Automated Planning
Stanford Research Institute Problem Solver
Eiffel
Action Description Language
Object Constraint Language
Planning Domain Definition Language
20
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
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
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
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
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
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
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
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