1 requirements - 1. 2 software development activities application domain objects subsystems class......

121
1 Requirements - 1

Upload: roland-bishop

Post on 26-Dec-2015

224 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

1

Requirements - 1

Page 2: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

2

Software Development Activities

Application

Domain Objects

SubSystems

class...class...class...

Implementation

Domain Objects

SourceCode

Test Cases

?

Expressed in Terms Of

Structured By

Implemented

ByRealized By Verified By

SystemDesign

ObjectDesign

Implemen-tation

Testing

class....?

RequirementsElicitation

Use CaseModel

RequirementsAnalysis

Page 3: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

3

Types of Projects

• Greenfield Engineering– Development starts from scratch, no prior system

exists, the requirements are extracted from the end users and the client

• Re-engineering– Re-design and/or re-implementation of an existing

system using newer technology

• Interface Engineering– Resign of the user interface of an existing system

Page 4: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

4

Requirements Elicitation

• Challenging activity• Requires collaboration of people with different

backgrounds– User has application domain knowledge– Developer has implementation domain knowledge

• Define the system– Easy to define (and then solve) the wrong problem

Page 5: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

5

Requirements Process

• Requirements Elicitation– Definition of the system in terms understood by

the customer

• Analysis– Technical specification of the system in terms

understood by the developer.

Page 6: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

6

Products of Requirements Process

RequirementsElicitation

analysis model:Model

systemspecification

:Model

Analysis

Page 7: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

7

System Specification vs Requirements Analysis Model

• Both focus on the requirements from the user’s view of the system.

• System specification uses natural language (derived from problem statement)

• Requirements analysis model uses formal or semi-formal notation (e.g., UML)

Page 8: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

8

Types of Requirements

• Functional requirements: Describe the interactions between the system and its environment independent from implementation– The watch system must display the time based on its

location

Page 9: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

9

Types of Requirements

• Nonfunctional requirements: User visible aspects of the system not directly related to functional behavior. – The response time must be less than 1 second– The accuracy must be within a second– The watch must be available 24 hours a day

except from 2:00am-2:01am and 3:00am-3:01am

Page 10: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

10

Types of Requirements

• Constraints (“Pseudo requirements”): Imposed by the client or the environment in which the system will operate– The implementation language must be JAVA. – Must interface to the dispatcher system written in

1956.

Page 11: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

11

Requirements Elicitation Activities

• Identify actors• Identify scenarios• Identify use cases• Identify relationships among use cases• Refine use cases• Identify nonfunctional requirements• Identify participating objects

Page 12: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

12

Actors• What’s an ACTOR?

– An external entity that interact with the system– Can be human or an external system

• How do we identify them?– Which user groups are supported by the system to perform their

work– Which user groups execute the system’s main function?– Which user groups perform secondary function, such as

maintenance and administration?– Will the system interact with any external hardware or software

system?

• The choice of actors helps us to define the system boundary, and the system boundary helps us to identify the actors

Page 13: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

13

Example: SatWatch

SatWatch is a wrist watch that displays the time based on its current location. It uses GPS satellites to determine its location and internal data structures to convert this location into a time zone. Satwatch adjusts the time and date displayed as the watch owner crosses time zones and political boundaries (e.g., standard time vs. daylight savings time)

When a new country or institutes different rules for daylight saving time, the watch owner may upgrade the software of the watch using the WebifyWatch serial devices and a personal computer connected to the Internet. SatWatch complies with the physical electrical, and software interfaces defined by WebifyWatch API2.0.

Page 14: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

14

Tools

Bridging the gap between user and developer …– Scenario:

• Example of the use of the system in terms of a series of interactions between the user and the system

• Concrete / Real / Phenomenon– Use case:

• Abstraction that describes a class of scenarios• Concept

Page 15: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

15

Scenarios

• “A narrative description of what people do and experience as they try to make use of computer systems and applications” [M. Carrol, Scenario-based Design, Wiley, 1995]

• A concrete, focused, informal description of a single feature of the system used by a single actor.

• Scenarios can have many different uses during the software lifecycle

