Sei sulla pagina 1di 2

15 UML Sequence Diagrams and Activity Diagrams

The Unified Modeling Language (UML) offers various diagramming techniques, two of which are com-
monly employed in requirements specification to model the dynamic aspects of a system: sequence
diagrams and activity diagrams. Both provide a graphical notation that can enhance a textual specification
(e.g., based on use cases). They are optional in processes like the UP; Hence, the requirements engineer
has to make a decision whether to include them within a specific project. Sequence diagrams are the UML
version of message sequence charts (MSCs), originally developed for the telecom industry. In requirements
engineering, system sequence diagrams (SSDs) model the system as a black box and focus on the events
generated by actors and how they are handled by the system. UML activity diagrams are data/control flow
graphs, similar to old-fashioned flow charts traditionally used in business process modeling. They can
enhance textual use cases descriptions by modeling all extensions and alternative scenarios in a single
diagram, which can help understanding a complex use case. Typically, these diagrams are added in later
iterations within a project. However, since they add more artifacts to the specification, they also add more
traceability challenges. 15.1

Learning Objectives
Learning Objective 1:
Learn how to enhance textual specifications with graphical representations based on UML sequence
and activity diagrams
Understand which diagram type to use, and when
Understand the traceability challenges when working with diagramming techniques
Understand the concept of text-based modeling for UML diagrams

Learning Objective 2:
Understand the difference between a sequence diagram and a system sequence diagram (SSD)
Learn the UML notation for sequence diagrams
Learn how to map use case scenarios to sequence diagrams
Understand how to model conditional messages and repetitions

Learning Objective 3:
Learn the UML notation for activity diagrams
Learn the use of partitions (swimlanes) for structuring activity diagrams
Learn the connections between use cases and activity diagrams
Understand how to model parallel activities, branches, repetitions, sub-activities, signals, and guard
conditions in activity diagrams
Learn guidelines for developing good activity diagrams

Notes and Further Reading


UML sequence diagrams for modeling the behaviour of a system, in particular based on scenarios, are
covered in [4, Chapter 13.1]. Pohl provides a similar introduction in [3, Chapter 11.5]. Larman has more
examples and a good description of the role of SSDs in the overall development process [2, Chapter 10].
For an introduction to UML activity diagrams, read [2, Chapter 28]. Pohl also briefly covers them in [3,
Chapter 11.6]. The UML guide [1] covers both sequence and activity diagrams, but note that it does not
specifically address their role in requirements engineering.
Modeling activities in the form of business processes or workflows is a much broader topic that we
cannot cover in the scope of this lecture. The Business Process Model and Notation (BPMN) is an example
for a graphical language used in this domain. While graphically similar to UML activity diagrams, it also
targets the execution of the modeled workflow, in particular based on the Business Process Execution
Language (BPEL). The open source framework Camunda (http://www.camunda.org/) supports BPMN and
is widely used in industry, in particular in the finance and insurance domains. Not based on BPMN, but
very popular for modeling workflows in science and technology, in particular biotechnology, is the Taverna
Workbench (http://www.taverna.org.uk/).

15-1
15-2 Bibliography

Reading Material
Required
[4, Chapter 1313.1] (Sequence diagrams)

Supplemental
[2, Chapters 10, 28] (SSDs and activity diagrams in the UP)
[1, Chapters 4, 11] (UML guide to sequence and activity diagrams)
[3, Chapters 11.5, 11.6] (RE with UML sequence and activity diagrams)
Allen Holubs UML Quick Reference, http://www.holub.com/goodies/uml/
15.55

Tools
Textual Modeling for UML
Web Sequence Diagrams, https://www.websequencediagrams.com/
PlantUML, http://plantuml.sourceforge.net/
Scruffy, https://github.com/aivarsk/scruffy

BPM and WMS


Camunda, http://www.camunda.org/
Taverna Workbench, http://www.taverna.org.uk
myExperiment, http://www.myexperiment.org/
15.56

Bibliography
[1] Martin Fowler. UML Distilled: A Brief Guide to the Standard Object Modeling Language. Addison-
Wesley, 3rd edition, 2004.
[2] Craig Larman. Applying UML and Patterns. Prentice Hall, third edition, 2005.
[3] Klaus Pohl. Requirements Engineering: Fundamentals, Principles, and Techniques. Springer-Verlag
Berlin Heidelberg, 2010.
[4] Axel van Lamsweerde. Requirements Engineering: From System Goals to UML Models to Software
Specifications. John Wiley & Sons, 2009.

Study Questions
1. Explain the difference between a sequence diagram and a system sequence diagram.
2. How are system sequence diagrams connected with use case scenarios?
3. What are the connections between the domain model and the sequence or activity diagrams?
4. How can activity diagrams help with complex use cases (having several alternative flows or exten-
sions)?
5. Under what circumstances would you add a system sequence diagram or activity diagram to a (use
case based) requirements specification?
6. Discuss the traceability challenges when working with diagramming techniques within a project.

SOEN 6481 Lecture Notes, Winter 2015/16

Potrebbero piacerti anche