domain-specific modeling and code generation for cross-platform mobile and iot-based applications
TRANSCRIPT
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula 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
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
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
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
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
ExecutionLogs
Application Model
Data Analysis and Visualization
Database
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula 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
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
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
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
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)
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 participants1. Introduction2. Instruction (test scenario)3. Modeling assigned scenarios
1. Modeling phase2. Redraw phase
4. User Questionnaire
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
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula Magna – Rettorato
Mercoledì 27 maggio 2015
Barriers in the adoption of model-driven development approaches
Modeling Languages Simplification and Adaptation
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
Eric Umuhoza, Ph.D. Candidate
End-
user
Lang
uage
desi
gner
UserQuestionnaire
Language Evaluation
Definition of Language Variants
Modeling of Use Cases
Selection of Reducible
Language Elements
General Language
Simplified Language
DSLs Simplification Problem - Process
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
Eric Umuhoza, Ph.D. Candidate
End-
user
Lang
uage
desi
gner
UserQuestionnaire
Language Evaluation
Definition of Language Variants
Modeling of Use Cases
Selection of BPMN Elements
BPMN Simplified BPMN
DSLs Simplification Problem - Process
Eric Umuhoza, Ph.D. Candidate
Selection of BPMN Elements
Selected 8 elements from 52 constructs of BPMN
Eric Umuhoza, Ph.D. Candidate
Language Variants Definition
Defined 4 language variants
Eric Umuhoza, Ph.D. Candidate
Experiment setup• 3 application scenarios• 4 syntax variants• 24 users• Multiple tests per user
DSLs Simplification Problem - Validation
Eric Umuhoza, Ph.D. Candidate
Results Analysis
• Average modeling time
Language Variants
Dur
atio
n (s
)
~19 min
~16 min
~21 min
Language Variants
# El
emen
ts
• Average # of used concepts
Eric Umuhoza, Ph.D. Candidate
Results Analysis
Language Variants
# op
inio
ns
Easy Med Hard
• Explicit feedback on language variants complexity
Variant 1Simpler, faster, less errors, limited power(no conditions)
Variant 2Strong thanks to looping, a lot of errors
Variant 3Good compromise.Limited by single local parameter
Variant 4Harder, slower, more errors. Multiple local parameters not appreciated
• Rule of “thumb” on Language Variants
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula Magna – Rettorato
Mercoledì 27 maggio 2015
User Interaction Modeling Language
Mobile Modeling Language
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
Eric Umuhoza, Ph.D. Candidate
Interaction Flow Modeling Language (IFML)
AlbumSearch
«Window» AlbumSearch
AlbumList
«Window» Albums
AlbumDetails
«Window» Album
«ParameterBindingGroup» Title AlbumTitleYear AlbumYear
«ParameterBindingGroup»SelectedAlbum AnAlbum
«Form» «List» «Details»
EventViewContainer
View Component
AlbumDeletion
«ParameterBindingGroup»SelectedAlbum AnAlbum
Action
Navigation Flow
ParameterBinding
Eric Umuhoza, Ph.D. Candidate
Mobile–specific extension of IFML
Four main sets of mobile-specific concepts1. Mobile Containers and Components2. Events
• User interactions• Device’s features• Sensors
3. Mobile Actions4. Mobile Context
Bottom-up approach
Investigation of Mobile
Platforms
Extraction of Common Features
Abstraction and
Conceptualization
Meta-model excerpts:
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
Eric Umuhoza, Ph.D. Candidate
Mobile IFML – Access to native features
MobileComponentMobileAction MobileActionEvent
Access to system features Native functions Phone sensors
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.
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula Magna – Rettorato
Mercoledì 27 maggio 2015
User Interaction Modeling Language
IOT Integration
Eric Umuhoza, Ph.D. Candidate
IoT Integration- Overview
Interactions between the user and the IoT systems in two phases User – Terminal Terminal – IoT Devices
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:
Eric Umuhoza, Ph.D. Candidate
IoT user interaction patterns – Set
MakeCappuccino
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
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
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
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula Magna – Rettorato
Mercoledì 27 maggio 2015
Implementation: Code Generation Strategies
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)
Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM Native Code
M2TM2MPSM
PIM Native Code
M2T
Native Code
M2TPSM
PIM Cross-platform Code
M2T
M2TFSM
Cross-platform CodePIM
M2M
(1)
(2)
(3)
(4)
(5)
Data-driven native applications
Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM Native Code
M2TM2MPSM
PIM Native Code
M2T
Native Code
M2TPSM
PIM Cross-platform Code
M2T
M2TFSM
Cross-platform CodePIM
M2M
(1)
(2)
(3)
(4)
(5)
Native apps with complex device-specific functionalities
Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM Native Code
M2TM2MPSM
PIM Native Code
M2T
Native Code
M2TPSM
PIM Cross-platform Code
M2T
M2TFSM
Cross-platform CodePIM
M2M
(1)
(2)
(3)
(4)
(5)
Native apps for one platform
Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM Native Code
M2TM2MPSM
PIM Native Code
M2T
Native Code
M2TPSM
PIM Cross-platform Code
M2T
M2TFSM
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
Eric Umuhoza, Ph.D. Candidate
Code generation strategies
PIM Native Code
M2TM2MPSM
PIM Native Code
M2T
Native Code
M2TPSM
PIM Cross-platform Code
M2T
M2TFSM
Cross-platform CodePIM
M2M
(1)
(2)
(3)
(4)
(5) FSM :Cross-platform
Framework Specific Model
Team with low experience in Targeted tool
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula Magna – Rettorato
Mercoledì 27 maggio 2015
Application Monitoring:Model-Driven Framework for User
Behavior Analysis
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
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:"...",...]]
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
Results Visualization
Enhancing User Experience Refactoring Repositioning Etc.
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
Firma convenzione Politecnico di Milano e Veneranda Fabbrica
del Duomo di MilanoAula Magna – Rettorato
Mercoledì 27 maggio 2015
Domain-Specific Modeling and Code Generation for Cross-platform Mobile and
IoT-based Applications
Thanks