of 68
8/16/2019 3. Scenarios and Use Cases.pptx
1/68
Scenarios and Use CasesDr Kristin Stock
8/16/2019 3. Scenarios and Use Cases.pptx
2/68
1. Object Oriented Systems Analysis, Modelling
and Design
2. UML
. Use Case Diagrams
!. Ad"anced Use Case Diagram #eat$res
%. Describing Use Cases
&. Additional 'ools
(. Case st$dy) COM*ASS scenarios and $se cases
O$tline
8/16/2019 3. Scenarios and Use Cases.pptx
3/68
1. Object Oriented Analysis,Modelling and Design
8/16/2019 3. Scenarios and Use Cases.pptx
4/68
SDLC) Met+odologies
∗ Met+odology) a ormali-ed aroac+ toimlementing t+e SDLC
∗ Categories∗ /y area o oc$s
∗ *rocess oriented
∗ Data centered
∗ Object0oriented∗ /y se$encing and em+asis o +ases)
∗ Str$ct$red
∗ aid action de"eloment
∗
Agile de"eloment
8/16/2019 3. Scenarios and Use Cases.pptx
5/68
Object0OrientedSystems Analysis 3 Design
∗ Mod$lar 4 5e $se mod$les kno5n as objects
t+at encas$late bot+ data and rocess∗ 6e decomose roblems into objects t+at
combine bot+
8/16/2019 3. Scenarios and Use Cases.pptx
6/68
∗ Use0cases are t+e core o t+e met+odology
∗ How the user interacts with the systemto perform some activity.
∗ 7n+erently simle beca$se only one rocessat a time.
OOAD is Use0case Dri"en
8/16/2019 3. Scenarios and Use Cases.pptx
7/68
∗ #$nctional 4 +o5 t+e system
be+a"es rom t+e ersecti"e ot+e $ser
∗ Str$ct$ral 0 t+e objects t+e system$ses
∗ /e+a"io$ral 4 8o5 t+e objects
OOAD $ses 9ie5s
oad
oad #ootat+
ail5ay
8/16/2019 3. Scenarios and Use Cases.pptx
8/68
OOAD is 7terati"e and
7ncremental
#$nctional
Str$ct$ral
/e+a"io$ral
:rad$al re;nement o models
rom all t+ree "ie5s
8/16/2019 3. Scenarios and Use Cases.pptx
9/68
∗ Classes
∗ Objects
∗ Met+ods
∗ Messages
∗
8/16/2019 3. Scenarios and Use Cases.pptx
10/68
Classes and Objects
∗ Object =instance>)instantiation o a class
∗ eresentation o a real5orld object
∗ Attrib$tes) inormation t+atdescribes t+e class
∗ /e+a"io$rs) t+ings t+eobject does
∗ State) "al$es at a oint intime
oad
nameseed limit5idt+s$race
5iden
c+ange s$racec+ange seed limitoenclose
8/16/2019 3. Scenarios and Use Cases.pptx
11/68
Met+ods 3 Messages
∗ Met+ods) imlement t+e
be+a"io$r o a class
∗ Messages) inormationsent to an object to triggera met+od =roced$re call>
oad
nameseed limit5idt+s$race
5iden
c+ange s$racec+ange seed limitoenclose
8/16/2019 3. Scenarios and Use Cases.pptx
12/68
8/16/2019 3. Scenarios and Use Cases.pptx
13/68
7n+eritance
∗ 7n+eritance∗
:eneral classes are created=s$erclasses>
∗ S$bclasses can in+erit dataand met+ods rom a
s$erclass∗ Abstract classes are not
instantiated.
oad
nameseed limit5idt+s$race
5idenc+ange s$racec+ange seed limitoenclose
8/16/2019 3. Scenarios and Use Cases.pptx
14/68
8/16/2019 3. Scenarios and Use Cases.pptx
15/68
*olymor+ism 3 dynamic binding
∗ *olymor+ism) t+e samemessage can +a"e di?erent
meanings∗ Dynamic binding) tye o
object is not determined$ntil r$n0time
∗
Contrast 5it+ staticbinding) tye o objectdetermined at comile time
8/16/2019 3. Scenarios and Use Cases.pptx
16/68
2. Uni;ed Modelling Lang$ageUML
8/16/2019 3. Scenarios and Use Cases.pptx
17/68
'+e Uni;ed *rocess
∗ A seci;c SDLC met+odology.
∗ A t5o0dimensional rocess consisting o +asesand 5ork@o5s
∗ *+ases are time eriods in de"eloment
∗ 6ork@o5s are t+e tasks t+at occ$r in eac+ +ase
∗ Acti"ities in bot+ +ases 3 5ork@o5s 5ill o"erla
8/16/2019 3. Scenarios and Use Cases.pptx
18/68
'+e Uni;ed *rocess
8/16/2019 3. Scenarios and Use Cases.pptx
19/68
Uni;ed *rocess *+ases
∗ 7ncetion =similar to *lanning *+ase>∗ #easibility analyses erormed
∗ 6ork@o5s "ary b$t oc$s is on b$siness modeling 3re$irements gat+ering
∗
∗ 'ransition00#oc$s on testing 3 deloyment
8/16/2019 3. Scenarios and Use Cases.pptx
20/68
Uni;ed Modeling Lang$age
∗ *ro"ides a common "ocab$lary o object0
oriented terms and diagramming tec+ni$es∗ UML is not t+e only modelling
lang$agenotation =@o5 diagrams, data @o5diagrams, , b$t is no5 t+e
most o$lar.∗ Models are logicalB i.e., indeendent o +o5
t+ey are imlemented =man$al orcom$teri-ed>.
8/16/2019 3. Scenarios and Use Cases.pptx
21/68
OOAD 9ie5s
#$nctional
Str$ct$ral
/e+a"io$ral
:rad$al re;nement o models
rom all t+ree "ie5s
8o5 t+eobjectsinteract
'+eobjectst+esystem$ses
8o5 t+esystembe+a"es rom
t+eersecti"eo t+e $ser
8/16/2019 3. Scenarios and Use Cases.pptx
22/68
UML Diagrams
eresent t+edata and staticrelations+is inan inormationsystem
Deict t+edynamicrelations+isamong t+einstances orobjects t+atreresent t+eb$sinessinormationsystem
8/16/2019 3. Scenarios and Use Cases.pptx
23/68
. Use Case Diagrams
8/16/2019 3. Scenarios and Use Cases.pptx
24/68
What are Use Case Diagrams?
∗ '+e ;rst ste in t$rning t+e re$irements into
$nctional models.∗ Model +o5 a $ser interacts 5it+ a system to
erorm an acti"ity.
∗ 9ery +ig+ le"el 4 no details on rocess, str$ct$re,
etc.
8/16/2019 3. Scenarios and Use Cases.pptx
25/68
Example Use-Case
Library Book Collection
Management SystemUse Case Diagram
8/16/2019 3. Scenarios and Use Cases.pptx
26/68
Elements of Use-Case Diagrams
∗ Actors) $sers or ot+er interacting systems
∗
Associations) lines to connect actors and $se0cases
∗ 7nteractions, incl$sions, etensions orgenerali-ations
∗ Use0case) a major rocess in t+e system
t+at gi"es a bene;t to t+e $sers∗ S$bject bo$ndary) a named bo t+at deicts t+e
scoe o t+e system
∗ An association relations+i) links an actor 5it+ t+e
8/16/2019 3. Scenarios and Use Cases.pptx
27/68
!entifying Ma"or Use-Cases
∗ e"ie5 t+e re$irements de;nition
∗ 7dentiy t+e s$bjects bo$ndaries
∗ 7dentiy t+e rimary actors and t+eir goals
∗ 7dentiy t+e b$siness rocesses and major $se0
cases∗ Care$lly re"ie5 t+e c$rrent set o $se0cases
∗ Slit or combine some to create t+e rig+t si-e
∗ 7dentiy additional $se0cases
8/16/2019 3. Scenarios and Use Cases.pptx
28/68
∗ A story abo$t an eamle $ser and $se o t+esystem.
∗9ery $se$l or +eling yo$ t+ink abo$t $secases.
Mrs Smit+ likes to +a"e +er car ser"iced once a year ore"ery 1E,EEE kms, 5+ic+e"er is sooner, and is "eryconcerned t+at s+e not lea"e it too long. S+e 5o$ld
like to be reminded o t+e need or t+e ser"ice, b$tdoes not $se any tec+nology ot+er t+an a basic mobile+oneF..
∗ /ridge t+e ga bet5een re$irements and $secases.
Scenarios
8/16/2019 3. Scenarios and Use Cases.pptx
29/68
∗ oles t+at interact 5it+ t+e 7' system
∗ 7ncl$ding eternal systems∗ '+ose 5+o only recei"e rom t+e system are
also actors
∗ 'ime can also be an actor
∗ 'riggering timed rocesses∗ '+e role $sing t+e system is t+e actor
∗ e.g. 7 a c$stomer ser"ice re =CS> acts onbe+al o t+e c$stomer t+en GCS is t+e actor,
not GC$stomer
Actors
8/16/2019 3. Scenarios and Use Cases.pptx
30/68
∗ A role ma is a $se case diagram t+at s+o5s only
actors∗ Central diagram to deict $sers across t+e 5+ole model
∗ Can $se generali-ation to s+o5 o"erlaing roles
∗ May artially o"erla
∗ One role may comletely encomass anot+er
∗ *artial o"erlas can be eressed $sing abstractions
∗ Can simliy $se case diagrams by red$cing t+en$mber o associations
1%H.22% Systems Analysis and Design 2E1! E
ole Mas and :enerali-ations
8/16/2019 3. Scenarios and Use Cases.pptx
31/68
Actor :enerali-ation
Acco$ntingSta?
/ookkeeer
Acco$ntant
C$stomerSer"ice e
Overlapping role(abstraction)
C$stomerSer"ice
Manager
encompasses therole above
Specialized roles
concrete role
8/16/2019 3. Scenarios and Use Cases.pptx
32/68
∗ Collections o $se cases and t+e diagrams t+at
describe t+em∗ :ro$ related $se cases into a older
∗ Co$ld gro$ by main actor
∗ Or gro$ by b$siness $se case
∗ Or gro$ $sing anot+er aroac+∗ Iame a ackage 5it+ a no$n +rase related to
its $se case contents
Use Case *ackages
8/16/2019 3. Scenarios and Use Cases.pptx
33/68
Use Case Diagram 5it+ *ackages
C$stomerSer"ice e
CSManager
JActor9
8/16/2019 3. Scenarios and Use Cases.pptx
34/68
∗ Io r$les
∗ acobsen recommends abo$t 2E or a 1E erson0yearroject
∗ #o5ler reorts abo$t 1EE or a similar si-ed roject
∗ elate $se cases to release lan
∗
oll o$t at least one $se case =or $se casescenario> in eac+ release
∗ elease re$ency may imact on $se case si-eand n$mber
8o5 Many Use Cases in a*rojectN
8/16/2019 3. Scenarios and Use Cases.pptx
35/68
∗ Concets rom t+e $se cases become classes in t+estr$ct$ral model
Key /$siness Classes
*eaceCommittee
Case *ayment
*eace CommitteeMember
*eace:at+ering
resolved through
generateshandles
8/16/2019 3. Scenarios and Use Cases.pptx
36/68
!. Ad"anced Use CaseDiagram #eat$res
8/16/2019 3. Scenarios and Use Cases.pptx
37/68
∗ 7ncrease re$se in t+e $se case model
∗ Certain identical stes may aear in more t+anone case
∗
8/16/2019 3. Scenarios and Use Cases.pptx
38/68
∗ A stereotype is an etension o a UML
eat$re∗ o$ can add yo$r o5n
∗ A stereotye name aears in guillemets
∗ J'+ese are g$illemets
∗
One contet in 5+ic+ 5e mig+t $se t+is is tode;ne an actor t+at is not s+o5n as a stick;g$re
∗ Can be $sed to di?erentiate system actorsrom +$man actors
Stereotyes and Actors
JActorMessaging System
8/16/2019 3. Scenarios and Use Cases.pptx
39/68
#elations in Use Case Diagrams
∗ An incl$de relations+i) eresents t+e
incl$sion o t+e $nctionality o one $se case5it+in anot+er
∗ An etend relations+i) eresents t+e
etension o t+e $se case to incl$de otionalbe+a"ior.
∗ A generali-ation relations+i) eresents a
seciali-ed $se case to a more generali-ed one.
8/16/2019 3. Scenarios and Use Cases.pptx
40/68
Gincl$de Use Cases
Makeeser"atio
n
Change
Reservation
Agent
C+eckA"ailable
Seats
Jincl$de
Jincl$de
base use case
Included / inclusion use case
8/16/2019 3. Scenarios and Use Cases.pptx
41/68
∗ 6+ere 5e add re$irements to an eisting $se case withoutchanging the original use case
∗ Original $se case is stand0alone
∗
8/16/2019 3. Scenarios and Use Cases.pptx
42/68
Getend Use Case Diagram
Make 1st classreser"ation
Agent
Make
eser"ation
Jetend
extension points
Set seat class
Condition) assenger re$ested 1st classP
8/16/2019 3. Scenarios and Use Cases.pptx
43/68
∗ Can be abstract or concrete
∗ An actor co$ld $se a concrete generali-ed $se case∗ *ool common eat$res rom concrete seciali-ed
$se cases
∗ e.g. b$siness rocess s$c+ as credit card "alidation
∗ O"erride or etend asects o t+e $se case∗ Di?erent cards may re$ire di?erent +andling b$t
t+e rocess is m$c+ t+e same
:enerali-ed Use cases
8/16/2019 3. Scenarios and Use Cases.pptx
44/68
:enerali-ed Use Case
8/16/2019 3. Scenarios and Use Cases.pptx
45/68
+tt).orro.comndk
8/16/2019 3. Scenarios and Use Cases.pptx
46/68
%. Describing Use Cases
8/16/2019 3. Scenarios and Use Cases.pptx
47/68
∗ System $se cases are tyically described
5it+ tet∗ '+ey may also otionally be described $sing
∗ Acti"ity diagrams
∗ Decision tables
∗ Decision trees∗ Ot+er artiacts
Describing System Use Cases
8/16/2019 3. Scenarios and Use Cases.pptx
48/68
∗ 7ncororate best ractice
∗7nstit$tionali-e ractice 5it+in an organi-ation
∗ Can be c$stomi-ed to 5ork 5it+in a gi"en organi-ation
∗ Simle narrati"e to cat$re 5ork@o5s
∗ /asic @o5
∗ Q
∗ Alternati"e s$ccess @o5s
∗ Q
∗ @o5s
Use Case Descrition 'emlates
8/16/2019 3. Scenarios and Use Cases.pptx
49/68
∗ Iame, *ersecti"e, 'ye
∗ /rie descrition =one aragra+>
∗ $les o recedence =triggers, re0conditions>
∗ *ost conditions∗
∗ Contet diagram
∗ #lo5 o e"ents
∗ /asic @o5
∗ Alternate @o5s
∗
8/16/2019 3. Scenarios and Use Cases.pptx
50/68
∗ Secial re$irements =non0$nctional constraints>
∗
elated materials =links>∗ Acti"ity diagram
∗ User interace
∗ Class diagram
∗ Ass$mtions
∗ 7normation items
∗ *romts and messages
∗ /$siness r$les
∗
8/16/2019 3. Scenarios and Use Cases.pptx
51/68
∗ '+e Gideal alication o t+e $se case
∗ 'ell a story 4 $sers narrati"e o interaction
∗ Simle s$bject0"erb0object sentences
∗ Consistent tense =resent or $t$re>
∗
8/16/2019 3. Scenarios and Use Cases.pptx
52/68
∗ e"ie5 Case eort =artial>
∗ '+e System dislays a list o resol"ed cases t+at +a"e notbeen re"ie5ed
∗ '+e $ser selects a case
∗ '+e system "alidates t+at a case is ayable
∗ '+e system determines t+e ayment amo$nt
∗ '+e system marks t+e case as ayable
∗
'+e system records t+e ayment amo$nt∗ '+e system c+ecks t+e Cas+ $nd records to ens$re t+at
ade$ate $nds eist
∗ '+e system records t+e act t+at t+e case +as been re"ie5ed
∗ F
/asic #lo5
8/16/2019 3. Scenarios and Use Cases.pptx
53/68
∗ Scenarios not co"ered in t+e basic @o5 t+at still
reali-e a $ser goal∗ eco"erable errors otional or alternati"e
acti"ities
∗ Otions =e.g. Gsame day deli"ery>
∗
'ools =e.g. Gsell c+eck>∗ System state =e.g. Gitem o$t o stock>
∗ Data entry errors re"isions =e.g. G$nds too lo5 ort+at 5it+dra5al amo$nt>
Doc$menting Alternate #lo5s
8/16/2019 3. Scenarios and Use Cases.pptx
54/68
∗ #or eac+ alternate @o5, yo$ need to identiy)
∗ 'rigger∗ 6+at e"ent or decision ca$ses t+e alternate @o5
∗ Di"ergence oint
∗ 6+ere it occ$rs in t+e basic @o5
∗ Con"ergence oint∗ 6+ere it ret$rns to t+e basic @o5
Alternate #lo5 7ss$es
D i < i
8/16/2019 3. Scenarios and Use Cases.pptx
55/68
∗
8/16/2019 3. Scenarios and Use Cases.pptx
56/68
&. Additional 'ools
8/16/2019 3. Scenarios and Use Cases.pptx
57/68
∗ Describe t+e system resonses to a n$mber
o interrelated actors∗ Iot needed i actors can be e"al$ated
searately
∗ 'able lists all ossible sit$ations and +o5 t+e
system treats t+em∗ Acco$nts or all ossible combinations o
actors
∗ Can be $sed to create test cases
Decision 'ables
8/16/2019 3. Scenarios and Use Cases.pptx
58/68
∗ Lie ins$rance actors
Decision 'able
8/16/2019 3. Scenarios and Use Cases.pptx
59/68
∗ Alternati"e to a decision table
∗ Using a tree diagram rat+er t+an a table
Decision 'rees
8/16/2019 3. Scenarios and Use Cases.pptx
60/68
∗ 7 conditions can be e"al$ated one by one
rat+er t+an in combination, $se aconditionresonse table
Conditionesonse 'able
Condition Response
Under minim$m Io ta ayable
Minim$m 0 1H,EEE 'a bracket A1H,EEE.E1 0 &E,EEE 'a bracket /
&E,EEE.E1 0 %EE,EEE 'a bracket C
O"er %EE,EEE 'a bracket D
8/16/2019 3. Scenarios and Use Cases.pptx
61/68
(. CoM*ASS Case St$dy
8/16/2019 3. Scenarios and Use Cases.pptx
62/68
∗ Seci;cally a system or ad"anced searc+ and
disco"ery o scienti;c reso$rces)∗ jo$rnal aers
∗ data sets
∗ 5eb ser"ices t+at imlement scienti;c models.
∗ A Gkno5ledge inrastr$ct$re.∗ '+e creation o an ontology 5as central.
∗ Ontology T str$ct$re or describing kno5ledge$sing a ormal =logical> notation t+at allo5s
reasoning.
System :oals
8/16/2019 3. Scenarios and Use Cases.pptx
63/68
Scenario 1
1.1 Kno5ledge Disco"ery Scenario ane is a marine scientist and 5ants to b$y e$iment tost$dy a artic$lar +enomenon, abo$t 5+ic+ s+e +as littlekno5ledge. S+e 5ants to ;nd ALL t+e instr$ments t+at arecaable o st$dying t+at +enomenon and kno5ledge abo$t
+o5 to $se t+ose instr$ments and o +o5 t+at +enomenon+as been st$died in t+e ast. S+e is also interested ingat+ering jo$rnal articles and satial datasets o ast researc+on t+is +enomenon 5it+in +er seci;c st$dy area.
8/16/2019 3. Scenarios and Use Cases.pptx
64/68
Scenario 2
1.2 Kno5ledge Use Scenario ane +as disco"ered t+at t+ere +as been a lot o researc+ ont+is +enomenon in t+e ast, b$t t+at a ne5 meas$rementinstr$ment +as been de"eloed t+at meas$res t+is+enomenon to a m$c+ greater acc$racy and 5+ic+ +as not
been $sed in +er st$dy area beore. S+e 5ants to comareresearc+ s+e 5ill $ndertake 5it+ t+is ne5 instr$ment to allt+e earlier researc+ $ndertaken by "ario$s researc+ gro$s.S+e needs to collect t+e data o t+is ast researc+, and insome cases reormat t+e data, and do some statistical
analysis t+at comares t+e ast res$lts 5it+ +er data.
8/16/2019 3. Scenarios and Use Cases.pptx
65/68
8/16/2019 3. Scenarios and Use Cases.pptx
66/68
Concet Ma
6orks+o Cometency
8/16/2019 3. Scenarios and Use Cases.pptx
67/68
∗For a specic instrument one wants to know:∗ 6+at does it meas$reN
∗ 6+at is t+e acc$racy or recisionN
∗ 6+at en"ironmental arameters are re$ired or s$ccess$l oerationN =e.g. inocean 5ater salinity can be meas$red 5it+ cond$cti"ity, b$t in brackis+ 5ater ac+emical meas$re mig+t be more sensible.>
∗ 6+o s$lies t+e instr$mentN
∗ 6+o +as $sed t+e instr$mentN
∗ 6+at do 7 get or reeN
∗For a specic survey one wants to know:∗ 6+at instr$ments do 7 +a"e to $seN
∗ 6+ic+ resol$tion do 7 needN
∗ 6+at are t+e ad"antages and disad"antages o a"ailable$sed instr$mentsN
∗ 6+at meas$rements +a"e been made =in t+e ast>N
∗ 6+ic+ instr$ments 5ere $sedN
6orks+o CometencyV$estions
8/16/2019 3. Scenarios and Use Cases.pptx
68/68
∗ UML is a modelling notation t+at enables OOAD.
∗ A collection o di?erent tyes o diagrams t+atare $sed toget+er.
∗ Use case diagrams gi"e a +ig+ le"el $nctional"ie5 o t+e system re$irements.
∗ Use scenarios to connect $nctional re$irementsto $se cases.
S$mmary