Download - Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Transcript
Page 1: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case  

Page 2: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

UML  

•  Bahasa  pemodelan  visual  sistem  berorientasi  objek  

•  Yang  dibahaas  dalam  kuliah  ini:  – Use  Case  – Ac>vty  Diagram  – Class  Diagram  – Sequence  Diagram  

Page 3: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Penger>an  Use  Case  

•  Ivar  Jacobson  (1990-­‐an)  :  “A  use  case  is  a  specific  way  of  using  the  system  by  performing  some  part  of  the  func>onality.  Each  use  case  cons>tutes  a  complete  course  of  events  ini>ated  by  an  actor,  and  it  specifies  the  interac>on  that  takes  place  between  an  actor  and  the  system…...  The  collected  use  cases  specify  all  the  exis>ng  ways  of  using  the  system.”  

Page 4: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Penger>an  Use  Case  

•   Grady  Booch:  If  you  design  a  new  house  and  you  are  reasoning  about  how  you  and  your  family  will  use  it,  this  is  use  case-­‐based  analysis.  You  consider  the  various  ways  in  which  you‘ll  use  the  house,  and  these  use  cases  drive  the  design  

Page 5: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Penger>an  Use  Case  

•  Menggambarkan  interaksi  antara  user/aktor  dengan  sistem  

•  Jadi,  Use  Case  akan  menggambarkan  bagaimana  sistem  akan  digunakan  oleh  user  

•  Fokus  dari  Use  Case  adalah  fitur/fungsionalitas  apa  saja  yang  harus  disediakan  oleh  sistem  dan  siapa  user/aktor  yang  akan  menggunakan  fitur/fungsionalitas  tersebut  

Page 6: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

User/Aktor  

•  En>tas  eksternal  yang  berinteraksi  dengan  sistem  – Manusia  – Sistem  lain  

Page 7: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Tujuan  Use  Case  

•  Memodelkan  kebutuhan  fungsional  sistem  •  Menunjukkan  konteks  dari  sistem  •  Dapat  digunakan  sebagai  acuan  untuk  melakukan  pengujian  validasi  

Page 8: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Simbol  Use  Case  

•  Aktor  

•  Use  Case  

actor  

use  case  

•  Asosiasi  

•  Boundary  Sistem  

Page 9: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Contoh  

student  

register  for  course  

works  with  course  

lecturer  

adm  

lab  

instructor  

make/edit  course  

register  for  exam  

register  as  student  

System  Boundary  

Page 10: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Macam-­‐Macam  Relasi  Aktor  dengan  Usse  Case  

actor  

use  case  

Both  actor  and  use  case    can  ini2ate  the  communica2on.  

actor  

use  case  

The  actor  ini2ate  the  communica2on.  

actor  

use  case  

The  use  case  ini2ate  the  communica2on.  

Page 11: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Relasi  dalam  Use  Case  

•  Generalisasi  •  Include  •  Extend  

Page 12: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Include  

•  Terdapat  2  usecase  (misal  A  dan  B)  dimana  salah  satu  use  case  (A)  memiliki  ketergantungan  dengan  satu  use  case  yang  lain  (B).  

•  Jika  use  case  A  dijalankan,  maka  selalu  use  case  B  juga  berperan  

Page 13: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Include  

•  Student  register  for  course,  main  flow  of  event:    –  The  use  case  starts  when  the  student  brows  the  course  register  page.  