Page 16: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

16

Types of Scenarios

• As-is scenario– Used in describing a current situation. Usually used

during re-engineering. The user describes the system.

• Visionary scenario– Used to describe a future system. Usually described

in greenfield engineering or reengineering. – Often can not be done by the user or developer alone– Can be viewed as an inexpensive prototype

Page 17: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

17

Types of Scenarios

• Evaluation scenario– User tasks against which the system is to be

evaluated

• Training scenario– Step by step instructions designed to guide a

novice user through a system

Page 18: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

18

Heuristics for finding Scenarios• Ask yourself or the client the following questions:

– What are the primary tasks that the system needs to perform?

– What data will the actor create, store, change, remove or add in the system?

– What external changes does the system need to know about?

– What changes or events will the actor of the system need to be informed about?

Page 19: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

19

Heuristics for finding Scenarios

• Insist on task observation if the system already exists (interface engineering or reengineering)– Ask to speak to the end user, not just to the

software contractor– Expect resistance and try to overcome it

Page 20: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

20

Scenario Example: Warehouse on Fire

• Bob is driving down main street in his patrol car and notices smoke coming out of a warehouse. His partner, Alice, reports the emergency from their car.

• Alice reports the address of the building, a brief description of its location (i.e., north west corner), and an emergency level. In addition to a fire unit, she requests several paramedic units on the scene given that area appear to be relatively busy. She confirms her input and waits for an acknowledgment.

Page 21: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

21

Scenario Example: Warehouse on Fire (continued)

• John, the Dispatcher, is alerted to the emergency by a beep of his workstation. He reviews the information submitted by Alice and acknowledges the report. He allocates a fire unit and two paramedic units to the Incident site and sends their estimated arrival time (ETA) to Alice.

• Alice receives the acknowledgment and the ETA.

Page 22: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

22

Observations about Warehouse on Fire Scenario

• Concrete scenario– Describes a single instance of reporting a

fire incident.– Does not describe all possible situations in

which a fire can be reported.

• Participating actors– Bob, Alice and John

Page 23: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

23

Next goal, after the scenarios are formulated:

• Find a use case in the scenario that specifies all possible instances of how to report a fire– Example: “Report Emergency “ in the first paragraph of the

scenario is a candidate for a use case

• Describe this use case in more detail – Describe the entry condition – Describe the flow of events – Describe the exit condition – Describe exceptions– Describe special requirements (constraints, nonfunctional

requirements)

Page 24: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

24

Example of steps in formulating a use case

• First name the use case– Use case name: ReportEmergency

• Then find the actors– Generalize the concrete names (“Bob”) to participating actors

(“Field officer”)– Participating Actors:

• Field Officer (Bob and Alice in the Scenario)• Dispatcher (John in the Scenario)• ?

• Then concentrate on the flow of events– Use informal natural language

Page 25: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

25

Example of steps in formulating a use case

• Formulate the Flow of Events (Figure 4-7):– The FieldOfficer activates the “Report Emergency” function on

her terminal. FRIEND responds by presenting a form to the officer.

– The FieldOfficer fills the form, ... The FieldOfficer also describes possible responses to the emergency situation. Once the form is completed, the FieldOfficer submits the form, …

– The Dispatcher reviews the submitted information and creates an Incident in the database by invoking the OpenIncident use case. The Dispatcher …

– The FieldOfficer receives the acknowledgment and the selected response.

Page 26: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

26

Example of steps in formulating a use case

• Write down the exceptions:– The FieldOfficer is notified immediately if the connection

between her terminal and the central is lost.– The Dispatcher is notified immediately if the connection

between any logged in FieldOfficer and the central is lost.

• Identify and write down any special requirements:– The FieldOfficer’s report is acknowledged within 30

seconds. – The selected response arrives no later than 30 seconds

after it is sent by the Dispatcher.

Page 27: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

27

How to Specify a Use Case (Summary)

• Name of Use Case• Actors

– Description of actors involved in use case

• Entry condition – Use a syntactic phrase such as “This use case starts when…”

