SE 1: Software Requirements Specification and Analysis Lecture 4: - - PowerPoint PPT Presentation

se 1 software requirements specification and analysis
SMART_READER_LITE
LIVE PREVIEW

SE 1: Software Requirements Specification and Analysis Lecture 4: - - PowerPoint PPT Presentation

SE 1: Software Requirements Specification and Analysis Lecture 4: Basic Notations Nancy Day, Davor Svetinovi c http://www.student.cs.uwaterloo.ca/cs445/Winter2006 uw.cs.cs445 U Waterloo SE1 (Winter 2006) p.1/38 Announcements Send


slide-1
SLIDE 1

SE 1: Software Requirements Specification and Analysis

Lecture 4: Basic Notations

Nancy Day, Davor Svetinovi´ c http://www.student.cs.uwaterloo.ca/˜cs445/Winter2006 uw.cs.cs445

U Waterloo SE1 (Winter 2006) – p.1/38

slide-2
SLIDE 2

Announcements

Send your group to cs445@student.cs.uwaterloo.ca by Friday, 13 Jan 2006 2:00pm. Grad students need to have their topics chosen and approved by Friday, 13 Jan 2006. Assignments of TAs to groups will be posted to the

  • newsgroup. It is your responsibility to contact your group TA

to arrange meetings.

U Waterloo SE1 (Winter 2006) – p.2/38

slide-3
SLIDE 3

Review: Use Cases

An actor is an external entity that interacts directly with the system. “A use case represents a series of interactions between an outside entity and the system, which ends by providing business value.” It is a collection of related success and failure scenarios that describe actors using a system to support a goal (an observable result of value to a particular actor). A scenario is specific sequence of actions and interactions between actors and system. A scenario is also called a use case instance. A scenario is one path through a use case. A use case should capture an elementary business processes (EBPs): “a task with measureable business value performed by one actor in one place at one time ”.

U Waterloo SE1 (Winter 2006) – p.3/38

slide-4
SLIDE 4

Review: Use Case Descriptions

Use case number Name Authors Event/Precondition System Actors Overview/Postcondition References Related Use Cases Typical Process Description Basic Flow Alternatives Exceptions Subsections

U Waterloo SE1 (Winter 2006) – p.4/38

slide-5
SLIDE 5

Review: Use Case Diagram

Describes the set of all use cases graphically Shows relationships between actors and use cases Shows relationships between use cases includes Shows the boundary of the system

U Waterloo SE1 (Winter 2006) – p.5/38

slide-6
SLIDE 6

Today’s Agenda

Use cases (con’d from last class) Finding use cases Advanced use case modelling Rules of thumb What aspects of the system do we need to describe? What are the features of a good specification notation?

U Waterloo SE1 (Winter 2006) – p.6/38

slide-7
SLIDE 7

Today’s Agenda

Basic notations: Event traces Entity-relationship diagrams (ERDs) Data flow diagrams (DFDs) Finite state machines (FSM) Decomposition strategies RE modelling processes (relevant to this course) We will concentrate on notations used to describe the functional (as opposed to non-functional) behaviour of a system. Required Reading: None Optional Reading: R. Wieringa, A Survey of Structured and Object-Oriented Software Specification Methods and Techniques ACM Computing Surveys, Col. 30, No. 4, December 1998.

U Waterloo SE1 (Winter 2006) – p.7/38

slide-8
SLIDE 8

Aspects of a System

In a specification, there are four aspects of a system that we want to describe:

functions: tasks that the system carries out communication: interactions that the system has with its

environment

behaviour: the permissible orderings of the functions conceptual (data): description of the data manipulated by the

system Different notations are better or worse at describing these different aspects of a system.

U Waterloo SE1 (Winter 2006) – p.8/38

slide-9
SLIDE 9

Decomposition

Interaction refinement decomposition System Interaction abstraction System aggregation

Later, we will discuss methods for system decomposition.

U Waterloo SE1 (Winter 2006) – p.9/38

slide-10
SLIDE 10

Specification Notations

What are the features of a good specification notation? Well-defined set of concepts Results in unambiguous, clear, precise, concise specification Ability to analyze (syntax, consistency checking) CASE tool support Understood by all stakeholders (graphical is good) Supports traceability Other desirable, (but rarely obtainable): Can generate test cases Can determine conformance of implementation to specification Can check consistency of one specification with another

U Waterloo SE1 (Winter 2006) – p.10/38

slide-11
SLIDE 11

Basic Specification Notations

Most specification languages are a combination of notations used to describe different aspects of the system. Each notation emphasizes one of function, communication, or behavioural descriptions. The following are very common basic notations: Event Traces – communication, bit of behaviour Entity-relationship diagrams (ERDs) – conceptual Data flow diagrams (DFDs) – communication, bit of functional Extended finite state machines (FSMs) – behaviour Use case descriptions – functional A trait of an engineering discipline is that there are “standard” notations.

