1 / 30

Example-Driven Modeling Using

Example-Driven Modeling Using. Micha ł Antkiewicz , Kacper B ą k , Krzysztof Czarnecki , Zinovy Diskin , Dina Zayan 1 , and Andrzej W ą sowski 2 mantkiew@gsd.uwaterloo.ca 1 University of Waterloo 2 IT University of Copenhagen MDEBE, MODELS, Miami, Sep. 29, 2013.

Télécharger la présentation

Example-Driven Modeling Using

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. Example-Driven Modeling Using MichałAntkiewicz, KacperBąk, Krzysztof Czarnecki, ZinovyDiskin, Dina Zayan1, and AndrzejWąsowski2 mantkiew@gsd.uwaterloo.ca 1University of Waterloo2IT University of Copenhagen MDEBE, MODELS, Miami, Sep. 29, 2013

  2. Domain Knowledge Transfer Domain Model Bob (BA) Alice (SME) • Domain expert • Domain novice • Novice modeler • examples • Modeling expert • abstractions

  3. Example-Driven Modeling [1] Examples + Abstractions Model = “An approach to systematically using explicitexamples for eliciting, modeling, verifying, and validating complex domain knowledge” [1] Bąk et al., Example-Driven Modeling. Model = Abstractions + Examples, NIER, ICSE'13

  4. Why Apply Example-Driven Modeling? H1: Constructing models with the aid of explicit examples improves the quality of models. H2: Augmenting models with explicit examples improves model comprehension among various stakeholders [2]. [2] Zayan, Antkiewicz, Czarnecki, Effects of Using Examples on Structural Model Comprehension (submitted)

  5. How to do Example-Driven Modeling? H3: Begin with examples or abstractions; switch H4: Tools validate abstractions wrt. examples H5: Variety of examples H6: Positive and negative examples

  6. Languages? Methods? Tools? We present a vision of how EDM should be done in a scenario, and how it can be supported by a language and a tool

  7. class feature referencehttp://clafer.org • Lightweight structural modeling language • One construct (clafer)/many roles • Feature and configuration modeling • Meta- and (partial) instance modeling • Yet powerful • First-order predicate/relational logic • Constraint language inspired by Alloy

  8. Instance Generator • Reasoner for Clafer • Finite-scope analysis • Model consistent • All correct instantiations • Model inconsistent • UnSAT Core + a near-miss instance • Clafer Tools Binary Distributions [3] [3] http://gsd.uwaterloo.ca/clafer-tools-binary-distributions

  9. A Domain Knowledge Elicitation Scenario Bob (BA) Alice (SME)

  10. Part 1: Examples only

  11. Our members often book rooms for meetings. Give me an example of a room booking, please. We have a mid-year review meeting in June. It is organized by Steven, a chair, and is held in the meeting room C that provides a whiteboard and audioconferencing equipment to include online participants. June Steven midYearReview month -> June chair -> Steven room -> C participant$1 participant$2 onlineParticipant$1 C whiteboard audioConferencing June Steven 1 midYearReview month -> June chair -> Steven room -> C participant 1..* onlineParticipant+ C whiteboard audioConferencing ClaferIG

  12. Another example is an on-demand meeting organized within work hours. Joanna, a team-leader, sometimes meets other team members in room D. They use a whiteboard and have no online participants. Joanna ondemandMeeting chair -> Joanna participant + onlineParticipant 0 room -> D D whiteboard

  13. Is this example valid? Al John aMeeting chair -> Al, John participant 0 onlineParticipant 25 room -> E E whiteboard No, there are two chairs, but a meeting must have exactly one chair. Also, it is our policy that rooms cannot be booked for meetings with online participants only. The maximum number of online participants supported by our system is 20. Finally, one cannot have a meeting with online participants without audio conferencing equipment!

  14. Is this example valid? Tom Ed aMeeting participant -> Tom onlineParticipant -> Ed room -> F F audioConferencing There's no chair, which is required. I am also unsure if we have any rooms without a whiteboard.

  15. Part 1: Summary Examples helped ground the discussion, elicit the missing constraints, and uncover tacit knowledge

  16. Part 2: Abstraction Inference

  17. abstractMember abstractRoom abstractMeeting June Steven : Member midYearReview : Meeting month -> June chair -> Steven room -> C participant -> Member + onlineParticipant -> Member 1..20 C : Room whiteboard audioConferencing Joanna : Member ondemandMeeting : Meeting chair -> Joanna room -> D participant -> Member + onlineParticipant -> Member 0 D : Room whiteboard Let’s extract the commonality to the abstractions.

  18. abstract Member abstract Room whiteboard ? audioConferencing ? abstract Meeting chair -> Member room -> Room participant -> Member + onlineParticipant -> Member 0..20 [ some onlineParticipant => some room.audioConferencing ] June Steven : Member C : Room whiteboard 1 audioConferencing midYearReview: Meeting month -> June chair -> Steven room -> C onlineParticipant-> Member 1..20 Joanna : Member D : Room whiteboard audioConferencing 0 ondemandMeeting: Meeting chair -> Member = Joanna room -> D onlineParticipant -> Member 0 redefinition

  19. Part 2: Summary The abstractions look the same as the examples thanks to redefinition [4][5]. The abstractions can capture more general constraints than examples. [4] Bąk et al. Partial Instances via Subclassing, SLE’13 [5] Bąk et al. Unifying class and feature modeling (submitted)

  20. Part 3: Example Derivation

  21. So far, our abstractions look quite good. Let’s automatically derive a few examples. Are they valid? aMember : Member 2..5 aMeeting : Meeting [ someonlineParticipant ] aRoom : Room

  22. aMember$1 : Member aMember$2 : Member aMember$3 : Member aMeeting : Meeting chair -> aMember$3 room -> aRoom participant -> aMember$3 onlineParticipant$1 -> aMember$3 onlineParticipant$2 -> aMember$2 onlineParticipant$3 -> aMember$1 aRoom : Room audioConferencing aMember$1 : Member aMember$2 : Member aMeeting : Meeting chair -> aMember$2 room -> aRoom participant$1 -> aMember$1 participant$2 -> aMember$2 onlineParticipant -> aMember$2 aRoom : Room whiteboard audioConferencing ClaferIG No, they are invalid! A chair cannot be a participant. Also, no member can participate both on-site and on-line.

  23. Then we need to add the missing constraints. abstract Meeting chair -> Member [ chair not in participant.ref ] [ chair not in onlineParticipant.ref ] room -> Room participant -> Member + onlineParticipant -> Member 0..20 [ no participant.ref& onlineParticipant.ref ] [ some onlineParticipant => some room.audioConferencing ]

  24. aMember$1 : Member aMember$2 : Member aMember$3 : Member aMember$4 : Member aMember$5 : Member aMeeting : Meeting chair -> aMember$1 room -> aRoom participant -> aMember$5 onlineParticipant$1 -> aMember$4 onlineParticipant$2 -> aMember$3 onlineParticipant$3 -> aMember$2 aRoom: Room audioConferencing aMember$1 : Member aMember$2 : Member aMember$3 : Member aMember$4 : Member aMeeting : Meeting chair -> aMember$1 room -> aRoom participant$1 -> aMember$4 participant$2 -> aMember$3 onlineParticipant -> aMember$2 aRoom : Room whiteboard audioConferencing ClaferIG These examples are valid!

  25. Part 3: Summary Automatic example derivation helped uncover missing constraints, extend and subsequently validate the model.

  26. Summary • A vision for doing EDM • Applied Clafer & ClaferIG in a scenario • Abstraction inference • Example derivation • Abstractions checking • Demonstrated supporting language features

  27. Conclusions (i) • Variety of examples • Partial examples • Focus on an area • Positive examples • Correct scenarios • Near-miss negative examples • Constraint violations

  28. Conclusions (ii) • Language design to support EDM • Single modeling concept: clafer • Unified syntax for examples and abstractions • Key mechanism: redefinition • Partial examples • Partial typing • Specialization • Extension

  29. Open Questions • Cost/benefit ratio of EDM? • Study industrial use • What type of examples? • How to collect them? • How many are needed? • How diverse are needed? • How to infer abstractions from examples? • How to support co-evolution?

  30. Example-Driven Modeling Using Thank You!

More Related