• Flow of Events – Free form, informal natural language

• Exit condition – Start with “This use cases terminates when…”

• Exceptions – Describe what happens if things go wrong

• Special Requirements – List nonfunctional requirements and constraints

Page 28: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

28

Use Case Model for Incident Management

ReportEmergency

FieldOfficer DispatcherOpenIncident

AllocateResources

Page 29: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

29

Why use cases work• Utterly comprehensible by the user

– Use cases model a system from the users’ point of view (functional requirements)

• Define every possible event flow through the system• Description of interaction between objects

• Great tools to manage a project. Use cases can form basis for whole development process

– User manual– System design and object design– Implementation– Test specification– Client acceptance test

• An excellent basis for incremental & iterative development

Page 30: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

30

Requirement– 2

Page 31: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

31

Use Case Associations

• Developing a Use Case model involves breaking up use cases in search of simpler ones

• Use case association = relationship between use cases

• Three types supported in UML: – Extends– Include– Generalization (not in text)

Page 32: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

32

Extend• A base use case implicitly includes the

behavior of another use case at one or more extension points

• Generally used to factor out behavior that is optional or occurs only under certain conditions

• E.g. alternate or exceptional cases

Exception case Normal case<<extend>>

Page 33: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

33

<<extend>>

Check Order Status

Cancel Order

<<extend>>

E.g. In the course of checking on the status of an order, the user finds that the item ordered won’t be in stock for 2 months. The user decides to cancel the order.

Page 34: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

34

Include• One use case explicitly includes the behavior

of another use case at a specified point within a course of action

• Useful in factoring out behavior that would otherwise occur in multiple use cases

Base case Included case<<include>>

Page 35: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

35

<<include>>

View account

Login

<<include>>

Place order<<include>>

Page 36: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

36

Generalization• Parent use case defines behavior that the

child use cases can inherit and override• Similar to inheritance in classes

Parent Use Case

Child Use Case

Page 37: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

37

Generalization

Perform Search

Search by Author

Search by Title

Search by Date

Page 38: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

38

How do I find use cases?• Select a narrow vertical slice of the system (i.e. one

scenario) – Discuss it in detail with the user to understand the user’s

preferred style of interaction

• Select a horizontal slice (i.e. many scenarios) to define the scope of the system. – Discuss the scope with the user

• Find out what the user does– Task observation (Good)– Questionnaires (Bad)

• Draw and revise use case diagram– Discuss with the user

Page 39: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

39

From Use Cases to ObjectsTop Level Use Case

Level 2 Use Cases

Level 3 Use Cases

Operations

ParticipatingObjects

Level 2

Level 1

Level 2

Level 3 Level 3

Level 4 Level 4

Level 3

A B

Page 40: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

40

Finding Participating Objects in Use Cases

• Find terms that developers or users need to clarify in order to understand the flow of events

• Identify real world entities that the system needs to keep track of. Examples: FieldOfficer, Dispatcher, Resource

Page 41: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

41

Finding Participating Objects in Use Cases

• Identify real world procedures that the system needs to keep track of. – Example: EmergencyOperationsPlan

• Identify data sources or sinks. – Example: Printer

• Identify interface artifacts. – Example: PoliceStation

• Do textual analysis to find additional objects (Use Abott’s technique)

• Model the flow of events with a sequence diagram

Page 42: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

42

Abbott’s Heuristics

Part of Speech Model Component Example

Proper Noun Object Fred

Common Noun Class Student

Doing Verb Operation Selects

Being Verb Inheritance Is a kind of

Having Verb Aggregation Has

Modal Verb Constraints Must be

Adjective Attribute Full-time

Page 43: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

43

Identifying Nonfunctional Requirements -1

• User interface and human factors– What kind of interface? What’s the level of user expertise?

• Documentation– What level of documentation

• Hardware considerations– Hardware compatibility, interaction with other hardware system

• Performance characteristics– How responsive? How many concurrent users should it

support?

• Error handling and extreme conditions– Which exception should be handled? How? What’s the worst

