Use Cases - lagecamp/CMPUT301W13T02 GitHub Wiki
Ryan
Participating Actors: Chef
Goal: Create and Store a recipe in the database
Trigger : Chef chooses the ‘Add’ option in the Recipe Finder Screen
Precondition: Chef knows the recipe
Postcondition: On success, recipe is stored in the database
Basic Flow
- System displays ‘add recipe’ prompt
- Chef enters recipe information includes ingredients, photo, title and procedure
- Selects ‘done’
- System displays a preview of the recipe
- Chef confirms yes/no
- System stores recipe in the database
- Close the prompt
Exceptions
For steps 1-5 Chef can go back to previous step
3 If there are one or more empty fields
3.1 system displays error
3.2 system returns to step 2
5 Chef selects ‘no’
5.1 system returns to step 2
Tests
1.Try to add a valid new recipe and verify it was stored
2.Try to add a recipe that contains errors and verify the system rejects it
(this use case has been changed in March, 16th in order to contemplate new user stories)
Name: EditRecipe
Participating Actors: Chef
Goal: Chef edits the recipe
Trigger: Chef chooses the “Edit” option on the recipe’s page
Precondition: Chef knows what he/she wants to change about the recipe
Postcondition: On success, the the recipe is changed
Basic Flow
- System Displays “Edit Recipe” prompt
- Chef edits the desired attributes of the recipe such as the ingredients, procedure, image.
- Chef selects “save”
- System checks if the recipe is stored on the server. If it is, it creates a copy of the recipe and stores the changes only locally. The “chef” won’t be able to publish this recipe.
- If the recipe is not on the server, system stores the newly edited recipe in database
- System returns to the recipe’s page
Exceptions
2 . 1 Chef may select to go back to previous screen
2 . 1 Chef may select to upload a photo from the phone’s database or remove an existing photo
3 . 1 If there are one or more empty fields the system prompts an error and then returns to step 2
Tests
- Try to edit a recipe and verify that it was changed and stored
- Try to add a recipe with fields missing and verify that an error prompt occurs
- Check if changes to a recipe that has been downloaded from the server will remain local
Name: DeleteRecipe
Participating Actors: Chef
Goal: To delete the recipe that is no longer wanted
Trigger: Chef chooses the “Delete” option from the recipe’s page
Precondition: Chef has selected which recipe he/she wants to delete
Postcondition: On success, the recipe is deleted from the database
Basic Flow
- System prompts a warning
- Chef confirms yes/no to delete recipe
- System deletes recipe from database
- System closes the prompt and refreshes the recipe list.
Exceptions
2 If chef selects no
2 . 1 System returns to main screen
Tests
- Try to delete a recipe from the database and confirm that it was deleted
- Try to delete a recipe but click no, to confirm that the recipe is not deleted
Name: ShareRecipe
Participating Actors: Chef
Goal: Chef sends the recipe by email to a friend
Trigger: Chef chooses the “Share” option from the recipe’s page
Precondition: Chef knows where he/she wants to send the recipe
Postcondition: On success, the recipe is sent to the specified email
Constraints: Chef has access to the internet
Basic Flow
- System displays ‘Share Recipe’ prompt
- Chef enters information including email address and additional comments
- Chef selects ‘Send’
- System displays ‘Confirm Send?’ prompt
- Chef confirms yes/no
- System sends the specified recipe and the additional comments to the email
- System returns to recipe list
Exceptions
5 Chef selects ‘no’
5 . 1 System returns to step 2
3 Email address field is empty or invalid
3 . 1 System displays an error prompt
3 . 2 System returns to step 2
Tests
1.Try to send a recipe and verify it was sent to email along with any additional comments
- Try to send a recipe with invalid email address and verify that the system rejects it
Participating Actors: Chef
Goal: To upload the recipe
Trigger: Chef chooses “Publish” the button
Precondition: Chef has the ownership of that recipe
Postcondition: On success, the recipe will be uploaded to the server
Constraints: Chef has access to the internet
Basic Flow
- Chef clicks on the recipe entry
- Chef clicks “Publish” button
- System uploads the recipe to the server
- System close the prompt and display a success message
Exceptions
For steps 1-4, chef can go back to the previous step
2 If the recipe’s author is not the chef’s
2.1 the Publish button will be disabled
4 If the upload is not successful 4.1 System display error messages 4.2 System goes back to step 2
Tests
- Try to upload a recipe written by the chef to verify if it can be successfully uploaded
- Try to upload a recipe not owned by the chef to verify if the system can respond correctly
- Try to upload a recipe and abort it before confirmation to see if the system can respond correctly
- Try to upload a recipe without a internet connection to see if the system can show error message correctly
Participating Actors: Chef
Goal: To search the recipe by ingredient
Trigger: Chef clicks the “Search” button
Precondition: Chef put some ingredients’ name in the search box and choose some search options
Postcondition: On success, a list of matched recipes will be shown
Qualities: The search should take less than 3 seconds
Constraints: Chef should have access to internet if he/she wanted to search the online database.
Basic Flow
- Chef puts the names of some ingredients in the search box
- Chef chooses the search options (search locally/ from the internet/ by my ingredients)
- Chef clicks the search button
- System display a list of matched recipes
- System also caches results for more efficient searching next time.
Exceptions
4 If no matched recipes
4.1 display “Sorry, we didn’t find the recipes you want”
4 If no options is selected
4.2 system displays error message and go back
Tests
- Try to search with different options and verify it displays the expected results
- Try to search by some ingredient that not exist in the database see if the system can display the correct message for the chef
Name: DownloadRecipe
Participating Actors: Chef
Goal: Chef downloads a new recipe to phone
Trigger: Chef chooses the “Download Recipe” option after selecting a recipe from the search results
Precondition: Chef knows what recipe he/she wants to download
Postcondition: On success, the recipe is added to the phone’s database
Constraints: Chef has access to the internet
Basic Flow
- System displays ‘Confirm Download?’ prompt
- Chef confirms yes/no
- System stores recipe in the phone’s database
- Close the prompt
Exceptions
2 Chef selects ‘no’
2.1 system returns to search results
Tests
1.Try to add a new recipe and verify it was stored
2.Try to add a recipe that contains errors and verify the system rejects it
Name: AddIngredient
Participating Actors: Chef
Goal: Chef adds a new ingredient
Trigger: Chef chooses the “Add” option from the “My Kitchen” page
Precondition: Chef knows what ingredient he/she wants to add
Postcondition:On success, the ingredient is added to the database
Basic Flow
- System Displays “Add Ingredient” prompt
- Chef types in the desired ingredient attributes (Name, Amount)
- Chef selects “save”
- System stores the newly created ingredient in database
- Closes Prompt
Exceptions
2.1 Chef may select to go back to previous screen
3.1 If there are one or more empty fields the system prompts an error and then returns to step 2
Tests
- Try to add an ingredient and verify that it was stored to the database
- Try to add an ingredient with fields missing and verify that an error prompt occurs
Participating Actors: Chef
Goal: To delete the ingredient that no longer wanted
Trigger: Chef clicks the “delete” button on the top of the “My Kitchen” page
Precondition: Chef has already selected some ingredients by the check box
Postcondition: On success, selected ingredients are deleted from the database
Basic Flow
- Chef check the check box after the ingredient to be deleted
- Chef click the Delete button
- System prompts a warning
- Chef confirms
- Selected ingredients are deleted
- Close the prompt and refresh the ingredients list.
Exceptions
For steps 1-3 chef can go back to previous step
3 If chef selects no
3.1 close the prompt
3.2 system returns to step 2
Tests
- Try to delete several ingredient and verify if it was deleted from the database and the if the ingredient list is refreshed
- Try to click the Delete button and select no to see if the system can go back
Name: EditIngredient
Participating Actors: Chef
Goal: Chef edits the ingredient
Trigger: Chef chooses the “Edit” option from the specified ingredient’s page
Precondition: Chef knows what he/she wants to change about the ingredient
Postcondition:On success, the ingredient is changed
Basic Flow
- System Displays “Edit Ingredient” prompt
- Chef edits the desired ingredient attributes (Name, Amount)
- Chef selects “save”
- System stores the newly edited ingredient in database
- Closes Prompt
Exceptions
2.1 Chef may select to go back to previous screen 3.1 If there are one or more empty fields the system prompts an error and then returns to step 2
Tests
- Try to edit an ingredient and verify that it was changed and stored
- Try to add an ingredient with fields missing and verify that an error prompt occurs
Participating Actors: Chef
Goal: To search the Chef’s database of ingredients and find a certain ingredient
Trigger: Chef clicks the “Search” button in the “My Kitchen” page
Precondition: Chef knows which ingredient he/she is looking for
Postcondition: On success, a list of matched ingredients will be displayed
Qualities: Search should take less than 3 seconds
Constraints: Search occurs within the phone’s database of ingredients. (No need for access to internet)
Basic Flow
- System displays search prompt for ingredients
- Chef types relevant keywords into the search box
- Chef clicks “Search”
- System displays a list of matched ingredients
- Chef clicks on the ingredient he/she was looking for
Exceptions
4 If no matched recipes
4.1 display “Sorry, we didn’t find the recipes you want”
4 If field is left blank
4.1 Display “Please enter a keyword”
Tests
- Try to search with different keywords and verify that the correct items appear
- Try to search by some ingredient that not exist in the database see if the system can display the correct message for the chef.
- Try to search with nothing in the text field and verify that the system displays an error prompt
Participating Actors: Chef, Server
Goal: Comment on an existing recipe that is stored in the server
Trigger : Chef fills the ‘Comments’ textbox when viewing a recipe that is stored in the server and presses ‘OK’
Precondition: Chef is viewing a recipe that is stored in the server
Postcondition: On success, the new comment will be added to the recipe on the server
Basic Flow
- System sends the comment and the recipeID to the server
- Server receives request and process it
- Server returns result to system
- System displays the new comment at the bottom of the screen, right after the comments that other Chefs may also have provided
Exceptions
For steps 1-5 Chef can go back to previous step
1 If the comment is empty
1.1 System will display an error message to the Chef
1.2 Nothing will be sent to the server; the screen will not be changed
3 Server returns an error
3.1 System will display an error message to the Chef
3.2 Nothing will be sent to the server; the screen will not be changed
Tests
- Try to add a valid comment and verify that the system accepts it
- Try to add a comment without being connected to the network and verify if the application returns an error
- Try to add a comment to a recipe that doesn’t exist and check if the server returns an error
Participating Actors: Chef
Goal: Browse a recipe from email
Trigger : Chef click the button “Import” in the main view
Precondition: Chef knows where the e-mail want to import is
Postcondition: On success, a new recipe will be created based on the content of the e-mail imported.
Basic Flow
- System pops up a prompt for selecting the e-mail to import.
- Chef chooses the e-mail he want to import and click “OK” button.
- System closes the prompt.
- System process the e-mail selected and parse it into a recipe
- System give the Chef a preview of the new recipe
- Chef click “OK”.
- System closes the preview and adds the new recipe to the local database
- System refreshes the recipe list in main view
Exceptions
For steps 1-5 Chef can go back to previous step
- Chef selects “Cancel” 1.1 System returns to the main view
- System can’t parse the imported e-mail 1.1 System prompts “Can’t parse the imported e-mail” 2.2 System returns to the main view
- Chef selects “Cancel” 1.1 System returns to the main view
Tests
- Try to import an e-mail with correct format to see if the system can correct import it.
- Try to import an e-mail with incorrect format to see if the system can reject it properly.
Participating Actors: Chef
Goal: Browse the Recipes with their photos
Trigger : Chef click the button “Photos”
Precondition: Chef wants to browse the recipes with photos
Postcondition: On success, the recipes are presented in their photos
Basic Flow
- System change the main view to a list of recipes’ photos
- Chef click one photo
- System changes the view to the details of this recipes
Exceptions
For steps 1-3 Chef can go back to previous step
Tests
1.Try to click the button to verify if it can enter the photo browsing model 2.Try to click one photo to verify if the system can enter the correct recipe view
Participating Actors: Chef
Goal: Search the web for the most popular recipes
Trigger : Chef chooses the ‘Search’ button
Precondition: Chef has selected the ‘Most Popular’ checkbox
Postcondition: On success, a list of the most popular recipes is shown
Basic Flow
1 Chef puts some keywords into the search box (optional - will limit list to recipes containing keywords ranked by popularity)
2 Chef chooses the ‘Most Popular’ option
3 Selects ‘Ok’
4 System displays the recipes with recipes that have been downloaded the most appearing first
Exceptions
For steps 1-4 Chef can go back to previous step
4 If there are no matched recipes
1 system displays “Sorry, no recipes matching your keywords were found”
Tests
Try to search and ensure that the most popular recipes are shown (could make the download counter variable visible to verify)
Participating Actors: Chef
Goal: Organize ingredients into folders
Trigger : Chef chooses the ‘New Folder’ button
Precondition: Chef is in the MyKitchen view
Postcondition: On success, a new folder with a specified name is created
Basic Flow
1 Chef enters a name for the new folder
2 Chef selects ok
3 System creates a new folder with the given name and displays it in the ingredients list
4 Chef moves ingredients into the folder by selecting and dragging recipes over the folder
Exceptions
For steps 1-3 Chef can go back to previous step
2 The folder name was left empty
1 system displays “Error: You cannot create a folder without a name”
Tests
- Try to create a folder in MyKitchen
- Try to move recipes into the folder