2. Introduction
A communication diagram, formerly called a collaboration diagram, is an interaction
diagram that shows similar information to sequence diagrams but its primary focus
is on object relationships.
Communication Diagram is also used to model the dynamic behavior of the use case.
It is more focused on showing the collaboration of objects rather than the time
sequence.
3. Purpose
Very useful for visualizing the relationship between objects collaborating to perform
a particular task.
Model flow control
Illustrate coordination of object structure and control.
5. Collaborations
Actor
Life Line
Actors
● Each Actor is named
and has a role
● One actor will be the
initiator of the use
case
Objects
● Each object in the
collaboration is
named and has its
class specified
● Not all classes need
to appear
● There may be more
than one object of a
class
Links
● Links connect
objects and actors
and are instances of
associations
● Each link
corresponds to an
association in the
class diagram
6. On communication
diagrams, objects are
shown with association
connectors between them.
Messages are added to the
associations and show as
short arrows pointing in
the direction of the
message flow. The
sequence of messages is
shown through a
numbering scheme.
7. Messages In order to maintain the ordering
of messages in a free-form
diagram, messages are labeled
with a chronological number and
placed near the link that message
is sent over. Reading involves
starting at message 1.0, and
following the messages from
object to object.
[sequenceNumber:] methodName(param) [: returnValue]
1.2 :getName(string) :firstName
9. Communication diagram For Online Shopping System
Scenario: Customer login to his/her account and order the
items/products that he/her wants and finally do the
payments.
Analyzing functional requirements and Identifying the main
flow
1. Customer login-Using customer ID & Password
2. Order the items and get the prices
3. Do payments
10. Requirement 1:Customer login
Objects/Classes : Customer, account
Message: login(id,pwd)
Requirement 2:Order the items and get the prices
Objects/Classes : Item,Price
Message: order item,get price
Requirement 3:Do payments
Objects/Classes : Item
Message: do payment
12. Communication Diagrams.. Furthermore…..
Automatically generated test cases based on communication diagrams…!!!
Represent messages passed between objects and their sequences.
Can provide data flow and control flow information.
Data flow and control flow info have significant bearing on test case generation
With communication diagrams it’s possible to generate cluster level test cases