environment in which the system is expected to perform?

Page 44: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

44

Identifying Nonfunctional Requirements

• Quality issues– How reliable/available/robust?

• System modifications– Anticipated scope of future change? Who will perform

change?

• Physical environment– Where will the system be deployed? Weather condition?

• Security issues– Should the system be protected against external intrusions?

• Resource issues– Constraints on resource

Page 45: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

45

Analysis - (1)

Analysis

Page 46: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

46

Overview of Analysis

• Formalize the specification produced during requirements elicitation

• Developers build a model of the application domain– What are the objects?– What are their attributes?– How do the actors and the system interact?

• Why do we call it ANALYSIS?– Define analysis

Page 47: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

47

Analysis1. A separating or breaking up of any whole into its parts so as

to find out their nature, proportion, function, relationship, etc. Webster’s New World Dictionary

Page 48: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

48

Products of requirements elicitation and analysis

SystemDesign

system model:Model

systemspecification

:Model

analysis model:Model

RequirementsElicitation

Analysis

Page 49: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

49

The Analysis Model

analysismodel:Model

dynamicmodel:Model

objectmodel:Model

functionalmodel:Model

use casediagram:View

classdiagram:View

statechartdiagram:View

sequencediagram:View

Page 50: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

50

UML: Class and Instance Diagrams

Inspector

joe:Inspector

mary:Inspector

anonymous:Inspector

Class Diagram

Instance Diagram

Page 51: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

51

Analysis Concepts

• Types of objects modeled in analysis– Entity– Boundary– Control

• Associations used in analysis model– Multiplicity– Aggregation

• Generalization

Page 52: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

52

Analysis Objects

• Entity– Persistent information tracked by the system– Correspond to the nouns in the uses cases– E.g. Book

• Boundary– An object with which the actor of a use case interacts with

the system (e.g., form)

• Control– Represent the tasks performed by the user and supported

by the system– E.g. Display (verb)

Page 53: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

53

Analysis Objects

• Why the three types?– Results in smaller and more specialized objects– Leads to models that are more resilient to change

• Interface most likely to change– Will help with sequence diagrams– Control objects serve as “connecting tissue”

between users and stored data

• Object types originated in Smalltalk:– Model, View, Controller (MV)

Page 54: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

54

Example: 2BWatch Objects

<<entity>>Year

<<entity>>Month

<<entity>>Day

<<control>>ChangeDateControl

<<boundary>>LCDDisplayBoundary

<<boundary>>ButtonBoundary

• UML provides the stereotype mechanism to present new modeling elements– stereotype is a string enclosed by angle brackets, which is attached to a UML

element, such as a class or an association – It enables modelers to create new kinds of building blocks that are needed in their

domain

• Use naming convention: suffix “Control”, “Boundary”

Page 55: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

55

1-to-1 and 1-to-many Associations

Has-capital

One-to-one association

One-to-many association

City

name:String

Workorder

schedule()

StickyNote

x: Integery: Integerz: Integer

*

Country

name:String

Page 56: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

56

Object Instance Diagram

Example for 1-to-many

:Sticky

x,y,z=(-1,0,5)

:WorkOrder :Sticky

x,y,z=(1,10,1)

:Sticky

x,y,z=(10,1,2)

Page 57: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

57

Many-to-Many Associations

Work on **Mechanics Plane

Page 58: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

58

Aggregation

• Models "part of" hierarchy• Useful for modeling the breakdown of a product

into its component parts• UML notation: uses a small diamond to indicate the

assembly end of the relationship.

Page 59: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

59

weight

Automobile

serial numberyearmanufacturermodelcolor

drivepurchase

AggregationEngine

horsepowervolume

onoff

3,4,5

Wheel

diameternumber of bolts

2,4

Door

openclose

Battery

ampsvolts

chargedischarge

1

Brakelight

onoff

* 1

Page 60: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

60

Inheritance• Models "kind of" hierarchy• Powerful notation for sharing similarities among classes

while preserving their differences• UML Notation: An arrow with a triangle

Cell

