Use Cases - CMPUT301F13T13/StoryHoard GitHub Wiki

Navigation:

Use Case 1: addStory

Use Case Name
addStory

Actors
Author

Goal
Create a new story.

Trigger
Author chooses a "create new story" option on the menu

Precondition
Author knows what to call the story and what text to write for the first chapter.

Postcondition
On success, the story will be created and added to local storage. The story will also have one chapter.

Includes
addChapter

Basic Flow

  1. Author chooses "create new story" option
  2. System prompts author for title.
  3. Author inputs title name.
  4. System prompts author for creation of first chapter (addChapter use case)
  5. Author adds the chapter.
  6. System presents author with option to add another chapter.
    6.1 Author adds 0..* other chapters (add chapter use case).
  7. System prompts author with choice to publish story or not.
    7.1 Author chooses to publish story (publishStory use case).
  8. System saves story to local storage

Test Cases

  1. Try creating a story (Title, author, description, phone Id).
    JUnit Test Class: TestStoryManager Method name: testAddLoadStory()

Use Case 2: addChapter

Use Case Name
addChapter

Actors
Author

Goal
Author's story will have a chapter added to the story

Trigger
Author clicks on new chapter button in add/edit choice mode Author creates a new story

Precondition
If adding through choice, the story must already have been added(been through case 1), and must be in add or edit choice mode

Postcondition
On success, the chapter will be save to the story in the author selected database

Basic Flow

  1. System prompts Author to type new chapter text
  2. Author inputs and presses save
  3. System saves story to authors desk
    3.1 if the story has been published then system prompts author to confirm publish changes
    3.2 system saves to library

Test Cases

  1. Create a new chapter.
    JUnit Test Class: TestChapterManager Method Name: testAddLoadChapter()
    JUnit Test Class: TestChapter

Use Case 3: addChoice

Use Case Name
addChoice

Actors
Author

Goal Selected chapter will have a choice added.

Trigger
Author clicks on add choice button

Precondition
The story must already have been added(been through case 1).
Story must have a chapter to add choices to.

Postcondition
On success, the choice will be added to chapter and it should lead to a different chapter upon clicking it.

Basic Flow

  1. System prompts Author to type new choice
  2. System prompts Author to choose chapter to link

Test Cases

  1. Create a new choice for a chapter.
    JUnit Test Class: TestChoiceManager Method name: testSaveLoadChoice()
    JUnit Test Class: TestChoice

Use Case 4: browseAuthorsOwnStories

Use Case Name
browseAuthorsOwnStories

Actors
Author

Goal
Author's will view his/her own stories

Trigger
Author chooses to view authored/created stories button in menu

Precondition
Author must have written a story

Postcondition
On success, stories made by the author will be displayed

Basic Flow

  1. Author chooses to view authored/created stories
  2. System displays created stories.

Test Cases

  1. Try browsing authored/created stories when author does not have any stories.
  2. Try browsing authored/created stories when author has made a story.
    For the above two tests:
    JUnit Test Class: TestStoryManager. Method Name:testGetAllAuthorStories()

Use Case 5: browseChapters

Use Case Name
browseChapters

Actors
Author, user

Goal
Author/user is able to view all chapters of a story.

Trigger
Author adds a new choice to a chapter and chooses to link an existing chapter.
Author/user chooses to view all the chapters of a story when reading any chapter of the story.

Precondition
Author must have created a story.
Story must have a chapter that author can link to current chapter. This chapter must be different than current chapter.

Postcondition
Author can view all chapters created.

Basic Flow

  1. Author chooses to add a new choice to a chapter OR user/author chooses to view all chapters of a story.
  2. System displays a list of all chapters for user to choose from.

Test Cases

  1. Try viewing all the chapters of a story.
    JUnit Test Class: TestChapterManager Method Name: testGetAllChapters()
    [JUnit Test Class: TestViewBrowseChapters]
    (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestViewBrowseChapters.java)

Use Case 6: readStory

Use Case Name
readStory

Actors
User

Goal
The story text data and option to view the initial chapter will be displayed.

Trigger
User clicks on the story to view.

Precondition
There must be a story to read.
Story must be cached or user must be connected to the server.