U Waterloo SE1 (Winter 2006) – p.11/38

slide-12
SLIDE 12

Example: Turnstile

GOAL: charge admission to a park or zoo Physical barrier that unlocks when a token is inserted into turnstile Buzzer sounds whenever the barrier is unlocked Want to keep track of the number of visitors to park Display the number of visitors upon request

U Waterloo SE1 (Winter 2006) – p.12/38

slide-13
SLIDE 13

Event Traces

Graphical description of communication/events in one scenario Messages between system and its environment (or among system entities) Relative ordering in time (not absolute) Emphasize communication; show a bit of behaviour (ordering among messages), but not complete behaviour

Entity 1 Entity 2 Time event A event B

vertical line = time line

  • f

en- tity/actor/object horizontal line = event/message from

  • ne entity to another

U Waterloo SE1 (Winter 2006) – p.13/38

slide-14
SLIDE 14

Event Traces

Variations: Show iteration Associate conditions with an interaction Self-call (sending a message to one’s self) Asynchronous communication (non-blocking - i.e., continue behaviour without waiting for a reply)

U Waterloo SE1 (Winter 2006) – p.14/38

slide-15
SLIDE 15

Event Traces

Advantages: Simple (one scenario) Easy to understand Somewhat precise (although only relative timing) Disadvantages: Not an efficient way to represent behaviour Useful for elicitation and consideration of end-to-end system behaviour.

U Waterloo SE1 (Winter 2006) – p.15/38

slide-16
SLIDE 16

ERDs

ERD = Entity-relationship diagram Originally for database design (Chen, 1976) Emphasize concepts/data Graphical description of problem domain: Entities (think “objects”) Relationships (often named with verbs) Relationships can represent communication, part-of, visibility, etc At first, entities are concepts in the environment. After refinement, we separate concepts in the environment from concepts (i.e., components) of the system to show conceptual decomposition In OO terms, the problem domain is called the conceptual level of description. Origin of class diagrams (UML)

U Waterloo SE1 (Winter 2006) – p.16/38

slide-17
SLIDE 17

ERDs - Symbols

Rel Relationship between entities attr Attributes − property Entity Entity − (class) collection of real−world individuals with common properties

U Waterloo SE1 (Winter 2006) – p.17/38

slide-18
SLIDE 18

Variations

Cardinality on relationships (1-many, many-many) Attributes on relationships Subtypes (inheritance) Directions on associations to indicate navigability

U Waterloo SE1 (Winter 2006) – p.18/38

slide-19
SLIDE 19

ERDs

Advantages: Simple (few symbols) Disadvantages: What to model as entities vs attributes? May encourage too detailed modelling (i.e. getting into design details if used for too much decomposition at the requirements level)

U Waterloo SE1 (Winter 2006) – p.19/38

slide-20
SLIDE 20

Data Flow Diagrams (DFDs)

Graphical description of flow of data among components Emphasize communication, bit of functional

typically used at the start or end of data flow Object − data source or sink Function/Process − action, transformation of data Data Flow − labelled with data

data

store

Data Store − internal (i.e., system) data source or sink

Legend:

NOT a req. concept

U Waterloo SE1 (Winter 2006) – p.20/38

slide-21
SLIDE 21

DFDs

Advantages: Simple Can be hierarchical and thereby also show communication among the components in a functional decomposition of the system Disadvantages: Ambiguities: When do functions get executed? If multiple inputs, are they all needed? Can’t distinguish data and control signals If multiple outputs, are both always generated? i.e., they are really only good for show communication!

U Waterloo SE1 (Winter 2006) – p.21/38

slide-22
SLIDE 22

Context Diagram

A context diagram is a DFD where the system is represented as one function. It shows all the inputs and outputs of the system and which environmental entities they come from and go to. The context diagram shows the scope/boundary of the system. A context diagram can also be done for major subsystems.

U Waterloo SE1 (Winter 2006) – p.22/38

slide-23
SLIDE 23

FSMs

Describes control flow: Behaviour depends on current state State represents the history of input Graphical description of dialog between system and environment Emphasizes behaviour: shows order in which functions can be executed and order of communication Compact representation of a set of event traces

Legend:

State − represents history of dialog; state of system/environment

input/output

State Transition − triggered by input event; generates output

U Waterloo SE1 (Winter 2006) – p.23/38

slide-24
SLIDE 24

FSMs

Variations: Hierarchy used to: Represent concurrent operations Priority (interrupts, etc) Can be presented in a tabular format Communication mechanisms between multiple FSMs Broadcast vs directed Queues (delayed)

U Waterloo SE1 (Winter 2006) – p.24/38

slide-25
SLIDE 25

FSMs

Advantages: Most formal (least ambiguity) Compact way to represent many behaviours Disadvantages: More complex Doesn’t show functional decomposition

U Waterloo SE1 (Winter 2006) – p.25/38

slide-26
SLIDE 26

Summary

