Developing Software Woth UML Booch Jacobson Rumbaugh Use case Pokok bahasan: • • • • Use case Identifikasi use case dan actor Business use case dan system use case Menggunakan use case Addison-Wesley SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Membuat model fungsi sistem • Use case modeling adalah suatu proses untuk membuat model fungsi-fungsi dari sistem dari kejadiankejadian bisnis, siapa yang melakukannya, dan bagaimana sistem bereaksi terhadap suatu kejadian. • Use case modeling mengidentifikasi dan menjelaskan fungsi-fungsi sistem dari perspektif pengguna eksternal dengan menggunakan tools yang disebut use case. • Use case adalah serangkaian langkah-langkah yang saling berhubungan (skenario), baik otomatis maupun manual, dengan tujuan untuk menyelesaikan suatu kegiatan bisnis tunggal. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman • Use case menggambarkan fungsi-fungsi sistem dari perspektif pengguna luar. Use case adalah hasil dari dekomposisi lingkup fungsi-fungsi dari sistem menjadi statement-statement yang lebih kecil mengenai fungsional oleh fungsi-fungsi sistem. Pembuatan use case sudah dibuktikan merupakan suatu teknik yang baik untuk mengerti lebih baik dan mendokumentasi kebutuhan sistem. • Use case sendiri bukan sebagai kebutuhan fungsional, tetapi ceritanya (skenario) yang diceritakan dari use case menangkap essensi dari satu atau lebih kebutuhan-kebutuhan. Use case diawali atau dipicu oleh pengguna eksternal atau sistem yang disebut actor. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman • Actor menggambarkan segala sesuatu yang berinteraksi dengan sistem untuk melakukan pertukaran informasi. Actor adalah pengguna, pemeran (role), yang bisa berupa sistem eksternal maupun orang. • Actor menginisiasi aktivitas sistem, dalam bentuk use case, bertujuan untuk melengkapi beberapa kegiatan bisnis. • Actor menggambarkan peranan yang dilakukan oleh user yang berinteraksi dengan sistem dan bukan menggambarkan individual jabatan pekerjaan. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Keuntungan Use Case 1. Sebagai dasar untuk membantu mengidentifikasi objek-objek dan hubungan tingkat tinggi dan tanggung jawab masing-masing. 2. Sebagai gambaran dari behavior sistem yang akan dibuat dari sisi pengguna eksternal. 3. Sebagai alat yang efektif untuk memvalidasi kebutuhan. 4. Sebagai alat komunikasi yang efektif 5. Sebagai dasar untuk melakukan perencanaan testing. 6. Sebagai dasar untuk melakukan pembuatan user manual. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Langkah-langkah dalam membuat use case modeling 1. Mengidentifikasi actor-actor tambahan dan use case-use case 2. Buatlah model Use Case 3. Dokumentasikan kejadian-kejadian dalam Use Case 4. Definisikan Analysis Use Cases Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Step 1: Identifying Actors and Use Cases Actor Potential Member Club Member Club Member Club Member Club Member Club Member Past Member Marketing Marketing Marketing Time Time Time Time Time Use Case Name SUBMIT NEW SUBSCRIPTION PLACE NEW MEMBER ORDER MAKE ACCOUNT INQUIRY MAKE PURCHASE INQUIRY MAINTAIN MEMBER ORDER SUBMIT CHANGE OF ADDRESS SUBMIT RESUBSCRIPTION SUBMIT NEW MEMBER SUBSCRIPTION PROGRAM SUBMIT PAST MEMBER RESUBSCRIPTION PROGRAM SUBMIT NEW PROMOTION GENERATE QUARTERLY PROMOTION ANALYSIS GENERATE QUARTERLY SALES ANALYSIS GENERATE QUARTERLY MEMBERSHIP ANALYSIS GENERATE ANNUAL SALES ANALYSIS GENERATE ANNUAL MEMBERSHIP ANALYSIS Irwin/McGraw-Hill Use Case Description Potential member joins the club by subscribing. (“Take anu 12 CDs for one penny and agree to buy 4 more at regular club prices within two years.”) Club member places order. Club member wants to examine his or her account history. (90-day time limit) Club member inquires about his/her purchase history. (three-year time limit) Club member wants to revise an order or cancel an order. Club member changes address. (including e-mail and privacy code) Past member rejoins the club by resubscribing. Marketing establishes a new membership resubscription plan to entice new members. Marketing establishes a new membership resubscription plan to lure back former members. Marketing initiates a promotion. (Note: A promotion features specific titles, usually new, that company is trying to sell at a special price. These promotions are integrated into a catalog sent (or communicated) to all members.) Print quarterly promotion analysis report. Print annual sales analysis report. Print annual membership analysis report. Print annual sales analysis report. Print annual membership analysis report. Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Step 2: Constructing a Use Case Model Diagram Subscription Subsystem Order Subsystem Maintain Member Order Submit Change of Address initiates Submit New Subscription Potential Member initiates Club Member initiates Place New Member Order Submit Resubscription initiates initiates initiates Submit Past Member Resubscription Program Make Purchase Inquiry Submit New Member Subscription Program Past Member initiates Operations Subsystem Make Account Inquiry Generate Annual Sales Analysis Generate Quarterly Sales Analysis Irwin/McGraw-Hill Promotion Subsystem Generate Quarterly Membership Analysis initiates initiates Generate Annual Membership Analysis initiates Time Marketing initiates initiates initiates Generate Quarterly Promotion Analysis Submit New Promotion initiates initiates Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Step 3: Documenting the Use Case Typical Course Author: S. Shepard Date: 10/05/200 Use Case Name: Submit New Member Order Actor(s): Member Description: This use case describes the process of a member submitting an order for SoundStage products. On completion, the member will be sent a notification that the order was accepted. References: MSS-1.0 1 System response Typical Course Step 2: The member’s personal information such as Actor Action of Events: address is validated against what is currently Step 1: This use case is recorded in member services. initiated when a member 2 Step 3: The member’s credit status is checked with submits an order to be Accounts Receivable to make sure no processed payments are outstanding. Step 4: For each product being ordered, validate the product number and then check the availability in inventory and record the ordered product information. Step 5: Create a picking ticket for the member order containing all ordered products that are available and route it to the warehouse for processing. Step 6: Generate an order confirmation notice indicating the status of the order and send it to the member. Step 7: This use case concludes when the member receives the order confirmation notice. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Step 3: Documenting the Use Case Typical Course (concluded) Alternate Courses: Pre-condition: Step 2: If the club member has indicated an address or telephone number change on the promotion order, update the club member’s record with the new information. Step 3: If Accounts Receivable returns a credit status that the customer is in arrears, send an order rejection notice to the member. Step 4: If the product number is not valid, send a notification to the member requesting them to submit a valid product number. If the product being ordered is not available, record the ordered product information and mark as “back-ordered.” Orders can only be submitted by members. Post-condition: Member order has been recorded and the picking ticket has been routed to the warehouse. Assumptions: None at this time. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Extension and Abstract Use Cases • An extension use case extends the functionality (typical course) of an original use case. An extension use case can only be invoked by the use case it is extending. • An abstract use case contains typical course steps that were common to two or more original use cases. An abstract use case reduces redundancy and promotes reuse. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Depicting Extension and Abstract Use Cases using UML Notation Generate Warehouse Packing Order Calculate Order Subtotal & Sales Tax Extension use case Extension use case Place New Member Order Revise Street Address Abstract use case Submit Change of Address Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Step 4: Defining the Analysis Use Case Author: S. Shepherd USE CASE NAME: ACTOR(S): DESCRIPTION: REFERENCES TYPICAL COURSE OF EVENTS: Irwin/McGraw-Hill ANALYSIS USE CASE Date: 10/25/2000 Place New Member Order Club Member This use case describes the process of a club member submitting a new order for SoundStage products. On completion, the club member will be sent a notification that the order was accepted. MSS-1.0 Actor Action System Response Step 1: This use case is initiated Step 2: The member’s personal information such as when a member submits an address and phone number is validated against what is order to be processed. currently on file. Step 3: For each product being ordered, validate the product number. Step 4: For each product being ordered, check the availability in inventory and record the ordered product information such as the quantity being ordered. Step 5: Invoke extension use case Calculate Order Subtotal & Sales Tax. Step 6: The member’s credit card information is verified based on the amount due and Accounts Receivable transaction data is checked to make sure no payments are outstanding. Step 7: Invoke extension use case Generate Warehouse Step 9: This use case concludes Packing Order. when the member receives the Step 8: Generate an order confirmation notice indicating order confirmation notice. the status of the order and send it to the member. (continued) Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Step 4: Defining the Analysis Use Case (concluded) ALTERNATE COURSES: Step 2: If the club member has indicated an address or telephone number change on the order, invoke abstract use case Revise Street Address. Step 3: If the product number is not valid, send a notification to the member requesting the member to submit a valid product number. Step 4: If the product being ordered is not available, record the ordered product information and mark the order as “backordered.” Step 6: If member’s credit card information is invalid or if member is found to be in arrears, a credit problem notice is sent to the member. Modify the order’s status to be “on hold pending payment.” PRECONDITION: Orders can only be submitted by members. POSTCONDITION: Member order has been recorded and the Packing Order has been routed to the Warehouse. ASSUMPTIONS: None at this time. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Finding and Identifying Business Objects • Step 1: Find the Potential Objects – Underlining (or highlighting) the use case nouns • Step 2: Select the Proposed Objects – Removing the nouns that represent: • • • • • Irwin/McGraw-Hill Synonyms Nouns outside the scope of the system Nouns that are roles without unique behavior or are external roles Unclear nouns that need focus Nouns that are really actions or attributes Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Use Case with Nouns Highlighted Author: S. Shepherd USE CASE NAME: ACTOR(S): DESCRIPTION: REFERENCES TYPICAL COURSE OF EVENTS: ANALYSIS USE CASE Date: 10/25/2000 Place New Member Order Club Member This use case describes the process of a club member submitting a new order for SoundStage products. On completion, the club member will be sent a notification that the order was accepted. MSS-1.0 Actor Action System Response Step 1: This use case is initiated Step 2: The member’s personal information such as when a member submits an address and phone number is validated against what is order to be processed. currently on file. Step 3: For each product being ordered, validate the product number. Step 4: For each product being ordered, check the availability in inventory and record the ordered product information such as the quantity being ordered. Step 5: Invoke extension use case Calculate Order Subtotal & Sales Tax. Step 6: The member’s credit card information is verified based on the amount due and Accounts Receivable transaction data is checked to make sure no payments are outstanding. Step 7: Invoke extension use case Generate Warehouse Step 9: This use case concludes Packing Order. when the member receives the Step 8: Generate an order confirmation notice indicating order confirmation notice. the status of the order and send it to the member. (continued) Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Use Case with Nouns Highlighted (concluded) ALTERNATE COURSES: Step 2: If the club member has indicated an address or telephone number change on the order, invoke abstract use case Revise Street Address. Step 3: If the product number is not valid, send a notification to the member requesting the member to submit a valid product number. Step 4: If the product being ordered is not available, record the ordered product information and mark the order as “backordered.” Step 6: If member’s credit card information is invalid or if member is found to be in arrears, a credit problem notice is sent to the member. Modify the order’s status to be “on hold pending payment.” PRECONDITION: Orders can only be submitted by members. POSTCONDITION: Member order has been recorded and the Packing Order has been routed to the Warehouse. ASSUMPTIONS: None at this time. Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Potential Objects Extracted from Use Case POTENTIAL OBJECT LIST Accounts Receivable Department Amount Due Club Member Credit Card Information Credit Problem Notice Credit Status File Marketing Department Member Address Member Order Member Phone Number Member Services Department Member Services System Order Order Confirmation Notice Order Sales Tax Order Status Order Subtotal Ordered Product Ordered Product Information Ordered Product Quantity Past Member Payments Potential Member Product Product Inventory Product Number Street Address Transaction Warehouse Warehouse Packing Order Irwin/McGraw-Hill Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved SYSTEMS ANALYSYS AND DESIGN METHODS 5TH Edition Whitten Bentley Dittman Analysis of the Potential Objects POTENTIAL OBJECT LIST Accounts Receivable Department Amount Due Club Member Credit Card Information Credit Problem Notice Credit Status File Marketing Department Member Address Member Order Member Phone Number Member Services Department Member Services System Order Order Confirmation Notice Order Sales Tax Order Status Order Subtotal Ordered Product Ordered Product Information Ordered Product Quantity Past Member Payments Potential Member Product Product Inventory Product Number Street Address Transaction Warehouse Warehouse Packing Order Irwin/McGraw-Hill REASON x x x x x x x x x x x x x x x x x x x x x x x Not relevant for current project Attribute of “MEMBER ORDER” Type of “MEMBER” Attribute of “MEMBER” Potential Interface item to be addressed in object-oriented design Attribute of “MEMBER” Not relevant for current project Not relevant for current project Attribute of “MEMBER” “MEMBER ORDER” Attribute of “MEMBER” Not relevant for current project Not relevant for current project Another name for “MEMBER ORDER” Potential Interface item to be addressed in object-oriented design Attribute of “MEMBER ORDER” Attribute of “MEMBER ORDER” Attribute of “MEMBER ORDER” “MEMBER ORDERED PRODUCT” Unclear noun Attribute of “MEMBER ORDERED PRODUCT” Type of “MEMBER” Type of “TRANSACTION” Type of “MEMBER” “PRODUCT” Attribute of “PRODUCT” Attribute of “PRODUCT” Attribute of “MEMBER” “TRANSACTION” Not relevant for current project Potential Interface item to be addressed in object-oriented design Copyrighth@2000 The Mcgraw-Hill Companies All Right reserved Developing Software Woth UML Booch Jacobson Rumbaugh • Sebuah use case menjelaskan interaksi antara user dengan sistem aplikasi. • Sebagai contoh dalam sebuah sistem reservasi peminjaman mobil (rent a car), sebuah use case harus dapat menjelaskan apa yang user lakukan dengan sistem aplikasi dalam sebuah kejadian/event bisnis dalam sebuah proses bisnis. Misalnya reservasi sebuah mobil Ferrari untuk Pak Agus. • Sebuah proses dapat dibagi menjadi beberapa use case jika dapat diketahui dengan jelas tiap-tiap kejadiannya atau jika bagian-bagian yang diidentifikasi tersebut dikerjakan oleh orang-orang yang berbeda. • Jika diasumsikan sistem yang akan di analisa adalah Sistem Informasi Peminjaman Mobil (Rent a car) maka orang yang akan kita temui adalah: Addison-Wesley Developing Software Woth UML Booch Jacobson Rumbaugh • Customer service (central telephone operator) – Information – Reservation • Customer service (branch office) – Vehicle hand-over – Vehicle return • • • • Service personnel (branch office, vehicle clerk) Branch office management Phone service management Managing clerks, vehicle transfer staff, accounting staff (jika diperlukan) Addison-Wesley Developing Software Woth UML Booch Jacobson Rumbaugh Objek-objek yang disebutkan diatas harus dapat diidentifikasi dan diberi nama. Sebagai contoh objek-objek tersebut adalah: • • • • • • • Data customer Kontrak Invoice Konfirmasi reservasi Aturan pengembalian mobil Aturan pemarkiran Dokumentasi kendaraan Addison-Wesley Developing Software Woth UML • • • • • • • Aksesories yang ada dalam mobil Fixed accessories (AC, tape, sun roof) Kunci-kunci kendaraan File-file customer Alokasi / lot tempat parkir Contract condition / aturan kontrak Dsb. Addison-Wesley Booch Jacobson Rumbaugh Developing Software Woth UML Booch Jacobson Rumbaugh Identifikasi use case dan actor • Gambar use case dari kasus diatas dapat dilihat pada gambar di bawah ini. Disini actor-nya adalah interested party yaitu customer, dan staff untuk reservasi (staff for reservation), penyerahan mobil yang akan dipinjam (vehicle hand-over) dan pengembalian mobil (vehicle return) • Interested party (Calon customer) berbeda dengan Customer, karena calon customer biasanya belum ada datanya (anonymous), karena data mereka belum terdaftar Addison-Wesley Developing Software Woth UML Booch Jacobson Rumbaugh Car Rental Agency Advise, give inf ormation Interested Party <<include>> reserve Reservation Staf f Stipulate contract Customer Handover vehicle Hand-over staf f Take back vehicle Driver Return Staf f Invoice Customer Addison-Wesley Developing Software Woth UML Booch Jacobson Rumbaugh Business use case dan System use case Dalam bisnis use case, actor adalah semua peran (role) yang terlibat dalam proses bisnis, sedangkan dalam system use case, mereka dibatasi hanya kepada mereka yang mempunyai kontak langsung dengan sistem aplikasi. Biasanya customer tidak memiliki akses langsung dengan sistem aplikasi, tetapi dalam bisnis use case mereka tetap dicatat. Jika customer dapat melakukan reservasi melalui self-service terminal atau melalui internet, mereka berinteraksi langsung dengan sistem aplikasi dan oleh karena itu mereka harus digambarkan dalam system use case. Addison-Wesley Developing Software Woth UML Booch Jacobson Rumbaugh Jika use case car rental agency diatas dikelompokkan, bentuknya : Reservation Advise, give information Interested party <<include>> Reservation Reserve Customer Rental Stipulate contract Vehicle hand-over Hand over vehicle Driver Accept return vehicle Invoicing Customer Addison-Wesley Invoice Vehicle return Developing Software Woth UML Booch Jacobson Rumbaugh Menggunakan use case • Menggambarkan use case dalam bentuk diagram elips adalah langkah pertama, setelah itu yang berikutnya adalah menjelaskannya dalam bentuk lebih detil lagi. • Penjelasan detil dari use case adalah tujuan utama dari use case analysis untuk itu ada dua contoh yang menggambarkan use case lebih detil. Addison-Wesley