Postcondition
On success, the story text and initial chapter option will be displayed

Basic Flow

  1. User selects a story to view.
  2. If valid connection to server, or cached story, system displays the story data and initial chapter option upon sucess.

Test Cases
[JUnit test class: TestViewStory] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestViewStory.java).

  1. readStory on a Story identifier returns the proper story data for the story identifier
  2. displays the proper chapter for the story identifier
    For the above two tests:
    JUnit Test Class: TestStoryManager. Method name: testAddLoadStory()

Use Case 7: readChapter

Use Case Name
readChapter

Actors
User

Goal
Be able to read a chapter. This includes viewing the text and choices of the chapter.

Trigger
User begins reading the first chapter of a story.
User "turns" a page in a story by selecting a choice when reading a story.

Precondition
There must be a story.
There must be a chapter to read in the story (i.e. one has to be created first).

Postcondition
User is presented with the chapter's text and choices.

Basic Flow

  1. Either begins reading a story's first chapter or selects one of the chapter's choices.
  2. System displays the next chapter's text and choices.

Test Cases
[JUnit test class: TestViewChapter] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestViewChapter.java).

  1. Try reading a chapter with no media in a story. JUnit test class: TestChapterManager. Method Name: testAddLoadChapter()

Use Case 8: editStory

Use Case Name
editStory

Actors
Author

Goal
Author's story is edited and changes are saved.

Trigger
Author chooses option to edit a story of theirs.

Precondition
The story must already exist (added through use case 1).

Postcondition
On success, the changes to the story will be saved locally and online (if the story was also published).

Basic Flow

  1. Author selects a story to edit.
  2. Author makes edits.
  3. System saves changes to database.

Test Cases
[JUnit Test Class: TestEditStoryActivity] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestEditStoryActivity.java)

  1. Try editing story by changing its description, title, and author.
    JUnit Test Class: TestStoryManager Method name: testEditStory()
  2. Try editing a story that was published.
    [JUnit Test Class: TestServerManager] (https://github.com/CMPUT301F13T13/StoryHoard/blob/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestServerManager.java) Method Name: testUpdateStory()

Use Case 9: editChapter

Use Case Name
editChapter

Actors
Author

Goal
Change the text of a chapter

Trigger
Author presses edit button

Precondition
Must be in the chapter to edit it

Postcondition
Edits will be saved

Basic Flow

  1. System load the chapter for Author to edit
  2. Author makes edits and presses save
  3. Systems saves edits

Test Cases

  1. Edit a chapter's text and choices.
    JUnit Test Class: TestChapterManager Method name: testUpdateChapter()

Use Case 10: editChoice

Use Case Name
editChoice

Actors
Author

Goal
Author's story will have a choice edit saved

Trigger
Author clicks on choice button while in edit mode

Precondition
The story must already have been added(been through case 1)

Postcondition
On success, the choice will be save to the story in the author selected database

Basic Flow

  1. System prompts Author to type new choice
  2. System prompts Author to choose new chapter
  3. Author presses save

Test Cases

  1. Author presses save and new choice text is saved
  2. Author presses save and new chapter is linked
    For the above two tests:
    JUnit Test Class TestChoiceManager.java Method name: testEditChoice()
    [JUnit Test Class: TestEditChoiceActivity] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestEditChoiceActivity.java)

Use Case 11: addIllustrations

Use Case Name
addIllustrations

Actors
Author

Goal
Author's story will have illustrations added

Trigger
Author chooses to upload an illustration when viewing a chapter.

Precondition
The story must already have been added(been through case 1) The story must contain a chapter to add an illustration to.

Postcondition
On success, the media will be saved to the story in local storage.

Basic Flow

  1. Author reads a fragment and chooses to add an illustration.
  2. System prompts Author to upload illustration.
  3. Author uploads illustration.
  4. System saves story to local storage.
    3.1 if the story has been published then system prompts author to confirm publish changes
    3.2 system saves to server.