These notations all represent different aspects of the system’s behaviour (views): Conceptual/structural/static (ERDs) Communication (DFDs, event traces) Behavioural/dynamic (event traces, FSMs) Functional (use case descriptions, pre/post conditions) Most methods use a combination of variations on the above notations. Note: FSMs specify behaviour; traces illustrate behaviour.

U Waterloo SE1 (Winter 2006) – p.26/38

slide-27
SLIDE 27

Decomposition Strategies

The purpose of decomposition during requirements analysis is to make the specification as simple and understandable as

  • possible. It is not a decomposition for how you might

implement the system. Three common strategies for system decomposition are: Functional: break functions into subfunctions (e.g., Structured Analysis) Process: break functions into subfunctions, but at the lowest level functions can run concurrently (processes). (e.g., SDL) Object Oriented: break system into objects. (e.g., UML) What are the responsibilities of each object? How do objects interact?

U Waterloo SE1 (Winter 2006) – p.27/38

slide-28
SLIDE 28

Specification Languages

Use Case Descriptions Use Case Diagrams – high-level DFDs, part of UML UML (Unified Modelling Language) Object-oriented decomposition Class and Object Diagrams – form of ERDs Interaction Diagrams (Sequence and Communication Diagrams) – forms of event traces State Diagrams – form of FSMs UML has many other types of diagrams (12 diagram types right now?)

U Waterloo SE1 (Winter 2006) – p.28/38

slide-29
SLIDE 29

Specification Languages

SDL (Specification and Description Language) Focus is on precise specification of communication Process-based decomposition Essentially hierarchical data flow diagrams At the lowest level, uses a form of FSMs representing processes Message Sequence Charts (MSCs) – not officially part

  • f SDL, but often used with it (form of event traces)

U Waterloo SE1 (Winter 2006) – p.29/38

slide-30
SLIDE 30

Specification Languages

Algebraic specification (part of SDL) Functions Formal Abstract Temporal Logic Behavioural Formal Abstract

U Waterloo SE1 (Winter 2006) – p.30/38

slide-31
SLIDE 31

Standard Languages

Both UML and SDL are standard languages: UML – Object Management Group (OMG) SDL – ITU (International Telecommunications Union)

U Waterloo SE1 (Winter 2006) – p.31/38

slide-32
SLIDE 32

UML Process

Object-oriented decomposition:

  • 1. Use cases and use case diagram
  • 2. Concept (class) diagram (ERD)
  • 3. State diagram for each class (FSM) – often considered

part of design

  • 4. Sequence diagrams and collaboration diagrams (event

traces)

U Waterloo SE1 (Winter 2006) – p.32/38

slide-33
SLIDE 33

SDL Process

Process-based decomposition:

  • 1. System diagram (DFD) – shows top-level decomposition
  • 2. Block diagrams (hierarchical DFDs)
  • 3. Process diagrams (FSM for lowest level processes)
  • 4. Message sequence charts to illustrate traces (event

traces)

U Waterloo SE1 (Winter 2006) – p.33/38

slide-34
SLIDE 34

SE 1 Process

Here is the recommended process for your project:

  • 1. Context Diagram
  • 2. Use case descriptions and use case diagram
  • 3. System sequence diagrams for each use case
  • 4. User interface
  • 5. Partition into major subsystems – show top-level

decomposition and communication between these subsystems

U Waterloo SE1 (Winter 2006) – p.34/38

slide-35
SLIDE 35

SE 1 Process

  • 1. For each subsystem, show in UML

(a) System state diagram (or major subsystem) (b) Concept (class) diagram (c) For each class, Attributes, Operations Pre/post conditions for each operation, Class-level state diagram for all non-trivial classes (d) Class-level sequence diagram showing how each system sequence diagram is realized through the behaviour of objects

U Waterloo SE1 (Winter 2006) – p.35/38

slide-36
SLIDE 36

SE 1 Process

Along the way collect glossary entries, requirements for traceability matrix. Consistency among diagrams and levels of description is important!

U Waterloo SE1 (Winter 2006) – p.36/38

slide-37
SLIDE 37

Project

For first partial SRS: Purpose, etc. Use case descriptions, use case diagram Context Diagram(s) Complete specification of call processing subsystem User interface specification Glossary, requirements tables (complete for call processing) For final SRS: Fix any problems from past deliverables Complete specification of all parts of the system

U Waterloo SE1 (Winter 2006) – p.37/38

slide-38
SLIDE 38

Summary

What aspects of the system do we need to describe? What are the features of a good specification notation? Basic notations: Event traces Entity-relationship diagrams (ERDs) Data flow diagrams (DFDs) Finite state machines (FSM) Decomposition strategies RE Processes Next Lecture Topic: UML state diagrams (continued over several lectures) Reading: Arlow and Neustadt, Ch.1, 2, 12, 13.2, 21, 22

U Waterloo SE1 (Winter 2006) – p.38/38