–  The  user  write  user  name  and  password.  –  Inclusion  point:  Validate  student  –  The  system  presents  all  possible  courses  for  this  student.  –  The  student  select  course  and  commits  the  entry  by  pressing  the  Enter  bu[on.  

Validate  student  

Register  for  course  

“include”  

base  

Page 14: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Include  

student  

validate  student  for  study  

register  as  

student  

enter  student  in    “student  register”  

adm  

make  student  profile  

“include”  “include”  

“include”  

Page 15: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Include  

Page 16: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

•  Relasi  include  ditandai  dg  stereotype:  – “include”  – <<include>>  

Page 17: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Extend  

•  Terdapat  2  usecase  (misal  A  dan  B)  dimana  salah  satu  use  case  (A)  memiliki  ketergantungan  secara  opsional  dengan  satu  use  case  yang  lain  (B).  

•  Misal,  jika  use  case  A  dijalankan,  maka  bisa  jadi  use  case  B  juga  jalan,  atau  mungkin  juga  use  case  B  >dak  ikut  jalan  (opsional)  

Page 18: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Extend  

•  Pada  relasi  extend,  dalam  use  case  “Buy  Goods”  kita  menentukan  suatu  kondisi  kapan  use  case  “Buyer  returns  goods”  akan  dijalankan  kapan  >dak  

Buy  Goods  

Buyer  returns  goods  

«extend»  

Page 19: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Extend  

Page 20: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case:  Generalisasi  

•  Biasanya  digunakan  untuk  menggambarkan  suatu  aktor  yang  merupakan  turunan  (inherit)  dari  aktor  yang  lain  

•  Juga  bisa  digunakan  untuk  menggambarkan  suatu  use  case  yang  menurun  dari  use  case  lain.  Atau  menunjukan  dua  use  case  yang  memiliki  relasi  umum-­‐khusus  

Page 21: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$
Page 22: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

guest  

member  <<  

Browse  book  

Borrow  book  

Update  membership  

<<include>>  

Page 23: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$
Page 24: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Skenario  Use  Case/Narasi  Use  Case  

•  Memberikan  uraian  secara  mendetail  dari  suatu  use  case  

•  Tiap  use  case  dibuatkan  skenario  use  case  

Page 25: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Use  Case  Example  [1]  -­‐  Use  Case:  5  Buy  Goods  

CHARACTERISTIC  INFORMATION  Goal  in  Context:      Buyer  issues  request  directly  to  our  company,  expects                                                              goods  shipped  and  to  be  billed.  Precondi>ons:    We  know  Buyer,  their  address,  etc.  Success  End  Condi>on:    Buyer  has  goods,  we  have  money  for  the  goods.  Failed  End  Condi>on:    We  have  not  sent  the  goods,  Buyer  has                                                                              not  spent  the  money.  Primary  Actor:    Buyer,  any  agent  (or  computer)  ac>ng  for                                                        the  customer  Trigger:    purchase  request                                  comes  in.  

Buyer  

Buy  Goods  

Company  is  out  of  one  of  the  items  

Buyer  pays  directly  with  credit  card  

Buyer  returns  goods  

«extend»  

«extend»  

«extend»  S>muli  

Page 26: Use$Case$ - ifrozi.files.wordpress.com filePenger>an$Use$Case$ • Ivar$Jacobson$(1990Jan)$:$“A$use$case$is$a specific$way$of$using$the$systemby$ performing$some$partof$the$func>onality.$

Buyer  

Buy  Goods  

Company  is  out  of  one  of  the  items  

Buyer  pays  directly  with  credit  card  

Buyer  returns  goods  

«extend»  

«extend»  

«extend»  

Use  Case:  5  Buy  Goods  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐  MAIN  SUCCESS  SCENARIO  1.  Buyer  calls  in  with  a  purchase  request.  2.  Company  captures  buyer’s  name,          address,  requested  goods,  etc.  3.  Company  gives  buyer  informa>on  on          goods,  prices,  delivery  dates,  etc.  4.  Buyer  signs  for  order.  5.  Company  creates  order,  ships  order  to  buyer.  6.  Company  ships  invoice  to  buyer.  7.  Buyers  pays  invoice.  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐  EXTENSIONS  3a.  Company  is  out  of  one  of  the  ordered  items:    

 3a1.  Renego>ate  order.  4a.  Buyer  pays  directly  with  credit  card:  

 4a1.  Take  payment  by  credit  card  (use  case  44)  7a.  Buyer  returns  goods:  

 7a.  Handle  returned  goods  (use  case  105)    

Each  step  take  the  form  ”A  does  X”,  where  A  is  an  actor  and  X  is  an  ac>on.  If  a  use  case  is  included  you  will  find  a  step  that  has  the  form  ”include  U”,  where  U  is  another  use  case.  Extension  3a  is  execute  instead  of  3  if  condi>on:    ”Company  is  out  of  one  of  the  ordered  items”  is  fulfilled!