Use Cases - lagecamp/CMPUT301W13T02 GitHub Wiki

Ryan

Use Case 1: AddRecipe

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

  1. System displays ‘add recipe’ prompt
  2. Chef enters recipe information includes ingredients, photo, title and procedure
  3. Selects ‘done’
  4. System displays a preview of the recipe
  5. Chef confirms yes/no
  6. System stores recipe in the database
  7. 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

Use Case 2: EditRecipe

(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

  1. System Displays “Edit Recipe” prompt
  2. Chef edits the desired attributes of the recipe such as the ingredients, procedure, image.
  3. Chef selects “save”
  4. 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.
  5. If the recipe is not on the server, system stores the newly edited recipe in database
  6. 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

  1. Try to edit a recipe and verify that it was changed and stored
  2. Try to add a recipe with fields missing and verify that an error prompt occurs
  3. Check if changes to a recipe that has been downloaded from the server will remain local

Use Case 3: DeleteRecipe

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

  1. System prompts a warning
  2. Chef confirms yes/no to delete recipe
  3. System deletes recipe from database
  4. System closes the prompt and refreshes the recipe list.

Exceptions

2 If chef selects no

2 . 1 System returns to main screen

Tests

  1. Try to delete a recipe from the database and confirm that it was deleted
  2. Try to delete a recipe but click no, to confirm that the recipe is not deleted

Use Case 4: ShareRecipe

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

  1. System displays ‘Share Recipe’ prompt
  2. Chef enters information including email address and additional comments
  3. Chef selects ‘Send’
  4. System displays ‘Confirm Send?’ prompt
  5. Chef confirms yes/no
  6. System sends the specified recipe and the additional comments to the email
  7. 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

  1. Try to send a recipe with invalid email address and verify that the system rejects it

Use Case 5: PublishRecipe

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

  1. Chef clicks on the recipe entry
  2. Chef clicks “Publish” button
  3. System uploads the recipe to the server
  4. 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

  1. Try to upload a recipe written by the chef to verify if it can be successfully uploaded
  2. Try to upload a recipe not owned by the chef to verify if the system can respond correctly
  3. Try to upload a recipe and abort it before confirmation to see if the system can respond correctly
  4. Try to upload a recipe without a internet connection to see if the system can show error message correctly

Use Case 6: SearchRecipe

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

  1. Chef puts the names of some ingredients in the search box
  2. Chef chooses the search options (search locally/ from the internet/ by my ingredients)
  3. Chef clicks the search button
  4. System display a list of matched recipes
  5. 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

  1. Try to search with different options and verify it displays the expected results
  2. Try to search by some ingredient that not exist in the database see if the system can display the correct message for the chef

Use Case 7: DownloadRecipe

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

  1. System displays ‘Confirm Download?’ prompt
  2. Chef confirms yes/no
  3. System stores recipe in the phone’s database
  4. 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

Use Case 8: AddIngredient

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

  1. System Displays “Add Ingredient” prompt
  2. Chef types in the desired ingredient attributes (Name, Amount)
  3. Chef selects “save”
  4. System stores the newly created ingredient in database
  5. 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

  1. Try to add an ingredient and verify that it was stored to the database
  2. Try to add an ingredient with fields missing and verify that an error prompt occurs

Use Case 9: DeleteIngredient

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

  1. Chef check the check box after the ingredient to be deleted
  2. Chef click the Delete button
  3. System prompts a warning
  4. Chef confirms
  5. Selected ingredients are deleted
  6. 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

  1. Try to delete several ingredient and verify if it was deleted from the database and the if the ingredient list is refreshed
  2. Try to click the Delete button and select no to see if the system can go back

Use Case 10: EditIngredient

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

  1. System Displays “Edit Ingredient” prompt
  2. Chef edits the desired ingredient attributes (Name, Amount)
  3. Chef selects “save”
  4. System stores the newly edited ingredient in database
  5. 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

  1. Try to edit an ingredient and verify that it was changed and stored
  2. Try to add an ingredient with fields missing and verify that an error prompt occurs

Use Case 11: SearchIngredient

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

  1. System displays search prompt for ingredients
  2. Chef types relevant keywords into the search box
  3. Chef clicks “Search”
  4. System displays a list of matched ingredients
  5. 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

  1. Try to search with different keywords and verify that the correct items appear
  2. Try to search by some ingredient that not exist in the database see if the system can display the correct message for the chef.
  3. Try to search with nothing in the text field and verify that the system displays an error prompt

Use Case 12: CommentRecipe

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

  1. System sends the comment and the recipeID to the server
  2. Server receives request and process it
  3. Server returns result to system
  4. 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

  1. Try to add a valid comment and verify that the system accepts it
  2. Try to add a comment without being connected to the network and verify if the application returns an error
  3. Try to add a comment to a recipe that doesn’t exist and check if the server returns an error

Use Case 13: ImportRecipeFromEmail

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

  1. System pops up a prompt for selecting the e-mail to import.
  2. Chef chooses the e-mail he want to import and click “OK” button.
  3. System closes the prompt.
  4. System process the e-mail selected and parse it into a recipe
  5. System give the Chef a preview of the new recipe
  6. Chef click “OK”.
  7. System closes the preview and adds the new recipe to the local database
  8. System refreshes the recipe list in main view

Exceptions

For steps 1-5 Chef can go back to previous step

  1. Chef selects “Cancel” 1.1 System returns to the main view
  2. 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
  3. Chef selects “Cancel” 1.1 System returns to the main view

Tests

  1. Try to import an e-mail with correct format to see if the system can correct import it.
  2. Try to import an e-mail with incorrect format to see if the system can reject it properly.

Use Case 14: BrowseRecipesWithPhotos

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

  1. System change the main view to a list of recipes’ photos
  2. Chef click one photo
  3. 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

Use Case 15: BrowsePopularRecipes

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)

Use Case 16: OrganizeIngredients

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

  1. Try to create a folder in MyKitchen
  2. Try to move recipes into the folder
⚠️ **GitHub.com Fallback** ⚠️