1 / 60

Michalis Famelis, Rick Salay , Alessio Di Sandro , Marsha Chechik University of Toronto

Transformation of Models Containing Uncertainty. Michalis Famelis, Rick Salay , Alessio Di Sandro , Marsha Chechik University of Toronto MODELS 2013, Miami Beach, FL. This is Natalie. Natalie is a modeler . Natalie faces uncertainty in her everyday work. Alternative Designs.

ashford
Download Presentation

Michalis Famelis, Rick Salay , Alessio Di Sandro , Marsha Chechik University of Toronto

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transformation of Models Containing Uncertainty Michalis Famelis, Rick Salay, Alessio Di Sandro, Marsha Chechik University of Toronto MODELS 2013, Miami Beach, FL

  2. This is Natalie. Natalie is a modeler. Natalie faces uncertainty in her everyday work.

  3. Alternative Designs Hmm, I don’t know which one, yet.

  4. Conflicting Stakeholder Opinions What do I do until they decide?

  5. Incomplete Information I don’t know everything about this, yet.

  6. Uncertainty in software development Many design alternatives Incomplete information Conflicting stakeholder opinions Uncertainty about the content of the model.

  7. Transformations Like everygood MBE practitioner,Natalie usesa variety of MTs

  8. Transformations Like everygood MBE practitioner,Natalie usesa variety of MTs The transformations assume inputs that don’t contain uncertainty

  9. Transformations Like everygood MBE practitioner,Natalie usesa variety of MTs The transformations assume inputs that don’t contain uncertainty But only too often, Natalie’s models contain uncertainty:

  10. Transforming Models with Uncertainty Natalie should be able to use model transformations

  11. Transforming Models with Uncertainty Natalie should be able to use model transformations

  12. Transforming Models with Uncertainty Natalie should be able to use model transformations Existing transformation techniques do not support this! To apply MTs, Natalie is forced to artificially remove uncertainty

  13. Transforming Models with Uncertainty Natalie should be able to use model transformations Existing transformation techniques do not support this! We need to liftNatalie’s transformations so that they can apply to models with uncertainty

  14. Outline Representing Uncertaintywith Partial Models Reminder: Model Transformations Transforming Partial Models EmpiricalEvaluation ToolSupport

  15. Model Transformations With Graph Rewriting EncapsulateVariablerefactoring: Make fields private and add getter methodsunless they belong to some inner class class2 class1 class1 Example rule: - attribute : type+ getAttribute() :type + attribute : type class1 Right Hand Side NegativeApplication Condition LeftHand Side

  16. Example Input Model class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 + effect : String

  17. Example Input Model class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Match + effect : String

  18. Example Input Model class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 NAC also matches! ABORT ! + effect : String

  19. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 + effect : String

  20. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Match + effect : String

  21. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Delete + effect : String

  22. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 effect : String

  23. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Add - effect : String

  24. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Add - effect : String + getEffect() : String

  25. Example Input Model 2 class2 class1 class1 SolverException - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 No more LHS matches. Stop. - effect : String + getEffect() : String

  26. Outline Representing Uncertaintywith Partial Models

  27. Representing Uncertainty Partial Models [ICSE12] • Points of uncertainty (“May elements”) explicated using syntactic annotations Solver SolverException Unsure if it should be an inner class. + effect : String Unsure if we need this field.

  28. Representing Uncertainty Partial Models [ICSE12] • Points of uncertainty (“May elements”) explicated using syntactic annotations Propositional variables: “the element exists” Solver SolverException X + effect : String Y

  29. Representing Uncertainty Solver Solver SolverException Solver SolverException SolverException Solver SolverException SolverException Solver X x=F, y=F x=T, y=F + effect : String + effect : String + effect : String Y x=F, y=T x=T, y=T 4 concretizations: 4 ways to resolve uncertainty.

  30. Representing Uncertainty Partial Models [ICSE12] • Points of uncertainty (“May elements”) explicated using syntactic annotations • Restrictions to the set of concretizations can be captured in the “May formula” Solver SolverException X + effect : String Y X v Y

  31. Representing Uncertainty Solver Solver SolverException Solver SolverException SolverException Solver SolverException SolverException Solver X x=F, y=F x=T, y=F + effect : String + effect : String + effect : String Y X v Y x=F, y=T x=T, y=T

  32. Outline Transforming Partial Models

  33. Transforming Models With Uncertainty Natalie wants to apply the rule to an input with uncertainty

  34. Why Is It Hard? class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 X Y + effect : String X v Y

  35. Why Is It Hard? class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Match??? X Y + effect : String X v Y

  36. Why Is It Hard? class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Match??? X Y + effect : String X v Y

  37. Why Is It Hard? class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Should we add? Should we delete? X Y + effect : String X v Y

  38. Why Is It Hard? class2 class1 class1 SolverException Solver - attribute : type+ getAttribute() :type + attribute : type LHS NAC RHS class1 Existing transformation techniques cannot be used. X Y + effect : String X v Y

  39. Intuition (And definition of correctness) class2 class1 class1 Solver SolverException - attribute : type+ getAttribute():type + attribute : type LHS NAC RHS X class1 + effect : String ? Y X v Y

  40. Intuition (And definition of correctness) class2 class1 Solver class1 SolverException Solver SolverException Solver SolverException - attribute : type+ getAttribute():type + attribute : type LHS NAC RHS class1 ? + effect : String + effect : String

  41. Intuition (And definition of correctness) class2 class1 Solver Solver class1 Solver SolverException SolverException Solver SolverException Solver SolverException Solver SolverException SolverException - attribute : type+ getAttribute():type + attribute : type LHS NAC RHS class1 + effect : String + effect : String -effect : String +getEffect() : String + effect : String

  42. Intuition (And definition of correctness) class2 class1 Solver class1 SolverException SolverException Solver SolverException SolverException Solver - attribute : type+ getAttribute():type + attribute : type Solver LHS NAC RHS class1 + effect : String X + effect : String Y + - effect : String +getEffect() : String a b ( X∧¬Y ∧ ¬a ∧ ¬b) v(¬X∧ Y ∧ ¬a ∧ b) v ( X∧ Y ∧ a ∧ ¬b)

  43. Intuition (And definition of correctness) class2 class1 class1 Solver SolverException SolverException - attribute : type+ getAttribute():type + attribute : type Solver LHS NAC RHS X class1 + effect : String X Y Y + - effect : String +getEffect() : String a X v Y b ( X∧¬Y ∧ ¬a ∧ ¬b) v(¬X∧ Y ∧ ¬a ∧ b) v ( X∧ Y ∧ a ∧ ¬b)

  44. Technique class2 class1 class1 Solver SolverException - attribute : type+ getAttribute():type + attribute : type LHS NAC RHS class1 X + effect : String Y X v Y

  45. Technique Step 1: Determine applicability class2 class1 class1 Solver SolverException - attribute : type+ getAttribute():type + attribute : type LHS NAC RHS class1 (a) Find Match X + effect : String Y X v Y

  46. Technique Step 1: Determine applicability class2 class1 class1 Solver SolverException - attribute : type+ getAttribute():type + attribute : type LHS NAC RHS class1 (a) Find Match X (b) Make sure the rule applies to at least one concretization(requires solvinga SAT problem) + effect : String Y X v Y

  47. Technique Step 1: Determine applicability Step 2: Transform graph class2 class1 class1 Solver SolverException SolverException - attribute : type+ getAttribute():type + attribute : type Solver LHS NAC RHS class1 X X Copy over unchangedparts + effect : String + effect : String Y Y X v Y

  48. Technique Step 1: Determine applicability Step 2: Transform graph class2 class1 class1 Solver SolverException SolverException - attribute : type+ getAttribute():type + attribute : type Solver LHS NAC RHS class1 X Copy over unchangedparts Perform additions and deletions X + effect : String Y + - effect : String +getEffect() : String a Y b Added and deleted elements become Maybe X v Y

  49. Technique Step 1: Determine applicability Step 2: Transform graph Step 3: Transform formula class2 class1 class1 Solver SolverException SolverException - attribute : type+ getAttribute():type + attribute : type Solver LHS NAC RHS X class1 Constrain Maybe elements to ensure each thatconcretizationis correctly affected. + effect : String X Y Y + - effect : String +getEffect() : String a X v Y b ( X∧¬Y ∧ ¬a ∧ ¬b) v(¬X∧ Y ∧ ¬a ∧ b) v ( X∧ Y ∧ a ∧ ¬b)

  50. Overview Step 1: Determine applicability Step 2: Transform graph Step 3: Transform formula class2 class1 class1 Solver SolverException SolverException - attribute : type+ getAttribute():type + attribute : type Solver LHS NAC RHS X class1 + effect : String X Y Y + - effect : String +getEffect() : String a X v Y b ( X∧¬Y ∧ ¬a ∧ ¬b) v(¬X∧ Y ∧ ¬a ∧ b) v ( X∧ Y ∧ a ∧ ¬b)

More Related