MuscleCellBloodCell NerveCell

StriateSmoothRed White PyramidalCortical

Page 61: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

61

Aggregation vs Inheritance

• Both associations describe trees (hierarchies)– Aggregation tree describes a-part-of relationships

Inheritance tree describes "kind-of" relationships

• Aggregation relates instances (involves two or more different objects)

• Inheritance relates classes (a way to structure the description of a single object)

Page 62: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

62

Directory

FileSystemElement

File

1

*

A Directory can contain any number of FileSystemElements (a FileSystemElement is either a File or a Directory). A given FileSystemElement, however, is part of exactly one Directory.

Example: Hierarchical File System

Page 63: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

63

Example: Nonhierarchical file system

Directory

FileSystemElement

File

*

*

A Directory can contain any number of FileSystemElements (a FileSystemElement is either a File or a Directory). A given FileSystemElement can be part of many Directory (ies).

Page 64: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

64

Analysis Activities

• Identifying entity objects• Identifying boundary objects• Identifying control objects• Mapping use cases to objects• Identifying associations among objects• Identifying object attributes• Modeling nontrivial behavior with statecharts• Modeling generalization relationships• Reviewing the analysis model

Page 65: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

65

Identifying Boundary Objects

• System interfaces with actors• Collect information from the actor and

translate it into a form that can be used by other objects in the system

• Use a coarse level– Allows the interface to change without having to

change the analysis model

Page 66: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

66

Heuristics for identifying boundary objects

• Identify data entry forms/windows (e.g.

EmergencyReportForm, ReportEmergencyButton)• Identify messages system sends to user (e.g.,

AcknowledgementNotice)• Do not model visual aspects of the system –

use mock-ups or prototypes• Use the user’s terms as opposed to

implementation terms

Page 67: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

67

Identifying Control Objects

• Coordinate between boundary and entity objects

• Usually do not have a real world counterpart• Relate closely to use case• Responsible for collecting information from

boundary objects and relaying it to entity objects

Page 68: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

68

Heuristics for identifying control objects

• Identify a small number of control objects per use case. Each flow of events should have a control object.

• Identify a control object for each actor• A control object should exist for only one use

case. (Its lifespan should be just one use case.)

Page 69: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

69

Example: Login to Internet Bookstore

• Actor: Customer• Use case - flow of events

– The customer clicks the login button on the home page.

– The system displays the login page.– The customer enters his/her user ID and password

and clicks the OK button.– The system validates the login information against

the accounts data.– The system returns the customer to the home

page.

Page 70: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

70

Example: Login to Internet Bookstore

• Entity objects– Customer– Account

• Boundary Objects– Home page– Login page– Buttons?

• Control Objects– Display

Page 71: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

71

Object Modeling• Main goal: Find the important abstractions• Steps during object modeling

– 1. Class identification– 2. Find the attributes– 3. Find the methods– 4. Find the associations between classes

• Order of steps– Goal: get the desired abstractions– Order of steps secondary, only a heuristic– Iteration is important

Page 72: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

72

How do you find classes?• Learn about problem domain: Observe your client• Apply general world knowledge and intuition• Take the flow of events and find participating

objects in use cases– Do a textual analysis of scenario or flow of events

(Abbott Textual Analysis, 1983)– Nouns are good candidates for classes

• Apply design patterns (later)• Try to establish a taxonomy

Page 73: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

73

Example: Scenario from Problem Statement

• Jim Smith enters a store with the intention of buying a toy for his 3 year old child.

• The store owner gives advice to the customer. The advice depends on the age range of the child and the attributes of the toy.

• Jim selects a dangerous toy which is unsuitable for the child.

• The store owner recommends a safer doll. • Note: Help must be available within less than one

minute.

Page 74: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

74

Abbot’s Heuristics Part of speech Model component Example

Proper noun object Jim Smith

Improper noun class Toy, doll

Doing verb method Buy, recommend

being verb inheritance is-a (kind-of)

having verb aggregation has an

modal verb constraint must be

adjective attribute 3 years old

transitive verb method enter

