Composition-based Interaction Design for...
Transcript of Composition-based Interaction Design for...
Composition-based Interaction Design for Adaptable Distributed Software Systems
Kenji Tei Assistant Professor, National Institute of Informatics
Self-Introduction : Kenji Tei• Assistant professor at NII
– [email protected] – http://researchmap.jp/teikenji
• Research Interests – adaptive software system
– model-driven development, software architecture – networked embedded systems
• especially wireless sensor networks
• recently IoT, wireless control systems, and robots
2
GRACE Center �
Distributed Software System
3
robots
networked control system
sensor network
Service-oriented (cloud) system
network
Adaptive Systems
self-adaptation systems that are able to modify their behavior and/or structure in response to their perception of the environment and the system itself, and their requirements Rogério de Lemos, et.al., Software Engineering for Self-Adaptive Systems: A Second Research Roadmap, SEAMS2011.
4
D,S |= RGoal/Requirement
SpecificationDomain properties(assumptions)
D’|= RS’,
Modify S in response to changes in D to satisfy R
off-line : Adaptive maintenance
on-line : Self-adaptation
Adaptation
Carlo Ghezzi, The fading boundary between development time and run time, SEAMS 2011
Our Focus
5
Adaptation Engine
Adaptable Software
effectingmonitoring
self-adaptive software
Monitor
Analyze Plan
Execute Monitor
Analyze Plan
Execute Monitor
Analyze Plan
Execute
MAPE loops
How to develop adaptable software
to be adaptable?
Adaptable software should be developed to support one or more solutions All solutions should be tightly related to requirements
Adaptable Software Development
Control loop for cleaning�
Collect�
Battery maintained
Object found�
Battery level observed�
Battery charged�
Current position detected�
Dust disposed�
Dust picked up�
Dust swept�
Dust appearance and cleaning result
observed�
Analyze �& Decide�
Analyze & Decide�Conditional Act�
Act� Collect�
Got close to object�
Analyze& Decide�
Collect�
Control loop for battery maintenance�
Object reachable�
Act�Collect�
Dust reachable
Station reachable
Act�
Act�
Control loop for approaching object�
Dust appearance�
Cleaning result�
Cleaning method�
Battery level�
Migration direction�
Object position
Current position�
���
Collect�
Battery maintained
Object and obstacle found�
Battery level observed�
Battery charged�
Current position detected�
Dust disposed�
Dust picked up�
Dust swept�
Dust appearance and cleaning
result observed�
Analyze �& Decide�
Analyze & Decide�
Conditional Act�
Act� Collect�
Got close to object�
Analyze& Decide�
Collect�
Control loop for battery maintenance�
Object reachable with
avoiding obstacles�
Act�
Load capacity not exceeded
Load amount observed�
Dust unloaded into dustbin�
Analyze & Decide�Act� Collect�Control loop for load amount management�
Collect�
Dustbin reachable�
Dust reachable
Station reachable
Act�
Act�
Act�
Control loop for approaching object�
Dust appearance�
Cleaning result�
Control loop for cleaning�
Cleaning method�
Battery level�
Migration direction�
Object position
Current position�
Load amount�
Traceability links between R and S should be maintained Changes in S for adaptation should be localized
adaptation
Architecture Design
Detailed Design
Req. analysis Impl.
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = TEMPERATUREprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = TEMPERATURE
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = HUMIDITYprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = HUMIDITY
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = HuffmantransmissionCondition = 30 secsendDataType = ACCELERATIONprotocol = CTP
: SendingTask
samplingCondition = 0.2 secdataType = ACCELERATION
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = DEFORMATIONprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = DEFORMATION
: SamplingTask
duration = 10 mintimeWindow = 100 minfunction = AVERAGEinputDataType = DEFORMATION
: TemporalAggregationTask
location = 3Fid = 153
: Node
location = 3Fid = 141
: Node
location = 3Fid = 146
: Node
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = TEMPERATUREprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = TEMPERATURE
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = HUMIDITYprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = HUMIDITY
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = HuffmantransmissionCondition = 30 secsendDataType = ACCELERATIONprotocol = CTP
: SendingTask
samplingCondition = 0.2 secdataType = ACCELERATION
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = DEFORMATIONprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = DEFORMATION
: SamplingTask
duration = 10 mintimeWindow = 100 minfunction = AVERAGEinputDataType = DEFORMATION
: TemporalAggregationTask
location = 3Fid = 153
: Node
location = 3Fid = 141
: Node
location = 3Fid = 146
: Node
SR
S’
Architecture Design for Distributed Software
Architecture Design
Detailed Design Impl.
Structural models
Req. analysis
Control loop for cleaning�
Collect�
Battery maintained
Object found�
Battery level observed�
Battery charged�
Current position detected�
Dust disposed�
Dust picked up�
Dust swept�
Dust appearance and cleaning result
observed�
Analyze �& Decide�
Analyze & Decide�Conditional Act�
Act� Collect�
Got close to object�
Analyze& Decide�
Collect�
Control loop for battery maintenance�
Object reachable�
Act�Collect�
Dust reachable
Station reachable
Act�
Act�
Control loop for approaching object�
Dust appearance�
Cleaning result�
Cleaning method�
Battery level�
Migration direction�
Object position
Current position�
Requirements (Goal)
Behavioral models
A C B
Interactions
A C B A C B A C B
Structure design ・ component-based software structure ・ component allocation to subsystems Behavior design ・ interaction between subsystems ・ local behavior in a subsystem
Traceablity between R and S to Localize Changes
• Structural view
8
Goal model Architectural structure SR
• Behavioral viewcfp�
Manager� Drone� Cleaning/Robot/
mapping�Send6map�
Cleaning�
observe�
propose�
refuse�alt�
accept6proposal�
refuse6proposal�alt�
result�
failure�alt�
Un;l/������
Logger/
? cfp�
Manager� Drone� Cleaning/Robot/
mapping�Send6map�
Cleaning�
observe�
propose�
refuse�alt�
accept6proposal�
refuse6proposal�alt�
result�
failure�alt�
Un;l/������
Logger/
cfp�
Manager� Drone� Cleaning/Robot/
mapping�Send6map�
Cleaning�
observe�
propose�
refuse�alt�
accept6proposal�
refuse6proposal�alt�
result�
failure�alt�
Un;l/������
Logger/
Interaction
Importance of Interaction Design
• Interaction is usually designed to satisfy one or more requirements – especially, for networked embedded system,
reliability, performance, security, etc..., will be affected by interaction design
• One interaction is related to many concerns – centralized/decentralized coordination, logging,
compression, encryption, retransmission, etc…
9
Room Cleaning System Scenario
10
Less Traceability between R and S(Interaction)
11
cfp�
Manager* Room*sensor�
Cleaning*robot*
mapping�Send6map�
Cleaning�
observe�
propose�
refuse�alt�
accept6proposal�
refuse6proposal�alt�
result�
failure�alt�
Un:l*������
Logging**server*
interweaving
request�
Manager� Mobile/robot�
Cleaning/robot/
mapping�Send5map�
Cleaning�
observe�
propose�
auth5request�
accept�
refuse�alt�
result�
failure�alt�
Un;l/������
Logging/server/
...
scattering
hard to localize changes for adaptation
Our Approach : Composition-based Interaction Design
Base� Observer�
request,observe�
Cleaning3Robot3
Send,result�mapping�
Send,map�
obseving�
Requester�
Mobile-Robot�
cfp�
propose�
refuse�alt�
accept2proposal�
refuse2proposal�alt�
inform2result�observe�
Requester�
Room*Sensor�
request�
Inrom.*result�observe�
auth.request�user.info�
accept�
refuse�alt�
Sender�
Receiver�
Result�
Failure0�alt�
loop�
cfp�
Manager* Room*sensor�
Cleaning*robot*
mapping�Send6map�
Cleaning�
observe�
propose�
refuse�alt�
accept6proposal�
refuse6proposal�alt�
result�
failure�alt�
Un:l*������
Logging**server*
request�
Manager� Mobile/robot�
Cleaning/robot/
mapping�Send5map�
Cleaning�
observe�
propose�
auth5request�
accept�
refuse�alt�
result�
failure�alt�
Un;l/������
Logging/server/
...
(1) design a piece of interaction
(2) automate compositions of interactions
Interaction Composition
• Complete interaction can be achieved by composing sub-interactions corresponding to a requirement
Base Observer
request-observe
Roomba
Send-resultmapping
Send-map
obseving
Result
Failure alt
loop
Drone
Drone
Requester
Drone
cfp
propose
refusealt
accept-proposal
refuse-proposalalt
inform-result observe
cfp
DroneDroneLeader Drone Rumba
mappingSend-map
Cleaning
observe
propose
refusealt
accept-proposal
refuse-proposalalt
result
failurealtUntil 処理が成功
Logger
Compose
Interaction Composition
14
Base Observer
request-observe
Roomba
Send-resultmapping
Send-map
obseving
Result
Failure alt
loop
Compose
Requester
R_Sensor
request
Inrom- resultobserve
auth-requestuser-info
accept
refusealt
request
DroneDroneLeader Drone Rumba
mappingSend-map
Cleaning
observe
propose
auth-request
accept
refusealt
result
failurealt
Until 処理が成功
Logger
• Complete interaction can be achieved by composing sub-interactions corresponding to a requirement
Ongoing Work : Composition-based Interaction Design
• Identify specifications of interaction pieces from goal model – goal elaboration process to clarify requirements for interaction pieces,
• Compose interactions – bind roles and data, and merge message sequences – explore and find a composition satisfying all their constraints
• Detailed behavior design and implementation should also be changed according to the changed interaction – local behaviors and implementation are also designed to be
composable
15
R. Takahashi, F.Ishikawa, K.Tei, and Y.Fukazawa: Intention-based Automated Composition Approach for Coordination Protocol, ICWS2013.
Base� Observer�
request,observe�
Roomba0
Send,result�mapping�
Send,map�
obseving�
Drone�
Drone�
Requester�
Drone�
cfp�
propose�
refuse�alt�
accept,proposal�
refuse,proposal�alt�
inform,result�observe�
Compose�
Summary
• Interaction is high level design decision about behavior of distributed software system – one or more solutions exist for one requirement
• Adaptable software should be designed to support one or more interactions for each requirement – however, traceability link between req. and interactions is unclear
• To clarify traceability between requirements and interactions, we adopt composition-based approach – one requirement corresponds to one interaction piece – complete interaction can be achieve by composing interaction
pieces – easy to change solutions of a certain requirement
16
Overview of works in NII
Control loop for cleaning�
Collect�
Battery maintained
Object found�
Battery level observed�
Battery charged�
Current position detected�
Dust disposed�
Dust picked up�
Dust swept�
Dust appearance and cleaning result
observed�
Analyze �& Decide�
Analyze & Decide�Conditional Act�
Act� Collect�
Got close to object�
Analyze& Decide�
Collect�
Control loop for battery maintenance�
Object reachable�
Act�Collect�
Dust reachable
Station reachable
Act�
Act�
Control loop for approaching object�
Dust appearance�
Cleaning result�
Cleaning method�
Battery level�
Migration direction�
Object position
Current position�
���
Collect�
Battery maintained
Object and obstacle found�
Battery level observed�
Battery charged�
Current position detected�
Dust disposed�
Dust picked up�
Dust swept�
Dust appearance and cleaning
result observed�
Analyze �& Decide�
Analyze & Decide�
Conditional Act�
Act� Collect�
Got close to object�
Analyze& Decide�
Collect�
Control loop for battery maintenance�
Object reachable with
avoiding obstacles�
Act�
Load capacity not exceeded
Load amount observed�
Dust unloaded into dustbin�
Analyze & Decide�Act� Collect�Control loop for load amount management�
Collect�
Dustbin reachable�
Dust reachable
Station reachable
Act�
Act�
Act�
Control loop for approaching object�
Dust appearance�
Cleaning result�
Control loop for cleaning�
Cleaning method�
Battery level�
Migration direction�
Object position
Current position�
Load amount�
・Exploration of adaptation space Fuyuki Ishikawa
・Composition-based interaction design for adaptable distributed software systems Kenji Tei
Adaptation space analysis
Traceability maintenance to localize changes
adaptation
Architecture Design
Detailed Design
Req. analysis Impl.
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = TEMPERATUREprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = TEMPERATURE
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = HUMIDITYprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = HUMIDITY
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = HuffmantransmissionCondition = 30 secsendDataType = ACCELERATIONprotocol = CTP
: SendingTask
samplingCondition = 0.2 secdataType = ACCELERATION
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = DEFORMATIONprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = DEFORMATION
: SamplingTask
duration = 10 mintimeWindow = 100 minfunction = AVERAGEinputDataType = DEFORMATION
: TemporalAggregationTask
location = 3Fid = 153
: Node
location = 3Fid = 141
: Node
location = 3Fid = 146
: Node
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = TEMPERATUREprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = TEMPERATURE
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = HUMIDITYprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = HUMIDITY
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = HuffmantransmissionCondition = 30 secsendDataType = ACCELERATIONprotocol = CTP
: SendingTask
samplingCondition = 0.2 secdataType = ACCELERATION
: SamplingTask
deploymentCondition = ALL
: MemberRole
encryption = NONEcompress = NONEtransmissionCondition = 10 minsendDataType = DEFORMATIONprotocol = CTP
: SendingTask
samplingCondition = 10 mindataType = DEFORMATION
: SamplingTask
duration = 10 mintimeWindow = 100 minfunction = AVERAGEinputDataType = DEFORMATION
: TemporalAggregationTask
location = 3Fid = 153
: Node
location = 3Fid = 141
: Node
location = 3Fid = 146
: Node
・Putback-based Bidirectional Programming Zhenjiang Hu ・Bidirectional Graph Transformation Infrastructure and its Applications Soichiro Hidaka
Change propagation
・Designing Self-adaptive System using Control Loops Shinichi Honiden