debugging multi-agent systems using design artifacts: the case of interaction protocols by david...
TRANSCRIPT
Debugging Multi-agent Systems Using Design Artifacts:
The Case of Interaction Protocols
By David Poutakidis
Introduction
Agents are softwareDeveloping agents is developing
softwareNeed appropriate design
methodologies and tools (Prometheus)Debugging and Testing are an
important part of any system development.
Debugging is important.
Up to 50% of the total cost/time of development
Much of this time is spent trying to: Locate bugs Determine the cause of a problem
Debugging problem exacerbated by the flexibility and complexity of agent systems
Current Debugging Techniques
Information gathering and visualisation Filtering applied Color Coded messages displayed at
runtimeLimitations
Too much information to digest No process for choosing the info to display Relies on programmer interpreting
message flow properly
Our Approach: Make use of Design Documents
During design, documents are produced: which represent the developers description
of the system that describe how the system should operate that guide the programmers during coding
Design Artifacts: interaction protocols, interaction diagrams,
scenario diagrams, capability diagrams, plan descriptors, etc
Central Thesis:
is that the design documents and system models developed when following an agent based software engineering methodology can be valuable resources during the debugging process and should facilitate the automatic or semi-automatic detection of errors.
Interaction Protocols
Capture interaction patterns between agents
Allow choices and describe all allowable interactions
Existing protocol’s developed, eg FIPA (based on AUML)
Buy bookBuy book
Delivery info.Delivery info.
Delivery choiceDelivery choice
Card detailsCard details
Card details requestCard details requestCard detailsCard details
ApprovalApprovalThanksThanks OrderOrder
User Shop ass. Warehouse Cashier
Credit check requestCredit check request
Details requestDetails request
Use case:
1. Customer orders book
2. Customer specifies delivery
3. Shop ass. Obtains & checks credit details
4. Shop ass. thanks customer and places order
Use Case and Interaction Diagram
Merchant Bank
x
Credit check request (CCR)
Card details request (CDR)
Card details (CCD)
Approve
Reject-2
Fraud
Reject-1
M1
M2
M3
M4
M5
M6
B1
B2
Debugging with Interaction Protocols
Agent AgentMessages
Debugger
User
AUML not suitable for debugger
AUML not used internally by the debugger AUML is not precisely defined, no formal
semantics decouple the underlying representation to
allow for future versions of AUML or other notations altogether.
We use equivalent Petri Nets internally Clear formal semantics, algorithms and tools
for checking properties (liveness, deadlock…)
Petri Nets Explained
•Consists of Places (depicted as circles) and Transitions depicted as squares.
•Places and Transitions linked by arrows.
•Places can contain tokens which indicate it’s marking and the state the net is in.
Before Firing
After Firing
Converting AUML protocol to a Petri net equivalent.
a aP Q
P a
P a
Translating AUML Connectors
a
b
AUML: Selection
Petri net: Selection
P
P
Q
Q
a b
R
R
M1
CCR
B1
CDR
M2
CCD
B2
Fraud
M6
M3
M5M4
B2’’B2’
Reject-2
Reject-1
Approve
Bank
x
Credit check request (CCR)
Card details request (CDR)
Card details (CCD)
Approve
Reject-2
Fraud
Reject-1
M1
M2
M3
M4
M5
M6
B1
B2
Merchant
Reject-2
Reject-1
Approve
M1
CCRB1
CDR
M2
CCD
M6
B2
M3
B2’ B2’’
M4 M5
Execution of the Debugging Agent
Repeat:
1. Receive message m
2. Check m against existing protocol instances
3. Fire the Petri Net(s)
4. Examine the Petri Net(s) for erroneous conditions.
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•New protocol instance created and token placed on M1
•Token placed on CCR
•Fire net
B1
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•New protocol instance created and token placed on M1
•Token placed on CCR
•Fire net
B1
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•New protocol instance created and token placed on M1
•Token placed on CCR
•Fire net
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
B2
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•New protocol instance created and token placed on M1
•Token placed on CCR
•Fire net
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
•Merchant to Bank:CCD•Token placed on CCD
•Fire Net
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•New protocol instance created and token placed on M1
•Token placed on CCR
•Fire net
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
•Merchant to Bank:CCD•Token placed on CCD
•Fire Net
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•New protocol instance created and token placed on M1
•Token placed on CCR
•Fire net
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
•Merchant to Bank:CCD•Token placed on CCD
•Fire Net
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
•Merchant to Bank:CCD
•Token placed on CCD
•Fire Net
•Bank to Merchant: Approve•Token placed on approve
•Fire net
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
•Merchant to Bank:CCD
•Token placed on CCD
•Fire Net
•Bank to Merchant: Approve•Token placed on approve
•Fire net
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•Bank to Merchant: CDR
•Token placed on CDR
•Fire net
•Merchant to Bank:CCD
•Token placed on CCD
•Fire Net
•Bank to Merchant: Approve•Token placed on approve
•Fire net
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•Bank to Merchant: CDR
•Merchant to Bank:CCD
•Token placed on CCD
•Fire Net
•Bank to Merchant: Approve
•Token placed on approve
•Fire net
•Bank to Merchant: Fraud•Token placed on Fraud
•Fire Net
Fraud
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Consider the following sequence of messages:
•Merchant to bank: CCR
•Bank to Merchant: CDR
•Merchant to Bank:CCD
•Token placed on CCD
•Fire Net
•Bank to Merchant: Approve
•Token placed on approve
•Fire net
•Bank to Merchant: Fraud•Token placed on Fraud
•Fire Net
Fraud
Reject-2
Reject-1
Approve
M1
CDR
M2
CCD
M6
B2
B2’ B2’’
M4 M5
M3
CCR
Error encountered!!!
•No transition enabled (because there is no token on B2)
•The debugging agent reports a bug: the fraud message was unexpected
Fraud
Future Work
Currently implementing the debugging agent
Provide tool support to automatically convert AUML protocols to Perti nets
Investigate how other design artifacts can be used for debugging