UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
Domain-specific Modeling and Code Generation for Cross-platform Mobile and Iot-based Applications
1. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Domain-Specific Modeling and Code
Generation for Cross-platform Mobile and
IoT-based Applications
Ph.D. Candidate:
Eric Umuhoza
Advisor:
Prof. Marco Brambilla
2. Eric Umuhoza, Ph.D. Candidate
Agenda
Introduction
Barriers to MDD Adoption
User Interaction Modeling Language
Code Generation Strategies
Model Driven Framework for User Behavior Analysis
Questions and Answers
3. Eric Umuhoza, Ph.D. Candidate
Context
More than 2.6 billion of smart-phone users by 2020
Increasing number of mobile apps
5 million apps expected in Apple App store by 2020
App revenues expected to reach 92 billion US
dollars by 2018
Motivation
4. Eric Umuhoza, Ph.D. Candidate
Research objective
Apply MDD to all Phases of Software Development
Design Time
Domain-Specific Modeling Languages for: Mobile and IoT
Generation Time
Code Generation Strategies
Execution Time
Model Driven Analytics Framework
Model-driven development (MDD)
• Models as the primary artifact of the development process
• Implementation is (semi) automatically generated from the models
Benefits
• Model once and generate for any platform of choice
• It improves the development process
• Validation of requirements
5. Eric Umuhoza, Ph.D. Candidate
Application Modeling
Mobile Applications
Contributions
IoT-based Applications
Platform Independent
Extension
(Mobile IFML)
Platform
Specific
Extension
Design
Patterns
Modeling
Tool
Platform
Specific
Extension
IoT-
Extension
Design
Patterns
Domain
Model for IoT
Implementation
Declarative rules for
Code Generation
Monitoring
Model Interpretation
Execution
Logs
Application
Model
Data Analysis and
Visualization
Database
6. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Barriers in the Adoption of Model-driven
Development Approaches
Is Application Modeling Time Consuming?
Modeling Languages Simplification and Adaptation
7. Eric Umuhoza, Ph.D. Candidate
Models in software development
Traditional usage
• Communication with customers and users
• Support for software design
• Task specification for programming
Models as programs
• Applications are
generated (semi)
automatically from
models
8. Eric Umuhoza, Ph.D. Candidate
What is software modeling?
Where
Design is Understanding, reasoning, and thinking about a solution
Drawing and tool interaction is the Expression of the design in a
modeling notation
Modeling = Drawing and tool interaction
Modeling = Design + Drawing and tool interaction
9. Eric Umuhoza, Ph.D. Candidate
Goal
Research Question:
RQ1: Ratio between Modeling Effort and Design-Thinking Effort
Understand whether it is modeling or designing that
dominates the effort for creating UML model
10. Eric Umuhoza, Ph.D. Candidate
Experiments
Assumption : Participants do not think about the solution in phase β
Design Time DT = Tα – Tβ
Model Drawing Time MDT = Tα - DT
Design Time Percentage (DTP) = DT/ Tα
A two-phase experiment
Phase α: create a domain model that addresses the assignment
Tα = Effort spent during Phase α = Design Time + Model Drawing Time
(Eq.2)
Phase β: re-draw the same model as copy of the diagram produced in phase α
Tβ = effort spent during phase β
(Eq.1)
(Eq.3)
(Eq.4)
(Eq.5)
11. Eric Umuhoza, Ph.D. Candidate
Experiment setup
3 application scenarios
• Every scenario describes a system to be designed
48 users
2 tests per user
Procedure with participants
1. Introduction
2. Instruction (test scenario)
3. Modeling assigned scenarios
1. Modeling phase
2. Redraw phase
4. User Questionnaire
12. Eric Umuhoza, Ph.D. Candidate
Results analysis
Ratio between Modeling Effort and Design-Thinking Effort
Modeling effort BUT
• Design leads to software success
• Reuse
• Maintenance
Model vs code
• Model-driven development
Implementation from models
DSLs Productivity
The fault of supposedly unproductive processes should not be blamed on modeling
But to (anyhow necessary) time devoted to thinking about the problem and identifying the solution
13. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Barriers in the adoption of model-driven
development approaches
Modeling Languages Simplification and Adaptation
14. Eric Umuhoza, Ph.D. Candidate
Adaptation of modeling languages
• Standard languages are complex (E.g.: BPMN)
• No perfect match of the domain to be modeled (E.g.: UML)
Other approaches towards simplification
• New DSLs
• Extending an existing base language
Our approach
• Simplify existing language according to the user needs
• Less time consuming and error prone than building a DSL from scratch
• Gain in Experience, Tools, and tutorials
DSLs Simplification Problem - Motivation
15. Eric Umuhoza, Ph.D. Candidate
End-userLanguagedesigner
User
Questionnaire
Language
Evaluation
Definition of
Language
Variants
Modeling of
Use Cases
Selection of
Reducible
Language Elements
General
Language
Simplified
Language
DSLs Simplification Problem - Process
16. Eric Umuhoza, Ph.D. Candidate
DSLs Simplification Problem – Case study
Simplification of BPMN for Personal Process Modeling
Goal Study “how much is enough” for
• End users
• Collaborative planning and execution
Michael zur Muehlen and Jan Recker "How much language is enough? "
Less than 20% of
BPMN constructs
are used regularly
17. Eric Umuhoza, Ph.D. Candidate
End-userLanguagedesigner
User
Questionnaire
Language
Evaluation
Definition of
Language
Variants
Modeling of
Use Cases
Selection of BPMN
Elements
BPMN Simplified
BPMN
DSLs Simplification Problem - Process
18. Eric Umuhoza, Ph.D. Candidate
Selection of BPMN Elements
Selected 8 elements from 52 constructs of BPMN
19. Eric Umuhoza, Ph.D. Candidate
Language Variants Definition
Defined 4 language variants
20. Eric Umuhoza, Ph.D. Candidate
Experiment setup
• 3 application scenarios
• 4 syntax variants
• 24 users
• Multiple tests per user
DSLs Simplification Problem - Validation
21. Eric Umuhoza, Ph.D. Candidate
Results Analysis
• Average modeling time
Language Variants
Duration(s)
~19 min
~16 min
~21 min
Language Variants
#Elements
• Average # of used concepts
22. Eric Umuhoza, Ph.D. Candidate
Results Analysis
Language Variants
#opinions
Easy Med Hard
• Explicit feedback on language
variants complexity
Variant 1
Simpler, faster, less errors, limited power
(no conditions)
Variant 2
Strong thanks to looping, a lot of errors
Variant 3
Good compromise.
Limited by single local parameter
Variant 4
Harder, slower, more errors. Multiple local
parameters not appreciated
• Rule of “thumb” on Language Variants
23. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
User Interaction Modeling Language
Mobile Modeling Language
24. Eric Umuhoza, Ph.D. Candidate
Mobile Modeling Language
A platform independent modelling (PIM) language
• A mobile-specific extension of IFML
• Covering mobile-specific requirements
• Amenable to code generation
Why IFML?
• a OMG standard for User Interaction Modeling
• Technology-independent
• It is extensible
25. Eric Umuhoza, Ph.D. Candidate
Interaction Flow Modeling Language (IFML)
Album
Search
«Window» AlbumSearch
Album
List
«Window» Albums
Album
Details
«Window» Album
«ParameterBindingGroup»
Title AlbumTitle
Year AlbumYear
«ParameterBindingGroup»
SelectedAlbum AnAlbum
«Form» «List» «Details»
EventViewContainer
View Component
Album
Deletion
«ParameterBindingGroup»
SelectedAlbum AnAlbum
Action
Navigation Flow
ParameterBinding
26. Eric Umuhoza, Ph.D. Candidate
Mobile–specific extension of IFML
Four main sets of mobile-specific
concepts
1. Mobile Containers and Components
2. Events
• User interactions
• Device’s features
• Sensors
3. Mobile Actions
4. Mobile Context
Bottom-up approach
Investigation of
Mobile
Platforms
Extraction of
Common
Features
Abstraction
and
Conceptualization
Meta-model excerpts:
27. Eric Umuhoza, Ph.D. Candidate
Mobile IFML - Events
Events generated by the
interaction of the user
(gestures, …)
Mobile container
MobileContainer
MobileEvent
«Screen» List
«List» Lists
Options
«LongPress»
«Screen» Options
«Details» List
Edit list Delete list
28. Eric Umuhoza, Ph.D. Candidate
Mobile IFML – Access to native features
MobileComponent
MobileAction MobileActionEvent
Access to system features
Native functions
Phone sensors
29. Eric Umuhoza, Ph.D. Candidate
Mobile IFML – Mobile Context
It assumes particular relevance in mobile apps
The context must gather all the dimensions that characterize:
• The user's intent
• The capacity of access device
• The communication network, and etc.
30. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
User Interaction Modeling Language
IOT Integration
31. Eric Umuhoza, Ph.D. Candidate
IoT Integration- Overview
Interactions between the user and the IoT systems in two phases
User – Terminal
Terminal – IoT Devices
32. Eric Umuhoza, Ph.D. Candidate
IoT Extensions - Components
Get Action Set Action Plan Action
Action SystemEvent
Single Information
Event
Approaching Event
IoT Actions
IoT Events (approaching, repeat, etc.)
• No new ViewComponent and ViewContainer
User interaction patterns …
Meta-model excerpts:
33. Eric Umuhoza, Ph.D. Candidate
IoT user interaction patterns – Set
Make
Cappuccino
Turn on
100°C
Set patterns
• One device – One operation
• One device – More operations
• More devices – One operation
• More devices – More operations
• One device – One Program
34. Eric Umuhoza, Ph.D. Candidate
IoT user interaction patterns – Get
• State of a device
• Details of a device
• Information from device
• Search device
• Nearby devices
• …
Get patterns
35. Eric Umuhoza, Ph.D. Candidate
Patterns- based UI modeling
Get Information from the Device
Get State of the Device
Get Details of a Device
Get Information from whole Category
One Device One Operation
Store Information
Push Information
36. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Implementation:
Code Generation Strategies
37. Eric Umuhoza, Ph.D. Candidate
Code generation strategies
CIM to several PIMs
PIM to several PSMs
Many other combinations
Skipping levels
Model-driven architecture (MDA)
Application
Code
Model-to-Text
Transformation
(M2T)
41. Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM
Native
Code
M2TM2M
PSM
PIM
Native
Code
M2T
Native
Code
M2T
PSM
PIM
Cross-platform
Code
M2T
M2T
FSM
Cross-platform
CodePIM
M2M
(1)
(2)
(3)
(4)
(5)
Multiple platform
availability (and time
to market) is more
important than high
performance
Loose in nativity
• Gain market
share
42. Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM
Native
Code
M2TM2M
PSM
PIM
Native
Code
M2T
Native
Code
M2T
PSM
PIM
Cross-platform
Code
M2T
M2T
FSM
Cross-platform
CodePIM
M2M
(1)
(2)
(3)
(4)
(5)
FSM :Cross-platform
Framework Specific Model
Team with low
experience in Targeted
tool
43. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Application Monitoring:
Model-Driven Framework for User
Behavior Analysis
44. Eric Umuhoza, Ph.D. Candidate
Model-driven user behavior analysis
Web analytics tools provide reports regarding web site usage
• Page visits, Visitors, Navigation
• Statistics about the content of the pages?
• Event tracking of GA tracking some content level interactions
• But
• Tracking code placed at each position the event could appear
• Limited set of events
Our approach
• Component level analysis (also without navigations)
• Enriched analytics by querying the instances of DB
• All components, but the ones hidden on purpose, are
displayed
• Visualization on models
45. Eric Umuhoza, Ph.D. Candidate
User Behavior Analytics Approach
Example of WebRatio Runtime log line.RTXLog,
22 Jun 2016 11:10:51,761 DEBUG [http-bio-8080-exec-5] com.webratio.rtx.core.ServiceProvider:45) -
[119354A67C7C0177D4A7F411E75BCDE7][page21][pwu6Block] Creating service: WEB-INF/descr/pwu6Block.descr
Example of enriched Log line
[119354A67C7C0177D4A7F411E75BCDE7][ViewContainer[Type:page,id:page21,..]][List[id=pwu6Block][dataBinding
=Book]][[title:"...",author:"...",...]]
46. Eric Umuhoza, Ph.D. Candidate
Possible implementations
Elasticsearch, Logstash, and Kibana
Microsoft Azure (HDInsights, Apache Spark)
Etc.
Approach - Analysis and Visualization
Three kinds of user behavior analytics
Navigation-based analytics:
• Number of visits. entrance rate, Incoming Link Ratio, Outgoing Link Ratio
Content-based analytics
• Top k visualized instances
• Top clicked instances
Structure-based analytics
Visualization
Traditional data visualization tools
• Pie, bar, navigation flow charts
Colored model
48. Eric Umuhoza, Ph.D. Candidate
Conclusions and Future Directions
Model-driven development of mobile and IoT applications
Design time
• Domain-specific modeling languages for Mobile and IoT
• Design methodology – user interaction patterns
Implementation
• Code generation strategies
Execution time
• Model driven user behavior analysis
Solutions to barriers to model-driven development adoption
Future Directions
Implementation of IoT – based Apps
Language Simplification and adaptation
Dissecting Design Effort and Modeling Effort in MDD Approaches
User Behavior Analytics
49. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Domain-Specific Modeling and Code Generation
for Cross-platform Mobile and
IoT-based Applications
Thanks