Test Cases

  1. Author uploads proper illustration, presses save, and story is saved to system with uploaded illustration.
  2. Author uploads proper illustration, doesn't press save, and the story remains as it was prior to author clicking illustration button.
  3. Author uploads improper illustration, presses save, and story is saved without the improper uploaded illustration.
  4. Author neglects to upload illustration, presses save, and story remains as it was prior to clicking illustration button.
    For the above four tests:
    JUnit Test Class: TestMediaManager Method name: testAddLoadImage()

Use Case 12: viewIllustrations

Use Case Name
viewIllustrations

Actors
User

Goal
View the illustrations of a chapter.

Trigger
User reads a chapter.

Precondition
The chapter must have at least one illustration.

Postcondition
User will be shown all the illustrations associated with the chapter.

Basic Flow

  1. User chooses to view all illustrations of a chapter.
  2. System displays the illustrations.

Test Cases

  1. Try displaying the illustrations of a chapter.
    JUnit Test Class: TestMediaManager Method name: testAddLoadImage()
    JUnit Test Class: TestMediaManager Method name: testGetMediasByChapter()

Use Case 13: removeIllustration

Use Case Name
removeIllustrations

Actors
Author

Goal
Author's story will be able to delete Illustrations and upload a new one.

Trigger
Author chooses to delete an illustration while editing a chapter.

Precondition
The story must already have been added(been through case 1)
The story must have a chapter to edit.
The chapter must have an illustration.

Postcondition
On success, the illustration will be deleted, and any new illustration added will be saved.

Basic Flow

  1. System prompts Author to upload media
  2. Author uploads.
  3. System saves story locally.
    3.1 if the story has been published then system prompts author to confirm publish changes
    3.2 system saves to server

Test Cases

  1. Author chooses to remove illustration in editing mode.
  2. Author deletes an illustraion , publishes changes, downloads again to make sure changes persisted. (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestMediaManager.java) Method name: testSyncDeletion

Use Case 14: takePhoto

Use Case Name
takePhoto

Actors
User

Goal
User will take a photo to upload to a chapter.

Trigger
User clicks on new camera button when viewing a chapter.

Precondition
The story must already have been added (through case 1)
The story must have a chapter to add a photo to.

Postcondition
On success, a photo will be taken and added as media to the chapter

Basic Flow

  1. User chooses to upload a photo from camera when viewing a chapter.
  2. System loads camera app
  3. User takes photo
  4. System prompts author to confirm photo
  5. User select yes or no or cancel
    5.1 if no go back to 2
    5.2 if cancel return to viewing chapter
    5.3 if yes, system saves photo to chapter as annotation.

Test Cases

  1. Try taking a photo to upload to a chapter.
  2. Try retaking the photo. For the above two tests:
    [JUnit Test Class: TestEditChapterActivity] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestEditChapterActivity.java)
    [JUnit Test Class: TestMediaManager] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestMediaManager.java) Method Name: testAddLoadImage()

Use Case 15: postPhotos

Use Case Name
postPhotos

Actors
User

Goal
User will post a photo to a chapter with a text comment.

Trigger
User chooses to post a photo to a chapter when viewing a chapter.

Precondition
User has a valid photo to add to the story chapter.
Story allows photos to be added.
There must be a story with a chapter to add photos to. The story must have been downloaded / be stores in local storage.

Postcondition
Photo with text comment is added to the story chapter.

Basic Flow

  1. User browses a certain chapter of a story.
  2. User sends intent to upload photo.
  3. User selects a photo to upload to the chapter, be it captured from the camera or loaded from local storage.
  4. Photo is uploaded to chapter and displayed appropriately within the chapter.

Test Cases

  1. Take a photo and post it to a chapter.
  2. Browse gallery for a photo to post. For the above three tests, taking and browsing the gallery are not tested, but saving and retrieving an image within a media object is:
    JUnit Test Class: TestMediaManager Method name: testAddLoadImage()

Use Case 16: publishStory

Use Case Name
publishStory

Actors
Author, Server

Goal
Author's story is published on server for other users to read.

Trigger
Author chooses a "publish story" option either when creating the story or editing it.

Precondition
There must be a story to publish (added through use case 1), and must currently be unpublished.

Postcondition
On success, the story will be added to the server for other users to see and download.