intransitive verb method (event) depends on

Page 75: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

75

Object Modeling in Practice: Class Identification

Foo

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Class Identification: Name of Class, Attributes and Methods

Page 76: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

76

Object Modeling in Practice: Encourage Brainstorming

Foo

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Account

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Naming is important!

Money

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Page 77: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

77

Object Modeling in PracticeAccount

Balance

Deposit()Withdraw()GetBalance()

Customer

Name

Find New Objects

Iterate on Names, Attributes and Methods

Bank

Name

AccountId

CustomerId

Page 78: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

78

Associations

• Class diagrams describe spatial connectivity of objects

• Can include associations to show relationships

• Properties of associations– name: e.g. has, reports to, contains– role of each class– multiplicity

Page 79: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

79

Roles

• A role name is the name that uniquely identifies one end of an association.

• A role name is written next to the association line near the class that plays the role.

• When do you use role names?– Necessary for associations between two objects of the same

class– Also useful to distinguish between two associations between

the same pair of classes

• When do you not use role names?– If there is only a single association between a pair of distinct

classes, the names of the classes serve as good role names

Page 80: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

80

Example of Role

Problem Statement : A person assumes the role of repairer with respect to another person, who assumes the role of inspector with respect to the first person.

PersonCreates Workorders

inspector

repairpersonCreates Workorders

Person Person

Person

Page 81: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

81

Qualification

With qualification: A directory has many files, each with a unique name

Without qualification: A directory has many files. A file belongs only to one directory.

Directory Filefilename

DirectoryFile

filename

1 *

0..11

•The qualifier improves the information about the multiplicity of theassociation between the classes. •It is used for reducing 1-to-many multiplicity to 1-1 multiplicity

Page 82: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

82

Example

Problem Statement : A stock exchange lists many companies. However, a stock exchange lists only one company with a given ticker symbol. A company may be listed on many stock exchanges, possibly with different ticker symbols. Find company with ticker symbol AAPL.

StockExchangeCompany

tickerSym

* *lists

Page 83: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

83

Use of Qualification reduces multiplicity

StockExchange CompanytickerSym 0..11

StockExchangeCompany

tickerSym

* *

Page 84: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

84

Object Modeling in PracticeAccount

BalanceAccountId

Deposit()Withdraw()GetBalance()

Customer

NameCustomerId

Bank

Name

Find New Objects

Iterate on Names, Attributes and Methods

Find Associations between Objects

Has

Label the associations

Determine the multiplicity of the associations

*

Page 85: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

85

Object Modeling in Practice: Categorize!

SavingsAccount

Withdraw()

CheckingAccount

Withdraw()

MortgageAccount

Withdraw()

Customer

Name

CustomerId

Account

BalanceAccountId

Deposit()Withdraw()GetBalance()

Bank

Name Has**

Page 86: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

86

Object Modeling in Practice: Heuristics

• Explicitly schedule meetings for object identification • Try to differentiate between entity, boundary and

control objects• Find associations and their multiplicity

– Unusual multiplicities usually lead to new objects or categories

• Identify Aggregation • Identify Inheritance: Look for a Taxonomy,

Categorize

• Allow time for brainstorming - Iterate, iterate, iterate

Page 87: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

87

Analysis – (2)

Analysis

Page 88: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

88

The Analysis Model

analysismodel:Model

dynamicmodel:Model

objectmodel:Model

functionalmodel:Model

use casediagram:View

classdiagram:View

statechartdiagram:View

sequencediagram:View

Page 89: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

89

Analysis Activities

• Identifying entity objects• Identifying boundary objects• Identifying control objects• Mapping use cases to objects• Identifying associations among objects• Identifying object attributes• Modeling nontrivial behavior with statecharts• Modeling generalization relationships• Reviewing the analysis model

Page 90: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

Reviewmodel

Consolidatemodel

Defineentity

Defineboundary

Definecontrol

Defineinteractions

Defineassociations

Defineattributes

Definenontrivialbehavior

Defineparticipating

Defineuse cases

objects

objects objectsobjects

