Ocumenting SE Ases: Documentation Templates
Ocumenting SE Ases: Documentation Templates
Ocumenting SE Ases: Documentation Templates
There is a lot of documentation associated with Use Cases that needs to be organized somehow. You want the documentation to be understandable, but you need other things as well. For example, you may want to be able to trace from System level to subordinate Use Cases, or from Use Cases to Scenarios to Test Plans. You may want to be able to set priority levels on a Use Case or any part of a Use Case, then run a report later listing all Use Cases of a certain priority. Or you may want to be able to set and check status on a Use Case, such as has it been coded or tested. In this Chapter, well look at a sample Use Case template, and consider different methods for implementing that template.
Documentation Templates
Below are some sample documentation templates. We start with an overall system description. You will have just one of these documents. It will probably be in a le or document by itself. We follow that with a document template for a Use Case.
111
112
CHAPTER 7
System Name
<Brief description. In a large system, this could be several pages. Note this is not meant to be detailed requirements, but a basic overview of the system.>
Risk Factors
<list risk factors here in priority order>
Architecture Diagram
<Include a description of the interfaces as well. These could be on the diagram, or listed in text.>
Subsystem Descriptions
<Include a brief description of each subsystem.> Figure 89: System Description Document Template Next, we need descriptions for the Use Cases. Each Use Case will likely be in a document or le by itself. If a Use Case has a lot of detailed Scenario descriptions, they might also be in separate les. First is a very detailed Use Case document template. You will have one for each system level Use Case. You will also have one for each subordinate Use Case. You will need a similar
113
document for the detailed Scenarios. Just leave out the parts that are unnecessary or redundant.
Actors
<A list of the Actors who communicate with this Use Case>
Priority
<How important is this Use Case to the project?>
Status
<What point are we in developing this Use Case?>
Pre-Conditions
<A list of conditions that must be true before the Use Case starts>
Post-Conditions
<A list of conditions that must be true when the Use Case ends, no matter which Scenario is executed.>
Extension Points
<If the Use Case has extension points, list them here.>
114
CHAPTER 7
115
Flow of Events
<This could be in text, in an Activity diagram, in a Sequence diagram, or any or all of them.>
Activity Diagram
<An activity diagram of the ow of events, or some signicant or complex part of the ow of events.>
User Interface
<For systems which interface with people, include a description of the user interface, possibly using storyboards.>
Scenarios
<They should at least be listed here, but may also include a brief description.>
Sequence Diagrams
<If you dont have separate documents for Scenarios, you might include sequence diagrams for them here.>
Other Artifacts
<This can include references to the subsystem the Use Case belongs to, an analysis model, a design model, code, or test plans.> Figure 91: Detailed Use Case Description Document Template (cont.)
116
CHAPTER 7
You dont have to include all these sections. If your Use Cases are not this complex, then you dont need all these sections. You may nd you want additional sections. Thats ne. This is just a sample given as a starting point. If it works as is, use it. Otherwise, modify as needed.
After answering these questions you will be prepared to evaluate the tools you already have, as well as tools you are considering buying. One last thing to consider is ease of use. Hard to use tools tend to sit on a shelf, unless there are no other options. In this case you have many options, so look for something your team will use.
117
118
CHAPTER 7
relationships with actors. This means that we cannot have a uses relationship from a Use Case in one subsystem to a Use Case in another subsystem. The Place Order use case in the system diagram uses the Give Product Information use case. But these Use Cases ended up in different subsystems, Place Order in the Manage Orders subsystem, and Give Product Information in the Product Info subsystem. So our uses relationship at the system level became a communicates relationship in the subsystems. You will see this in a number of places in the following pages.
Risk Factors
s s s s s s
Some of the people designing the software are inexperienced How can we prevent lost orders on system failure? The system has to be easy for non-technical people to use. Can we be successful if we dont support a web interface? What if the system is ooded with orders immediately? How do we handle many simultaneous users in different parts of the company? s How do we handle the database crashing?
119
<<uses>> <<uses>>
Customer
Login
<<uses>> <<uses>>
Cancel order
<<uses>> Get status on order Run Sales Report Send Catalog Customer Support Manager Register complaint
120
CHAPTER 7
Inventory System
Architecture
System Access
Product Info
Manage Orders
Ship Orders
121
System Access Subsystem This subsystem handles log in and log out, and checks for access permissions. Product Info Subsystem This subsystem provides all kinds of information about products. It interfaces with the Inventory System. Manage Orders Subsystem This subsystem handles order taking, returning of products, status of orders, and canceling orders. Ship Orders Subsystem This subsystem prints pick lists for orders, generates mailing labels, and calculates shipping and handling for orders. Money Handling Subsystem This subsystem interfaces to the Accounting System, updates accounts, charges and credits customers, and handles checks, credit cards, or money orders. Database Subsystem This subsystem contains the data we need to store for the application. It provides standard store, retrieve, update, and delete functions for the data that is stored.
122
CHAPTER 7
Login
This Use Case describes the process by which users log into the order processing system. It also sets up access permissions for various categories of users.
Actors
s Customer s Customer Rep
Place Order Return Product Cancel Order Get Status on Order Send Catalog Register Complaint Run Sales Report
Flow of Events
1. 2. 3. 4. 5. 6. 7. 8. 9. The Use Case starts when the user starts the application. The system will display the login screen The user enters a username and password. The system will verify the information. The system will set access permissions. The system will display the main screen. The user will select a function While the user does not select Exit loop If the user selects Place Order then 8.1 Use Place Order 10.else If the user selects Return Product then 9.1 Use Return Product 11.else if the user selects Cancel Order then 10.1 Use Cancel Order 12.else if the user selects Review Order then 11.1 Use Get Status on Order 13.else if the user selects Send Catalog then 12.1 Use Send Catalog 14.else if the user selects Contact Customer Service then 13.1 Use Register Complaint
123
15.else if the user selects Run Sales Report and user is a Customer Rep then 14.1 Use Run Sales Report end if 16.The user will select a function end loop 17.The Use Case ends
124
CHAPTER 7
Activity Diagram
Run Sales Report
Return Product
[return product] Get Status on Order [review order] Cancel Order [cancel order] [send catalog] Send Catalog [place order] Place Order [contact customer service] Register Complaint
[not exit] Verify Information Set Access Rights Select Function [exit]
125
User Interface
Welcome to National Widgets On-Line Catalog
Please enter your User Name and Password to access our electronic Catalog UserName: Password: Figure 96: Login Screen
Scenarios
s s s s s
Bad username Bad password User does not have a username and password for our system User selects a function for which they are not allowed access User makes no selection of function
126
CHAPTER 7
Place Order
This Use Case describes the process by which orders are entered into the order processing system.
Actors
s Customer s Customer Rep
Flow of Events
1. 2. 3. 4. 5. The Use Case starts when the customer selects Place Order. The system displays the Place Order Screen The customer enters their name and address. The customer will enter product codes for products they wish to order For each product code entered 4.1 Use Give Product Information 4.2 The system will add the price of the item to the total. end 6. The customer will enter credit card payment information. 7. The customer will select submit. 8. The system will verify the information and save the order as pending 9. Use Update Account 10.The order is marked conrmed, an order id is returned to the customer, and the use case ends. Alternative Flow of Events At any time before selecting submit, the customer can select cancel. The order is not saved and the use case ends.
127
Activity Diagram
[place order selected] Cancelable Actions Order form Displayed Submit [Info complete]
Enter Name and Address Charge Account [product code entered] [payment good] Give Product Information [product code entered] New Total Calculated [no more product codes]
Order Id Displayed
[submit] [cancel]
128
CHAPTER 7
User Interface
Shipping Name Shipping Address City, State, Zip Product Code Description Quantity Price Each Total Price
Scenarios
s s s s s s s s
Payment not there Shipping address is incomplete Product code doesnt match actual products Product no longer carried Payment bad Customer pays by check Customer sends order by mail Customer phones in order
129
Actors
s Inventory System
Flow of Events
1. This Use Case begins when a product code is entered. 2. The system sends a request to the Inventory System for product information based on that product code. 3. The Inventory System returns the product information, what must include at least a product description, price, and stock on hand. 4. The Use Case ends.
Activity Diagram
None.
User Interface
None.
Scenarios
s No such product s Product no longer carried s Inventory System unavailable
130
CHAPTER 7
Update Account
This Use Case interacts with the Accounting System to apply charges or credits to an account.
Actors
s Accounting System
Flow of Events
1. The Use Case begins when a request to update an account is received. 2. The system will send credit card info and amount of credit or debit to the Accounting System. 3. The Accounting System will send a status of OK. 4. The Use Case ends.
Activity Diagram
None.
User Interface
None.
Scenarios
s Account overdrawn s Account doesnt exist s Accounting System not available
131
Return Product
This Use Case describes the process by which unwanted products are returned to the company by the customer.
Actors
s Customer Rep
Flow of Events
1. 2. 3. 4. 5. 6. 7. 8. The Use Case starts when the customer rep selects return product. Use Search for Order. The system will display the selected order in the Return Products Screen. The customer rep will select the products to return. The customer rep will select submit. Use Update Account. Use Update Product Quantities. The system will display an acknowledgment and the Use Case ends.
Activity Diagram
None.
132
CHAPTER 7
User Interface
Shipping Name Shipping Address City, State, Zip Product Code XX XX AAA AAAA BBB BBBB CCC CCCC Description XXX XXX Quantity to Return
Submit
Figure 100: Return Products Screen
Scenarios
s s s s s s
No orders for this customer Order id not found in system Customer not found in system Account no longer valid Accounting System not available Inventory System not available
133
Actors
s Customer s Customer Rep
Flow of Events
1. 2. 3. 4. The Use Case starts when the Find Order Screen is displayed. The user enters an order id or name and address. The user selects search. If the user entered a name and address 4.1 The system will display a list of orders for that customer, including at least an order id and date of order 4.2 The user will select one order end if 5. The system returns an order id and the Use Case ends.
Activity Diagram
None.
Or
Order Id
Search
134
CHAPTER 7
Select An Order
Order Id XX XX Date XXX XXX Select
Scenarios
s No such customer s No orders for customer s No such order
135
Actors
s Inventory System
Flow of Events
1. The Use Case starts when a request to Update Product Quantities is received. 2. If the quantity is positive then 2.1 the system will send a request to the Inventory System to add that amount to the stock on hand for a product. else 2.2 the system will send a request to the Inventory System to subtract that amount from the stock on hand for a product. end if 3. The Inventory System will send an acknowledgment and the Use Case ends.
Activity Diagram
None.
User Interface
None.
Scenarios
s Inventory System not available s Product is no longer stocked
136
CHAPTER 7
Cancel Order
This Use Case describes the process by which a customer can cancel an order.
Actors
s Customer s Customer Rep
Flow of Events
1. 2. 3. 4. 5. The Use Case starts when the customer selects Cancel Order. Use Search for Order. The system will display the cancel order screen for that order. The customer will select Cancel. If the order has not been shipped 5.1 Use Update Account else 5.2 Display Return Policies Screen end if 6. The Use Case ends.
Activity Diagram
None.
User Interface
Unopened products may be shipped back in their original containers within 30 days of purchase for a full refund. OK
Figure 103: Return Policies Screen
137
Shipping Name Shipping Address City, State, Zip Product Code Description Quantity Price Each Total Price
Cancel Order
Keep Order
Scenarios
s s s s s
No orders for this customer Order id not found in system Customer not found in system Account no longer valid Accounting System not available
138
CHAPTER 7
Actors
s Customer s Customer Rep
Flow of Events
1. The Use Case starts when the user selects review order. 2. Use Search for Order. 3. The system will display the order status screen and the Use Case ends.
Activity Diagram
None.
User Interface
Shipping Name Order Id Product Description Status Quantity Item Status
OK
Scenarios
s Order not found
139
Send Catalog
This Use Case describes how a customer can request a catalog.
Actors
s Customer s Customer Rep
Flow of Events
1. 2. 3. 4. 5. 6. The Use Case starts when the customer selects send catalog. The catalog order screen is displayed. The user enters a name and address The user selects submit The request is submitted as a regular order with no charges to the system. The Use Case ends.
Activity Diagram
None.
User Interface
Name Address City, State, Zip
Order Catalog
Submit
Scenarios
None.
140
CHAPTER 7
Register Complaint
This Use Case describes how a customer can give feedback to the company.
Actors
s Customer s Customer Rep s Customer Support Manager
Flow of Events
1. 2. 3. 4. 5. The Use Case starts when the user selects contact customer service. The message screen is displayed. The user enters text. The user selects submit. The system sends the text entered in an email message to the customer support manager and the Use Case ends.
Activity Diagram
None.
User Interface
Enter Text of message
Submit
Scenarios
None.
141
Actors
s Customer Rep
Flow of Events
1. 2. 3. 4. 5. The Use Case starts when the user selects run sales report. The choose report screen is displayed. The user selects a report. The user selects submit. The system displays the report and the Use Case ends.
Activity Diagram
None. The ow is very simple and doesnt need it.
User Interface
Pick A Report Total sales this month Total sales this quarter
Submit
Scenarios
None.
142
CHAPTER 7
Actors
s Clerk
Flow of Events
1. The Use Case starts when the clerk starts the ll and ship order application. 2. The system displays the ll order screen with a list of all conrmed orders. 3. While the clerk selects an order 3.1 The system displays the order 3.2 for all the items in the order 3.2.1 User Give Product Info 3.2.2 The system displays stock on hand information for the item 3.2.3 if the item is out of stock 3.2.3.1 The system marks the item backordered. 3.2.3.2 The system sends a backorder request to the inventory system. 3.2.3.3 The order is marked backorders end if end loop 3.3 If there are items which are not backordered and not shipped then 3.3.1 for each such item 3.3.1.1Use Update Product Quantities 3.3.1.2 Print item and quantity on packing slip 3.3.1.3 mark item shipped end loop 3.3.2 If all items are marked shipped 3.3.2.1 mark the order shipped end if 3.3.2 The system calculates postage due 3.3.3 The system prints a mailing label with the shipping address and postage due 3.3.4 The system sends a notice to the shipping co that packages are ready to be picked up end if end loop
143
Activity Diagram
None. The ow is very simple and doesnt need it.
User Interface
Order Id
Date of Order
Scenarios
s Inventory System not available s Printer not available s Shipping company not available
Ship Orders - Ship and Fill Order Database - Get Order List Database - Get Order Database - Update Order Product Info - Backorder Item
144
CHAPTER 7
Actors
s Inventory System
Flow of Events
1. The use case starts when the Inventory system noties the system that backordered items have been received. 2. The system nds all orders marked backorders, and changes their status to conrmed. 3. For each item marked backordered, clear its state. 4. The Use Case ends.
Activity Diagram
None. The ow is very simple and doesnt need it.
User Interface
None.
Scenarios
None.
145
Login User
1. 2. 3. 4. 5. 6. 7. 8.
The use case starts when the user starts the application. The system displays the login screen. The user enters a user name and password The system asks the database for a user record for the user name. The system validates the login based on information from the user record. The system sets access levels for the user The system asks Manage Orders to display the main screen. The use case ends Figure 113: Login Subordinate Use Case
146
CHAPTER 7
Database
Inventory System
147
1. This Use Case begins when an actor requests product information. 2. The system sends a request to the Inventory System for product information based on that product code. 3. The Inventory System returns the product information, what must include at least a product description, price, and stock on hand. 4. The Use Case ends. Figure 116: Get Product Info Subordinate Use Case
1. The Use Case starts when a request to Update Product Quantities is received. 2. If the quantity is positive then 2.1 the system will send a request to the Inventory System to add that amount to the stock on hand for a product. else 2.2 the system will send a request to the Inventory System to subtract that amount from the stock on hand for a product. end if 3. The Inventory System will send an acknowledgment and the Use Case ends. Figure 117: Update Product Quantities Subordinate Use Case
1. The Use Case starts when a request to backorder items is received 2. The system sends a request to the Inventory System to place an order for out of stock items 3. The Inventory System will send an acknowledgment and the use case ends Figure 118: BackOrder Item Subordinate Use Case
148
CHAPTER 7
1. The use case starts when the Inventory system noties the system that backordered items have been received. 2. The system requests the Database to nd all orders marked backorders 3. For each order returned 3.1 The system changes its status to conrmed. 3.2 For each item marked backordered, 3.2.1 The system will clear its state. end loop 3.3 The system requests the Database to update the order. end loop 4. The Use Case ends. Figure 119: Backordered Items Received Subordinate Use Case
149
Place Order
<<uses>>
Product Info
<<uses>>
Return Product
<<uses>>
Money Handling
User
Database
Send Catalog
Register Complaint
150
CHAPTER 7
1. The Use Case begins when System Access requests the main screen be displayed. 2. The system will display the main screen. 3. The user will select a function 4. While the user does not select Exit loop 5. If the user selects Place Order then 8.1 Use Place Order 6. else If the user selects Return Product then 9.1 Use Return Product 7. else if the user selects Cancel Order then 10.1 Use Cancel Order 8. else if the user selects Review Order then 11.1 Use Get Status on Order 9. else if the user selects Send Catalog then 12.1 Use Send Catalog 10.else if the user selects Contact Customer Service then 13.1 Use Register Complaint 11.else if the user selects Run Sales Report and user is a Customer Rep then 14.1 Use Run Sales Report end if 12.The user will select a function end loop 13.The Use Case ends Figure 122: Display Main Screen Subordinate Use Case
151
1. 2. 3. 4.
The Use Case starts when a Place Order request is received. The system displays the Place Order Screen The customer enters their name and address. The customer enters product codes for products they wish to order 5. For each product code entered 4.1 The system requests product information from Product Info. 4.2 The system adds the price of the item to the total. end 6. The customer enters credit card payment information. 7. The customer selects submit. 8. The system veries the information. 9. The system marks the order pending. 10.The system asks the Database to save the order. 11.The System asks Money Handling to update the user account 12.The system marks the order conrmed 13.The system asks the Database to update the order. 14.The system displays an order id to the customer, and the use case ends. Alternative Flow of Events At any time before selecting submit, the customer can select cancel. The order is not saved and the use case ends. Figure 123: Place Order Subordinate Use Case
152
CHAPTER 7
1. The Use Case starts when a return product request is received. 2. Use Search for Order. 3. The system will display the selected order in the Return Products Screen. 4. The customer rep will select the products to return. 5. The customer rep will select submit. 6. The system will request Money Handling to Update the user account. 7. The system will request Product Info to Update Product Quantities. 8. The system will request the Database to update the order. 9. The system will display an acknowledgment and the Use Case ends. Figure 124: Return Product Subordinate Use Case
1. 2. 3. 4. 5.
The Use Case starts when a Find Order request is received. The system displays the nd order screen. The user enters an order id or name and address. The user selects search. If the user entered a name and address 5.1 The system will ask the database for a list of orders for the customer. 5.2 The system will display a list of orders for that customer, including at least an order id and date of order 5.3The user will select one order end if 6. The system asks the Database for an order record 7. The system returns an order id and the Use Case ends. Figure 125: Search for Orders Subordinate Use Case
153
1. 2. 3. 4. 5.
The Use Case starts when a Cancel Order request is received. Use Search for Order. The system will display the cancel order screen for that order. The customer will select Cancel. If the order has not been shipped 5.1 The system will request Money Handling to Update the user account. 5.2 The system will mark the order cancelled 5.3 The system will request the Database to update the order else 6. Display Return Policies Screen end if 7. The Use Case ends. Figure 126: Cancel Orders Subordinate Use Case
1. The Use Case starts when a get status request is received.. 2. Use Search for Order. 3. The system will display the order status screen and the Use Case ends. Figure 127: Get Status on Order Subordinate Use Case
1. 2. 3. 4. 5.
The Use Case starts when a send catalog request is received. The catalog order screen is displayed. The user enters a name and address The user selects submit The system creates an order with a product of catalog and no charges 6. The system requests the Database to save the order 7. The Use Case ends. Figure 128: Send Catalog Subordinate Use Case
154
CHAPTER 7
1. The Use Case starts when a request to contact customer service is received. 2. The message screen is displayed. 3. The user enters text. 4. The user selects submit. 5. The system sends the text entered in an email message to the customer support manager and the Use Case ends. Figure 129: Register Complaint Subordinate Use Case
1. 2. 3. 4. 5. 6.
The Use Case starts a run sales report request is received. The choose report screen is displayed. The user selects a report. The user selects submit. The system requests sales data from the database. The system displays the report and the Use Case ends. Figure 130: Run Sales Report Subordinate Use Case
155
1. The Use Case starts when the clerk starts the ll and ship order application. 2. The system displays the ll order screen 3. The system requests the Database for a list of conrmed orders, by order id. Continue on next page Figure 133: Fill and Ship Order Subordinate Use Case
156
CHAPTER 7
4. While the clerk selects an order 4.1 The system requests the Database for the order. 4.2 The system displays the order 4.3 for all the items in the order 4.3.1 The system requests stock on hand information from Product Info 4.3.2 The system displays stock on hand information for the item 4.3.3 if the item is out of stock 4.3.3.1 The system marks the item backordered. 4.3.3.2 The system requests Product Infor backorder the items. 4.3.3.3 The order is marked backorders end if end loop
4.4 If there are items which are not backordered and not shipped then 4.4.1 for each such item 4.4.1.1The system requests Product Info to update product quantities. 4.4.1.2 The system will Print item and quantity on packing slip 4.4.1.3 The system will mark the item shipped end loop 4.4.2 If all items are marked shipped 4.4.2.1 The system will mark the order shipped end if 4.4.3 The system calculates postage due 4.4.4 The system prints a mailing label with the shipping address and postage due 4.4.5 The system sends a notice to the shipping co that packages are ready to be picked up end if 4.5 The system requests the Database to update the order
end loop 5. The Use Case ends Figure 134: Fill and Ship Order Subordinate Use Case (cont)
157
Manage Orders
1. The Use Case begins when Manage Orders requests that an account be updated. 2. The system will send credit card info and amount of credit or debit to the Accounting System. 3. The Accounting System will send a status of OK. 4. The Use Case ends. Figure 137: Update User Account Subordinate Use Case
158
CHAPTER 7
Database Subsystem
This subsystem contains the data we need to store for the application. It provides standard store, retrieve, update, and delete functions for the data that is stored.
System Access
Save Order
Manage Orders
Update Order
Get Order
159
Database Architecture
Database Facade GetUserRecord (Username) SaveOrder (Order) UpdateOrder (Order) GetOrderList (Customer Info) GetOrder (Order Id) GetSalesData (month) GetSalesData (territory) GetOrderList (confirmed)
Figure 140: Database Facade