Basic Flow

  1. System prompts Author to confirm publishing
  2. Author confirms publishing it
  3. System saves story (as associated chapters and media) to server.

Test Cases

  1. When creating a story, choose to publish it. Check if story is properly saved to server by searching for it.
  2. When editing a story, choose to publish it. Check if story is properly saved to server by searching for it.
    For the above two tests:
    JUnit Test Class: TestServerManager Method Name: testUploadRetrieveStory()

Use Case 17: viewPhotos

Use Case Name
viewPhotos

Actors
User

Goal
View all the photos that have been uploaded to a chapter.

Trigger
When reading a chapter, user chooses to view photos uploaded to that chapter.

Precondition
Story must exist and must have a chapter.
The chapter selected must have photos uploaded to it.

Postcondition
The photos uploaded to that chapter will be displayed to user.

Basic Flow

  1. User chooses a chapter to view.
  2. User chooses to view photos posted to that chapter.
  3. System displays all the photos.

Test Cases

  1. Try viewing the photos to a chapter.
    JUnit Test Class: TestMediaManager Method name: testAddLoadImage()

Use Case 18: browsePublishedStories

Use Case Name
browsePublishedStories

Actors
User

Goal
Display a list of all published stories (from server)

Trigger
User chooses menu option to view published stories

Precondition
User must have internet

Postcondition
On success, the list of published stories will appear

Basic Flow

  1. User chooses menu option to browse published stories.
  2. System displays a list of published stories

Test Cases

  1. Try displaying published stories with no internet
  2. Try displaying published stories when there are none
  3. Try displaying published stories when there are some
    For all three tests:
    JUnit Test Class: TestServerManager. Method Name: testGetAllPublishedStories()
    [JUnit Test Class: TestViewBrowseStories] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestViewBrowseStories.java)

Use Case 19: cacheStory

Use Case Name
cacheStory

Actors
User

Goal
To take the story, available on the server, and make it locally available to read off-line on the device.

Trigger
User chooses a published story to read (will get cached automatically)

Precondition
Defined story is published (exists on server). User has a stable and sufficient connection to the server.

Postcondition
Story is cached onto the local device.

Basic Flow

  1. User specifies intent to cache a story.
  2. Server checks if the story is cacheable.
  3. If cacheable, begin download of story to the local device.
  4. Once download is completed, update necessary local values and mark story as cached (for current date).

Test Cases

  1. Cached story appears in the local storage area with complete story data
  2. Cached dependant chapters appear in local storage area
    For the above test cases:
    JUnit Test Class: TestServerManager. Method Name: testPublishCacheLoadStory()

Use Case 20: browseCachedStories

Use Case Name
browseCachedStories

Actors
User

Goal
User is able to browse all stories they have downloaded (cached).

Trigger
User chooses to browse cached stories from a button

Precondition
User must have downloaded/cached at least one story.

Postcondition
User is able to view all cached stories to later select the one they want.

Basic Flow

  1. User chooses to browse cached stories
  2. System displays all cached stories for user.
  3. User chooses the cached story they want to read

Test Cases

  1. Try browsing cached stories with no stories cached.
  2. Try browsing cached stories having at least one story cached.
    For the above tests:
    JUnit Test Class: TestStoryManager Method name: testCacheAndGetAllCached()
    [JUnit Test Class: TestViewBrowseStories] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestViewBrowseStories.java)

Use Case 21: searchStories

Use Case Name
searchStories

Actors
User

Goal
User is able to search for a story (either cached, published, or one of their own).

Trigger
User inputs a search criteria into a search bar.

Precondition
There must be stories that exist to search through.

Postcondition
User is able to view story / stories that matched their search criteria.

Basic Flow

  1. While browsing stories, user inputs search criteria in a search bar.
  2. System displays all stories that matched search criteria.

