A DECLARATIVE APPROACH FOR GENERATING SOFTWARE FRAMEWORKS DEDICATED TO UBIQUITOUS COMPUTING
Wilfried Jouve Advisor: Charles Consel INRIA Bordeaux, Phoenix Research Group University of Bordeaux 1 8th of April 2009
INTRODUCTION
Ubiquitous Applications
Automation of everyday activities
2
INTRODUCTION
Requirements
Automation of everyday activities
3
INTRODUCTION
Requirements
Automation of everyday activities adaptation to changes
3
INTRODUCTION
Requirements
Automation of everyday activities adaptation to changes
constant flow of new devices
various application domains
human-centric
critical application domains
3
INTRODUCTION
Requirements
Automation of everyday activities adaptation to changes
constant flow of new devices
various application domains
human-centric
critical application domains
DYNAMICITY
3
INTRODUCTION
Requirements
Automation of everyday activities adaptation to changes
constant flow of new devices
various application domains
human-centric
critical application domains
DYNAMICITY
3
HETEROGENEITY
INTRODUCTION
Requirements
Automation of everyday activities adaptation to changes
constant flow of new devices
various application domains
human-centric
critical application domains
DYNAMICITY
3
HETEROGENEITY
CRITICITY
INTRODUCTION
Illustration ENSEIRB, a graduate engineering school
4
INTRODUCTION
Illustration ENSEIRB, a graduate engineering school
4
INTRODUCTION
Situation Physical parameters
temperature
motion
luminosity
smoke
5
profile
agenda
INTRODUCTION
Situation (1)
temperature
smoke
6
INTRODUCTION
Situation (1)
temperature
smoke
Situation of FIRE 6
Fire Manager
INTRODUCTION
Situation (2)
motion
7
agenda
INTRODUCTION
Situation (2)
motion
Situation of ROBBERY 7
Intrusion Manager
agenda
INTRODUCTION
Situation (3)
motion
8
profile
INTRODUCTION
Situation (3)
motion
Situation of PRESENCE 8
profile
Newscast Manager
INTRODUCTION
HETEROGENEOUS Devices
light sensor
desktop computer
lamp
tag reader
telephone
9
screen
PDA
INTRODUCTION
HETEROGENEOUS SERVICES
producer of luminosity data
profile database
light switch
producer of position data audio receiver
10
news notifier
intrusion notifier
INTRODUCTION
HETEROGENEOUS SERVICES Heterogeneous software buses
producer of luminosity data
profile database
SIP
SOAP
HTTP
light switch
X10
UPnP producer of position data
SMTP
RTSP
TCP audio receiver
10
news notifier
intrusion notifier
INTRODUCTION
HETEROGENEOUS SERVICES
producer of luminosity data
profile database
light switch
•Detects situations •Coordinates services producer of position data
newscast application audio receiver
10
news notifier
intrusion notifier
INTRODUCTION
Service Mobility and Availability
producer of luminosity data
profile database
light switch
producer of position data
newscast application audio receiver
11
news notifier
intrusion notifier
INTRODUCTION
Service Mobility and Availability
producer of luminosity data
profile database
light switch
producer of position data
newscast application audio receiver
11
news notifier
intrusion notifier
INTRODUCTION
Ubiquitous Computing Environments
information
Sensors
Applications
Primitive services
commands
Actuators actions
stimuli
12
Physical parameters
INTRODUCTION
Issues Applications
Primitive services
Physical parameters 13
INTRODUCTION
Issues Applications
criticity Primitive services
heterogeneity
dynamicity
Physical parameters
dynamicity 14
INTRODUCTION
Issues Applications criticity Verifying applications prior to run time Testing applications at run time
Primitive services heterogeneity Integration of existing and future entities Common interface model
Physical parameters dynamicity Detecting situation 15
dynamicity Late binding
Existing Solutions for Programming Ubiquitous Applications
INTRODUCTION
Heterogeneity
Component-based systems + More verifications - Incomplete handling of dynamicity Distributed systems - Few static verifications Ubiquitous systems + Higher-level abstractions for dynamicity - Few verifications Criticity
16
Dynamicity
Existing Solutions for Programming Ubiquitous Applications
INTRODUCTION
Heterogeneity
Component-based systems + More verifications - Incomplete handling of dynamicity Distributed systems - Few static verifications Ubiquitous systems + Higher-level abstractions for dynamicity - Few verifications Criticity
Dynamicity
Limits * No approach handling dynamicity AND verifications * No approach abstracting underlying technologies * No integrated approach to test ubiquitous applications 16
THESIS
17
THESIS
THESIS To provide a high-level and integrated approach for developing reliable ubiquitous applications
Specifying ubiquitous environments DIASPEC, a software architecture language
Developing ubiquitous applications Dedicated programming frameworks Programming support to handle dynamicity Static verifications
Testing ubiquitous systems at runtime DIASIM, a simulator 18
Integrated approach
THESIS
Architect
19
The diagen Approach
DIASPEC specification
THESIS
The diagen Approach Application logic
Architect
Programming framework DIASPEC specification
20
DIASPEC compiler
Application developer
THESIS
The diagen Approach Application logic
Application developer
Architect
Programming framework DIASPEC specification
DIASPEC compiler
Middleware Integration framework
Driver developer
21
THESIS
The diagen Approach Application logic
Application developer
Architect
Programming framework DIASPEC specification
DIASPEC compiler
Middleware Integration framework
Driver developer
21
THESIS
The diagen Approach Application developer
Application logic Architect
Programming framework DIASPEC specification
22
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
THESIS
The diagen Approach Application developer
Application logic Architect
Programming framework DIASPEC specification
22
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
THESIS
The diagen Approach Application developer
Application logic Architect
Programming framework DIASPEC specification
22
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
THESIS
The diagen Approach Application developer
Application logic Architect
Programming framework DIASPEC specification
22
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
THESIS
The diagen Approach Application developer
Application logic Architect
Programming framework DIASPEC specification
22
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
SOFTWARE ARCHITECTURE SPECIFICATION WITH DIASPEC specifying
DIASPEC
Architect
24
Specifying
DIASPEC specification
DIASPEC
Software Architecture Language
Motivations Easier to declare needs rather than program them Declaring types of services Declaring functionalities and connections
25
DIASPEC
A DIASPEC Specification
Services Types of Services
Interaction mode Command
Event
Session
Attributes
Invokee Invoker Consumer Producer Invitee Initiator Binder
Interfaces
26
Exchanged Data Types
DIASPEC
A DIASPEC Specification
Services Types of Services Interaction mode Command Command
Event
Session
Attributes InvokeeInvoker Consumer Producer Invitee Initiator Binder Invokee
Interfaces
26
Exchanged Data Types
Illustration: Building Automation
DIASPEC
Service Database
Actuator
Profile Calendar Notification Alarm Bell
Newscast Application Meeting Manager Lighting Positioning System Manager Detector Sensor
Light Sensor Window Shutter
Application Fire Manager
Manual Pull Station Timer Surveillance Motion Fire Light Manager Detector Sprinkler Heat Dimmer News Burglar Fire Glass Break Air Conditoning Magnetic Detector Smoke Light Siren Bell Notification Door Holder Detector Manager Detector Textual Audio Notification Notification
Light
Interaction mode Event
Command
Attribute Session Location
Invokee Invoker Consumer Producer Invitee Initiator Binder
Interface IOnOff
INotification ICalendar IStatus
Owner
Priority
Exchanged Data type Alert
Video
Audio Luminosity Presence
Heat Motion GlassBreak Smoke Fire Legend:
27
Domain-Specific
Model
depends on extends
Illustration: Building Automation
DIASPEC
Service Database
Actuator
Profile Calendar Notification Alarm Bell
Newscast Application Meeting Manager Lighting Positioning System Manager Detector Sensor
Light Sensor Window Shutter
Application Fire Manager
Service
Manual Pull Station Timer Surveillance Motion Fire Light Manager Detector Sprinkler Heat Dimmer News Burglar Fire Glass Break Air Conditoning Magnetic Detector Smoke Light Siren Bell Notification Door Holder Detector Manager Detector Textual Audio Notification Notification
Light
Actuator
Interaction mode
Notification Attribute
Session Command BellEvent Textual Alarm Notification
Audio Notification
Location Invokee Invoker Consumer Producer Invitee Initiator Binder
Owner
Priority
Model
Burglar Siren Fire Bell News Notification Interface IOnOff
INotification ICalendar IStatus
Exchanged Data type Alert
Video
Audio Luminosity Presence
Heat Motion GlassBreak Smoke Fire Legend:
27
Domain-Specific
depends on extends
DIASPEC
Textual Excerpt
service Sensor(Location location) extends Service {} service TagReader() extends Sensor { provides event Presence to NewscastManager; } service NewscastManager() extends Manager { requires event Presence from TagReader; requires command DisplayNews from NewsNotification; binds session AudioMessage from Speaker, AnnouncementCenter; }
28
DIASPEC
Textual Excerpt
service Sensor(Location location) extends Service {} service TagReader() extends Sensor { provides event Presence to NewscastManager; } service NewscastManager() extends Manager { requires event Presence from TagReader; requires command DisplayNews from NewsNotification; binds session AudioMessage from Speaker, AnnouncementCenter; }
28
DIASPEC
Textual Excerpt
service Sensor(Location location) extends Service {} service TagReader() extends Sensor { provides event Presence to NewscastManager; } service NewscastManager() extends Manager { requires event Presence from TagReader; requires command DisplayNews from NewsNotification; binds session AudioMessage from Speaker, AnnouncementCenter; }
28
DIASPEC
Textual Excerpt
service Sensor(Location location) extends Service {} service TagReader() extends Sensor { provides event Presence to NewscastManager; } service NewscastManager() extends Manager { requires event Presence from TagReader; requires command DisplayNews from NewsNotification; binds session AudioMessage from Speaker, AnnouncementCenter; }
28
DEDICATED PROGRAMMING FRAMEWORKS Developing
PROGRAMMING FRAMEWORKS
Programming Frameworks Application logic
Application developer
Architect
Programming framework DIASPEC specification
DIASPEC compiler
Middleware Integration framework
X10, RTSP, HTTP, SIP... UPnP, SLP, SOAP, SDP, Presence...
30
Driver developer
PROGRAMMING FRAMEWORKS
Programming Support
Architect
DIASPEC specification
DIASPEC compiler
C C C C extends Application developer
class MyNewscastMng extends NewscastManager { [...] }
31
PROGRAMMING FRAMEWORKS
Programming Support
Architect
DIASPEC specification
DIASPEC compiler
C C C C extends Driver developer
class MyTagReader extends TagReader { [...] }
31
PROGRAMMING FRAMEWORKS
Programming SUPPORT
To interact with services To abstract underlying technologies To statically verify applications
32
PROGRAMMING FRAMEWORKS
Programming SUPPORT
To interact with services To abstract underlying technologies To statically verify applications
33
PROGRAMMING FRAMEWORKS
Interact With Services
Service filtering Service discovery Event subscription / unsubscription
Data exchange Invoking commands Receiving events
34
PROGRAMMING FRAMEWORKS
Programming SUPPORT
To interact with services To abstract underlying technologies To statically verify applications
35
Abstracting Underlying Technologies
PROGRAMMING FRAMEWORKS
Architect
Application developer
Application logic Programming framework
DIASPEC specification
DIASPEC compiler
System services at deployment time
Software Buses
RMI
or
SIP
or
WS
To simplify the development of applications To enable the portability of applications 36
or
...
PROGRAMMING FRAMEWORKS
Programming SUPPORT
To interact with services To abstract underlying technologies To statically verify applications
37
PROGRAMMING FRAMEWORKS
To Statically Verify Applications
A service may only communicate with the services it is connected to in the specification (communication integrity) How? => Using the Java type system By supporting interaction with declared service types and its descendants By forbidding to communicate with other types of services
38
PROGRAMMING FRAMEWORKS
Service Filtering
Service Database
Actuator
Profile Calendar Notification Alarm Bell
Light Sensor Window Shutter
Tag Reader
Newscast Application Meeting Manager Lighting Manager Detector
Sensor
Light Audio Notification Timer Fire Light Sprinkler Heat Dimmer News Burglar Fire Magnetic Detector Light Siren Bell Notification Door Holder
39
Textual Notification
Application Fire Manager
Manual Pull Station Surveillance Motion Manager Detector Glass Break Air Conditoning Detector Manager
PROGRAMMING FRAMEWORKS
Service Filtering
Service Database
Actuator
Profile Calendar Notification Alarm Bell
Light Sensor Window Shutter
Tag Reader
Newscast Application Meeting Manager Lighting Manager Detector
Sensor
Light Audio Notification Timer Fire Light Sprinkler Heat Dimmer News Burglar Fire Magnetic Detector Light Siren Bell Notification Door Holder
39
Textual Notification
Application Fire Manager
Manual Pull Station Surveillance Motion Manager Detector Glass Break Air Conditoning Detector Manager
PROGRAMMING FRAMEWORKS
Service Filtering Service Actuator
Notification
Textual Notification
News Notification
40
Audio Notification
PROGRAMMING FRAMEWORKS
Service Filtering Service Actuator
Notification
Textual Notification
News Notification
40
Audio Notification
PROGRAMMING FRAMEWORKS
Service Filtering Service Actuator
1st floor
2nd floor
Notification
1st floor 1st floor
Textual Notification
Audio Notification
2nd floor News Notification
40
1st floor
1st floor
PROGRAMMING FRAMEWORKS
Service Filtering Service Actuator
1st floor
2nd floor
Notification
1st floor 1st floor
Textual Notification
Audio Notification
2nd floor News Notification
40
1st floor
1st floor
PROGRAMMING FRAMEWORKS
Service Filtering Service Actuator
location=1st floor
1st floor
2nd floor
Notification
1st floor 1st floor
Textual Notification
Audio Notification
2nd floor News Notification
40
1st floor
1st floor
PROGRAMMING FRAMEWORKS
Service Registration
DIASPEC service Service(Owner owner) { } service Actuator(Location location) extends Service { } [...] service NewsNotification() extends TextualNotification { }
Framework class MyNewsNotification extends NewsNotification { MyNewsNotification() { super(Owner.ADMIN, new Hall()); [...] } [...] }
41
tag reader
PROGRAMMING FRAMEWORKS
Service Registration
DIASPEC service Service(Owner owner) { } service Actuator(Location location) extends Service { } [...] service NewsNotification() extends TextualNotification { }
Framework class MyNewsNotification extends NewsNotification { MyNewsNotification() { super(Owner.ADMIN, new Hall()); [...] } [...] }
41
tag reader
PROGRAMMING FRAMEWORKS
Service Filtering
DIASPEC service NewsNotification(Location location) extends TextualNotification { ... }
Framework NewsNotificationFilter filter = NewsNotification.getFilter(); filter.setLocation(Location.Hall);
42
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Command
Invoker newscast manager
Invokee news notification
DIASPEC service NewscastManager() extends Manager { requires command DisplayNews from NewsNotification; }
service NewsNotification() extends TextualNotification { provides command DisplayNews to NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyNewsNotification extends { NewsNotification { News news; NewsNotification notifier = public void display(News news) { getDisplayNewsService(filter); // TODO Auto-generated by ECLIPSE notifier.display(news); } } }
43
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Event
Consumer newscast manager
Producer tag reader
DIASPEC service NewscastManager() extends Manager { requires event Presence to TagReader; }
service TagReader() extends Sensor { provides event Presence from NewscastManager; }
Framework class MyNewscastMng extends NewscastManager class MyTagReader extends TagReader { { [...] subscribePresence(filter); publish(new Presence(123456789, new SchoolHall())); public void receive(Presence presence) { [...] // TODO Auto-generated by ECLIPSE } } } 44
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
PROGRAMMING FRAMEWORKS
Programming Session
Binder newscast manager
Invitee speaker
DIASPEC service NewscastManager() extends Manager { binds session AudioMessage from Speaker, AnnouncementCenter }
service Speaker(AudioCapacities) extends Device { provides session AudioMessage to NewscastManager }
Framework class MyNewscastMng extends NewscastManager { class MySpeaker extends Speaker { SpeakerFilter filter1; public AudioMessageSession AnnouncementCenter filter2; connect(AudioMessageSession s) AudioMessage msg; { // TODO Auto-generated by ECLIPSE } AudioMessageSession session public void = bindAudioMessage(filter1, filter2, msg); disconnect(AudioMessageSession s) } { // TODO Auto-generated by ECLIPSE } } 45
THE
APPROACH: APPLYING DIAGEN TO SIMULATION Testing
DIASIM
Motivations
Testing applications in actual environments Time-consuming Money-consuming Not always possible
Simulation Fast if appropriate tools are provided Cheap Any scenarios
47
DIASIM
Ubiquitous Computing Environments
information
Applications
Sensors
commands
Actuators actions
stimuli
48
Physical parameters
DIASIM
Ubiquitous Computing Environments
information
Sensors
stimuli
48
commands
Applications
To simulate
Actuators
Physical parameters
actions
DIASIM
Requirements (1)
Testing applications against multiple simulated environments
raw context data
Simulated Environment
simulated sensors
applications
commands
simulated actuators
Primitive Services stimuli
actions
stimulus producers
49
DIASIM
Requirements (1)
Testing applications against multiple simulated environments
raw context data
applications
commands
scenario 1
Simulated Environment
simulated sensors
simulated actuators
Primitive Services stimuli
actions
stimulus producers
49
DIASIM
Requirements (1)
Testing applications against multiple simulated environments
raw context data
applications
commands
scenario 1 scenario 2
Simulated Environment
simulated sensors simulated sensorsPrimitive
stimuli stimuli
simulated actuators simulated actuators Services
Primitive Services
stimulus producers stimulus producers
49
actions actions
DIASIM
Requirements (1)
Testing applications against multiple simulated environments
raw context data
Simulated Environment
simulated sensors simulated sensorsPrimitive simulated sensorsPrimitive simulated sensorsPrimitive stimuli simulated sensorsPrimitive stimuli
stimuli stimuli stimuli
49
applications
commands
simulated actuators simulated actuators Services simulated actuators Services simulated actuators actions Services actions simulated actuators Services
Primitive Services stimulus producers stimulus producers stimulus producers stimulus producers stimulus producers
actions actions actions
scenario 1 scenario 2 scenario 3 scenario 4 scenario 5 ...
DIASIM
Requirements (2)
Testing applications without code modification
Applications Testing phase
simulated sensors
simulated actuators
Deployment phase
actual sensors
Primitive Services stimuli
Primitive Services actions
stimulus producers
Simulated Environment 50
actual actuators
stimuli
actions
stimulus producers
Actual Environment
DIASIM
The DIASIM approach
Testing applications from various application domains Parameterizing the simulator w.r.t. a DIASPEC specification
Testing applications against multiple simulated environments Supporting the development of simulated services Integration of actual primitive services
Testing applications without code modification Emulation of simulated environments 51
DIASIM
Testing Application developer
Application logic Architect
Programming framework DIASPEC specification
52
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
DIASIM
Testing Application developer
Application logic Architect
Programming framework DIASPEC specification
52
DIASPEC compiler
Simulator
Middleware
Simulation framework
Integration framework
Tester
Driver developer
DIASIM
Specifying Simulated Environments
Stimulus producers
raw context data
Applications
commands
Simulated sensors Simulated actuators
Simulated sensors
Simulated actuators actions
stimuli
Stimulus producers
53
DIASIM
Specifying Simulated Environments
Stimulus producers
raw context data
Applications
commands
Simulated sensors Simulated actuators
Simulated sensors
Simulated actuators actions
stimuli
Stimulus producers
service LuminosityStimulusProducer() { provides command ILuminosityStimulusProducer to [...]; } icommand ILuminosityStimulusProducer { LuminosityStimulusProducer[] getStimuli(Time time); }
53
DIASIM
Specifying Simulated Environments
Stimulus producers
raw context data
Applications
commands
Simulated sensors Simulated actuators
Simulated sensors
Simulated actuators actions
stimuli
Stimulus producers
serviceLightSensor() LuminosityStimulusProducer() { service extends [...] { providesevent command ILuminosityStimulusProducer to [...]; provides Luminosity to [...]; }} icommand ILuminosityStimulusProducer { service SimulatedLightSensor() extends LightSensor { LuminosityStimulusProducer[] getStimuli(Time requires event LuminosityStimulus from [...]; time); }}
53
DIASIM
Specifying Simulated Environments
Stimulus producers
raw context data
Applications
commands
Simulated sensors Simulated actuators
Simulated sensors
Simulated actuators actions
stimuli
Stimulus producers
serviceLightSensor() LuminosityStimulusProducer() { service service Light() extendsextends [...] { [...] { providesevent command ILuminosityStimulusProducer to [...]; provides Luminosity [...]; provides command ILight toto[...]; } }} icommand ILuminosityStimulusProducer { service SimulatedLightSensor() service SimulatedLight() extendsextends Light { LightSensor { LuminosityStimulusProducer[] getStimuli(Time requires event Action LuminosityStimulus from [...]; time); provides event to [...]; } }}
53
DIASIM
Developing Simulated Environments
Architect
DIASPEC specification
Simulator
Middleware
Simulation framework
Integration framework
DIASPEC compiler
Tester
54
Driver developer
DIASIM
Developing Simulated Environments Inherited support from classes of actual services
Architect
Simulation-specific support Stimulus reception, action event notification
DIASPEC specification
Simulator
Middleware
Simulation framework
Integration framework framework Integration
C' C C
Extends
C C C
DIASPEC compiler
55
simulated services
actual services
Testing Applications Without Code Modification
DIASIM
Deployment phase
Actuator
Notification
Textual Notification Simulated Textual Notification
Simulated Audio Notification News Notification
Simulated News Notification
56
Audio Notification
Testing Applications Without Code Modification
DIASIM
Deployment phase
Actuator
location=1st floor
Notification
Textual Notification Simulated Textual Notification
Simulated Audio Notification News Notification
Simulated News Notification
56
Audio Notification
Testing Applications Without Code Modification
DIASIM
Testing phase
Actuator
Notification
Textual Notification Simulated Textual Notification
Simulated Audio Notification News Notification
Simulated News Notification
56
Audio Notification
Testing Applications Without Code Modification
DIASIM
Polymorphism
Actuator
location=1st floor
Notification
Textual Notification Simulated Textual Notification
Simulated Audio Notification News Notification
Simulated News Notification
56
Audio Notification
Testing Applications Without Code Modification
DIASIM
Encapsulation
Actuator
location=1st floor
Notification
Textual Notification Simulated Textual Notification
Audio Notification
Simulated Audio Notification News Notification
Simulated class News ... Notification
56
MyNewscastManager extends NewscastManager {
NotificationFilter filter = Notification.getFilter(); filter.setLocation(new FirstFloor()); Notification notifier = getNotificationService(filter); notifier.notify(news); ...
}
Testing Applications In Hybrid Environments
DIASIM
Actuator
Notification
Textual Notification Simulated Textual Notification
Simulated Audio Notification News Notification
Simulated News Notification
57
Audio Notification
Testing Applications In Hybrid Environments
DIASIM
Actuator
location=1st floor
Notification
Textual Notification Simulated Textual Notification
Simulated Audio Notification News Notification
Simulated News Notification
57
Audio Notification
Testing Applications In Hybrid Environments
DIASIM
Why integrating actual entities?
Reuse 58
Test
DIASIM
Simulation Renderer
actual services
simulated services
59 stimulus producers
DIASIM
Simulation Renderer
actual services
simulated services
59 stimulus producers
CONCLUSION
60
CONCLUSION
Conclusion
Integrated approach for specifying, developing and testing Parameterized approach Programming frameworks Dynamicity and communication integrity Abstracting underlying technologies
Test of applications Without code modification In hybrid environments 61
CONCLUSION
Related Projects
Pantaxou approach - Julien Mercadal, Nicolas Palix (GPCE’08) Domain Specific Language
Pantagruel approach - Zoé Drey, Julien Mercadal (DSL’09) Visual language
HomeSIP project - Orange Labs (IPTComm’08)
62
CONCLUSION
Perspectives
Ubiquitous computing concerns Context Dynamic reconfiguration
Non-functional concerns Security Quality of Service Concurrence
Deployment framework 63
CONCLUSION
Publications
DIAGEN approach •W. Jouve, N. Palix, C. Consel and P. Kadionik. « A SIP-based Programming Framework for Advanced Telephony Applications ». In proceedings of IPTComm’08, Heidelberg, Germany, July 2008. Awarded Best Student Paper Award. •W. Jouve, J. Lancia, N. Palix, C. Consel, and J. Lawall. « High-level Programming Support for Robust Pervasive Computing Applications ». In proceedings of PerCom’08, Hong Kong, China, March 2008 (WiP Session). •C. Consel, W. Jouve, J. Lancia, and N. Palix. « Ontology-Directed Generation of Frameworks For Pervasive Service Development ». In proceedings of PerWare’07, White Plains, New York, USA, March 2007 (Workshop). DIASIM approach •W. Jouve, J. Bruneau, and C. Consel. « DiaSim : A Parameterized Simulator for Pervasive Computing Applications ». In proceedings of PerCom’09, Galveston, Texas, March 2009 (Demo). •W. Jouve, J. Bruneau, and C. Consel. « DiaSim : A Parameterized Simulator for Pervasive Computing Applications ». Submitted to Mobiquitous’09. Applications •W. Jouve, N. Ibrahim, L. Réveillère, F. Le Mouel, et C. Consel. « Building Home Monitoring Applications : From Design to Implementation into The Amigo Middleware ». In proceedings of ICPCA’07, Birmingham, UK, July 2007. •Y.-D. Bromberg, C. Consel, W. Jouve, S. Ben Mokhtar, N. Georgantas, V. Issarny, and P.-G. Raverdy. « Middleware for ubiquitous computing ». In « ARAGO 31 : Ubiquitous Computing » OFTA report. May 2007. Session interaction mode in Web Services •W. Jouve, J. Lancia, C. Consel, and C. Pu. « A Multimedia-Specific Approach to WS-Agreement ». In Proceedings of ECOWS’06, Zurich, Switzerland, December 2006.
64