Analysis activities

(UML activities diagram).

Page 91: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

91

Modeling Interactions Between Objects

• Sequence diagrams tie use cases and objects together

• Objects that participate in use case form columns– Vertical dashed line is called the lifeline

• Time progresses from top to bottom• Horizontal arrows represent messages sent

from one object to another• Rectangles represent the activation of an

operation

Page 92: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

92

Example Sequence Diagram

FieldOfficer Report

EmergencyButton ReportEmergencyControl ReportEmergency

Form Emergency

Report Manage

EmergencyControl

press()

create()create()

submit()

fillContents()

submitReport()create()

submitReportToDispatcher()

Page 93: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

93

Heuristics for drawing sequence diagrams

• Actor who initiates – on the left• Next - the boundary object that the actor uses to

initiate• Next – the first use case control object • Boundary objects are created by control objects• Entity objects are accessed by control objects and

boundary objects• Entity objects should NOT access boundary or

control objects (WHY?)

Page 94: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

94

Example: Login to Internet Bookstore

• Actor: Customer• Use case - flow of events

– The customer clicks the login button on the home page.

– The system displays the login page.– The customer enters his/her user ID and password

and clicks the OK button.– The system validates the login information against

the account’s data.– The system returns the customer to the home

page.

Page 95: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

95

Example: Login to Internet Bookstore

• Entity objects– Customer?– Account

• Boundary Objects– Home page– Login page– Buttons?

• Control Objects– Display

Page 96: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

96

Login Sequence Diagram

• Initiating actor?• Boundary object that actor uses in initiation?• Control object?• Messages?• Use Together to generate

– Follow heuristics

Page 97: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

97

Why Use Sequence Diagrams?

• Model the order of interactions of objects– Side effect: May result in rewriting the flow of

control for a use case in more precise terms

• Distribute the behavior of the use case among the objects (design)– Forces us to start thinking about the methods of

an object

• Identify missing behavior– acts as a check

• Forces us to focus and think more critically

Page 98: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

98

Is it worth the effort?

• Time consuming• Difficult• May not want to do for simple parts of system

– Although we learn from doing simple parts

• There are other tools that are used to allocate behavior– e.g. CRC cards

Page 99: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

99

Collaboration Diagrams

• Sequence diagrams and collaboration diagrams belong to the general class of interaction diagrams

• Capture the same content– Can be converted automatically to the other style

• Collaboration diagram is more free-form– Does not emphasize time ordering

• Convert sequence diagram to collaboration in Together.

Page 100: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

100

Statechart Diagrams

• Graph whose nodes are states and whose directed arcs are transitions labeled by event names.

• A statechart diagram relates events and states for one class– An object model with a set of objects has a set of

state diagrams

Page 101: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

101

State• An abstraction of the attribute of a class

– State is the aggregation of several attributes of a class

• Basically an equivalence class of all those attribute values and links that do no need to be distinguished as far as the control structure of the system is concerned – Example: State of a bank

• A bank is either solvent or insolvent

• State has duration

Page 102: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

102

UML Statechart Diagram Notation

State2State1 Event1(attr) [condition]/action

entry /action

exit/action

• A UML statechart diagram can be mapped into a finite state machine

do/Activity

Event triggerWith parameters

Guardcondition

Page 103: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

103

UML statechart for Incident.

numAllocatedResource == 0

all reports

when incident.date > 1yr.

are submitted

Active Inactive Closed Archived

Page 104: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

104

MeasureTime SetTime

pressButtonsLAndR

pressButtonsLAndR/beep

after 2 min.

DeadBattery

after 20 yearsafter 20 years

Statechart diagram for 2Bwatch

Page 105: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

Reviewmodel

Consolidatemodel

Defineentity

Defineboundary

Definecontrol

Defineinteractions

Defineassociations

Defineattributes

Definenontrivialbehavior

Defineparticipating

Defineuse cases

objects

objects objectsobjects

Analysis activities

(UML activities diagram).

Page 106: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

106

Reviewing the Analysis Model