Test Cases

  1. Try searching through published stories.
  2. Try searching through author's own stories.
  3. Try searching through cached stories.
  4. Try searching for a story that does not exist.
  5. Try searching for multiple stories (if two stories have the same name).
    For the above tests:
    JUnit Test Class: TestStoryManager MethodName: testSearchStory()
    [JUnit Test Class: TestSearchActivity] (https://raw.github.com/CMPUT301F13T13/StoryHoard/master/StoryHoardTest/src/ca/ualberta/cmput301f13t13/storyhoard/test/TestSearchActivity.java)

#Use Case 22: variedMultimedia (not implemented)

Use Case Name
variedMultimedia

Actors
User, Author

Goal
Users will be able to annotate chapters (fragments) with audio or video elements, along with images.

Authors will be able to add illustrations which are either audio or video elements, along with images.

Trigger
User presses a button to add multimedia annotation, then selects a file to upload.
Author presses a button to add a multimedia illustration, then selects a file to upload.

Preconditions
There must be an existing multimedia file to add.
There must be an available chapter to annotate or add illustrations to.

Postcondition
User is able to view the posted multimedia, whether if it is an annotation or an illustration, within the specified chapter.

Basic Flow
If adding annotations:

  1. User navigates to the specified chapter while reading the the story.
  2. User presses a button, specifing an intent to upload some multimedia file.
  3. User selects the specific multimedia file to upload.

If adding illustraions:

  1. Author navigates to the specified chapter while editing the story.
  2. Author presses a button, specifing an intent to upload some multimedia file.
  3. Author selects the specific multimedia file to upload.

Test Cases

  1. Try to upload core android handleable image files (JPEG, BMP, GIF, PNG) for annotations and illustrations.
  2. Ensure that when viewing the multimedia element, images are displayed properly.
  3. Try to upload major core android handleable audio files (MP3, FLAC, MIDI, Vorbis) for annotations and illustrations.
  4. Ensure that when viewing the multimedia element, audio is played back properly.
  5. Try to upload core android handleable video files (H.263, H.264 AVC, MPEG-4 SP, VP8) for annotations and illustrations.
  6. Ensure that when viewing the multimedia element, video is played back properly.

#Use Case 23: localMirroring

Use Case Name
localMirroring

Actors
User

Goal
User will be able to have a local mirror of a story they got from the server. If the story on the server is deleted, the user will still have their own copy.

Trigger
User reads a published story.

Preconditions
There must be a valid story to mirror on the server.

Postcondition
User will have a local copy of a published story.

Basic Flow

  1. User browses published stories.
  2. User chooses a story to read.
  3. System saves a copy on user's phone.

Test Cases

  1. Read a published story so a copy gets saved on user's phone. Delete the story on the server and verify the user's local copy is intact and can be republished.
    JUnit Test Class: TestStoryManager MethodName: testCacheAndGetAllCached()

#Use Case 24: permissions (not implemented)

Use Case Name
permissions

Actors
Author

Goal
Author will have the ability to set some chapters to read only and its illustrations to read only

Trigger
Author sets chapter to read only

Preconditions
There must be an chapter to set permissions on.

Postcondition
Chapter is set to read only, which includes its illustrations.

Basic Flow

  1. Author creates a chapter or edits an existing one.
  2. Author sets the chapter to read only.
  3. Author saves the changes.

Test Cases

  1. Try setting a chapter to read only status.

#Use Case 25: pickRandomChoice

Use Case Name
pickRandomChoice

Actors
user

Goal
User will have a choice picked for them

Trigger
User pushes random choice button

Preconditions
There must at least one choice and author must have random choice allowed.

Postcondition
A choice will be randomly chosen.

Basic Flow

  1. User pushes the random choice.
  2. System chooses one of the choices at random and looks the next chapter.
    JUnit class: TestChoiceManager Method Name: testRandomChoice()

Test Cases

  1. Create a choice and make sure random choice returns it.

#Use Case 26: pickRandomStory

Use Case Name
pickRandomStory

Actors
user

Goal
User will pick a random published story

Trigger
User pushes random story button on main menu

Preconditions
There must at least one story in published stories

Postcondition
A story will be randomly chosen.

Basic Flow

  1. User pushes the random story button
  2. System chooses one of the random stories in published stories that are not one of their own

Test Cases

  1. Click random story, returns a random story
  2. Click random story when there are no stories available to pick from. Should show a dialog when there are no stories (not including your own) in published stories
    JUnit test class: TestServerManager