• Analysis model built incrementally and iteratively– omission discovered during analysis may lead to

new use case– E.g. What happens to student applications after

students have been selected for a term? Do we need an archive or purge applications use case?

• Reviews conducted to ensure that the necessary attributes are met

• Text lists a number of questions to ask…

Page 107: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

107

Model Correct?

• Is the glossary of entity objects understandable by the user?

• Do abstract classes correspond to user-level concepts?

• Are all descriptions in accordance with users’ definitions?

• Do all use cases and control objects have meaningful verb phrases as names?

• Etc.

Page 108: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

108

Model Consistent?

• Are there multiple classes or use cases with the same name?

• Do entities (e.g. use cases, classes, attributes) with similar names denote similar phenomena?

• Are all entities described at the same level of detail?

Page 109: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

109

Model Realistic?

• Are there any novel features of the system? Were any studies or prototypes built to ensure their feasibility?

• Can the performance and reliability be met?• Etc.

Page 110: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

110

Managing Analysis

• Documenting• Assigning Responsibilities• Communicating• Client Sign-off

Page 111: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

111

1. Introduction2. Current system3. Proposed system

3.1 Overview3.2 Functional requirements3.3 Nonfunctional requirements3.4 Constraints (“Pseudo requirements”) 3.5 System models

3.5.1 Scenarios3.5.2 Use case model3.5.3 Object model 3.5.3.1 Data dictionary 3.5.3.2 Class diagrams3.5.4 Dynamic models3.5.5 User interfae

4. Glossary

Requirements Analysis Document Template

Page 112: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

112

Documenting Analysis

• RAD documents both requirements elicitation and analysis activities

• Many sections written during requirements elicitation

• Those sections are reviewed and revised• New sections are added

– Object models– Dynamic models– User interface: screen mockups, forms

Page 113: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

113

Object Models

• Document the domain objects identified– Attributes

• As complete as possible• No data types needed

– Operations • From sequence diagrams• List may be incomplete• No logic

– Class diagrams showing relationships – Data Dictionary with text descriptions

Page 114: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

114

Dynamic Models

• Statechart diagrams for complex behavior of objects

• Sequence diagrams for use cases– Although they contain redundant information (have

textual flow of events with use cases) useful because they are more precise and will help the designers understand the system

Page 115: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

115

Assigning Responsibilities

• Analysis involves many individuals– User and client– Analyst, architect, document editor, configuration

manager, reviewer

• Challenging to coordinate and communicate• Assign types of roles:

– Generation of information– Integration– Review

Page 116: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

116

User and Client

• User– Domain expert– Generates information about the current system

and about the tasks that the future system should support

– Corresponds to one or more actors• Helps identify their use cases

• Client– Integration of user requests– Defines the scope of the system based on

(sometimes conflicting) user requirements

Page 117: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

117

Analyst and Architect

• Analyst– Development domain expert– Models current system– Generates information about the future system

• Architect– Integrates the use case and object models – Ensures consistency and completeness– Develops system philosophy

Page 118: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

118

Editor, Reviewer, Configuration Manager

• Editor– Integration of document– Format of document

• Reviewer– Validates document against requirements qualities

• Configuration Manager– Maintains revision history– Coordinates traceability with other documents

Page 119: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

119

Communicating

• Challenges– Different backgrounds– Different expectations– Passing information to new teams– Evolving system

• Guidelines– Define clear territories– Define clear objectives and success criteria– Brainstorm

Page 120: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

120

Client Sign-off

• Acceptance of the analysis model (RAD) by client

• Also client and developer must agree on:– Priorities– Criteria by which to accept or reject system– Schedule– Budget– Revision process

Page 121: 1 Requirements - 1. 2 Software Development Activities Application Domain Objects SubSystems class... Implementat ion Domain Objects Source Code Test Cases

Report problemor

Design changeand

change request estimate impact

Updaterequirements

Updatedesign

Update code (if applicable)

Designtest

Execute allrelevant tests

Archiverequest

[change approved]

Review proposedchange

Review actualchange

Client Developer

Example of a

revision process