1 / 36

Details about Use Cases

Details about Use Cases. This section has been adapted from Dr. Scott Fleming of U. Memphis. What are “fully dressed” use cases?. All steps and variations written in detail Structured template Tend toward the formal However, rough sketching can be useful. http://flic.kr/p/a6qunq.

peers
Download Presentation

Details about Use Cases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Details about Use Cases • This section has been adapted from Dr. Scott Fleming of U. Memphis

  2. What are “fully dressed” use cases? • All steps and variations written in detail • Structured template • Tend toward the formal • However, rough sketching can be useful http://flic.kr/p/a6qunq

  3. “Fully dressed” UC template • UC name • Scope • Level • Primary actor • Stakeholders and interests • Preconditions • Success guarantees • Main success scenario • Extensions (or alternative flows) • Special requirements • Technology and data variations list • Frequency of occurrence • Miscellaneous

  4. Use Cases are a Bundle • Each use case is a bundle of scenarios • Usually include a “main success scenario” and “exception scenarios”

  5. Use Case Name • Start with a verb • Examples: • Read Article • Write Article • Moderate Comment

  6. Scope • Will always be the software system under development for us • Example: • Online Magazine Content Management System • There also business use cases, but we don’t care about them in this class

  7. Level Two levels that we care about: • User-goal level: describes scenarios that fulfill the goals of the primary actor • Most common • Subfunction level: describes substeps to support a user goal • Used to factor out common text from other use cases • Good for handling common use cases like “Log in”

  8. Primary actor • Principal actor that calls upon system services to fulfill a goal • Usually human, but not always

  9. Stakeholders and interests list • “The [system] operates a contract between stakeholders, with the use cases detailing the behavioral parts of that contract… The use case, as the contract of behavior, captures all and only the behaviors related to satisfying the stakeholders’ interests” –Cockburn (2001) • Example stakeholders and interests: • Subscriber: Wants interesting and amusing articles because the subscriber wants to get money’s worth; wants to be involved in a community of like-minded users to discuss topics and provide feedback to the magazine • Editor: Wants high-quality written articles because low-quality articles reduce reader confidence and satisfaction

  10. Stakeholders and interests list • “The [system] operates a contract between stakeholders, with the use cases detailing the behavioral parts of that contract… The use case, as the contract of behavior, captures all and only the behaviors related to satisfying the stakeholders’ interests” –Cockburn (2001) • Example stakeholders and interests: • Subscriber: Wants interesting and amusing articles because the subscriber wants to get money’s worth; wants to be involved in a community of like-minded users to discuss topics and provide feedback to the magazine • Editor: Wants high-quality written articles because low-quality articles reduce reader confidence and satisfaction Contains a Why description!

  11. Preconditions • Things that must always be true be the scenario begins • May imply completion of another UC’s scenario • Examples: • User has logged in • Comment exists in moderation queue • Skip uninteresting or obvious preconditions • Anti-example: Editor has editing experience • Anti-example: Subscriber can use web site

  12. Success guarantees (postconditions) • Things that must be true after the success scenario or some alternative path • Should meet the needs of all stakeholders • Example: • User has access to subscriber-only content • Comment appears in article’s comment thread • Edits to article are saved

  13. Main success scenario • Sequence of steps in a scenario of a successful typical use of the system • Three types of steps: • Interaction between actors • Validation (usually by system) • State change of system (e.g., recording or modifying something) • (Additionally, step 1 may indicate a trigger event) • Most actor actions should have a system response • Defer conditionals to Extensions section • Idiom: capitalize actors names

  14. Main Success Scenario 1:Post Comment on Article • Subscriber access article • System presents article to subscriber, with comments thread • Subscriber presses “Post comment” • System confirms that subscriber is permitted to post comments • System presents text editor • Subscriber enters comment text • Subscriber submits comment • System records subscriber name, date of comment, comment text, and article that was commented on • System posts comment at end of comment thread

  15. Extensions (or alternative flows) • All other scenarios and branches • May end in success or failure • Example: • 1a. Used filtered language [words in the comment text on filtered list] • Subscriber writes word on filtered word list • ??? • System shows the text editor, the error message, “Please do not use these words in your post!”, and the words in the editor highlighted • 1b. Subscriber is banned from posting comments [subscriber is on a “banned from posting” list] • Subscriber presses “Post comment” • System identifies that the subscriber is not permitted to post comments • System shows error message, “You are not allowed to post comments.” • Guideline: write conditions as something that can be detected by system or actor

  16. Extensions (or alternative flows) • All other scenarios and branches • May end in success or failure • Example: • 1a. Used filtered language [words in the comment text on filtered list] • Subscriber writes word on filtered word list • ??? • System shows the text editor, the error message, “Please do not use these words in your post!”, and the words in the editor highlighted • 1b. Subscriber is banned from posting comments [subscriber is on a “banned from posting” list] • Subscriber presses “Post comment” • System identifies that the subscriber is not permitted to post comments • System shows error message, “You are not allowed to post comments.” • Guideline: write conditions as something that can be detected by system or actor Contains the condition Numbering starts at the point from the main success scenario

  17. Extensions (cont’d) • At end, the extension merges back with the main success scenario unless the extension indicates otherwise • Complex extensions might be better expressed as a separate UC • Example: a condition that is possible during any step of the main scenario: • *a. System crashes… • Example: branching to another use case: • 2c. Author performs Edit Article in response to editor feedback

  18. Special requirements • Non-functional requirements relevant to the UC • Ex: Section 508 (web accessibility), HIPAA (health information privacy), etc • Examples: • Every image must have associated alternative text for screen readers • Identifiable information of patients cannot be disclosed to non-employees

  19. Technology and data variations list • Constraints on how to build the system • Typically imposed by the customer • Examples (reference relevant steps): • 4a. System must be compatible with Internet Explorer 8, Chrome 22, Safari 4, and Firefox 17 • 5a. System will present its mobile user interface when accessed using a mobile device with a four inch screen or smaller

  20. How could creating “fully dressed”use cases be useful?(Why write them?)

  21. How could creating “fully dressed”use cases be useful? • Aid for thinking through what to build • Help with detailed planning • Reveal other use cases • ? Documenting requirements ? • ? Communicating with customer ? Project-specific costs/benefitsvery important to consider!

  22. Requirements derived from a Use Case FR 1: Subscriber posts comment FR 1.1: Subscriber can post a comment associated with an article FR 1.2: Every comment appears at the bottom of the article text FR 1.3: Comment stores the comment text, the subscriber name, the comment date of posting, and the associated article identifier FR 1.4: Comments containing offensive words have posting restrictions FR 1.4.1: Comments posted by subscribers may not contain offensive words FR 1.4.2: Comments posted by moderators may contain Offensive Words FR 1.4.3: Offensive words appear on the “offensive words list” This might not be necessary depending on the project.Some developers are good at identifying necessary information from the use case directly.

  23. Consider this motivating example At requirements workshop, an editorsays she needs to “log in to the system” Is he making assumptions about the solution? How might that limit you, as the designer? How can you prevent customersfrom accidentally imposingunnecessary requirements?

  24. Guideline: Write in essential style • Express narrative at level of • user’s intentions and • system’s responsibilities • Avoid UI details!!

  25. What is wrong with this example? • Moderator enters ID and password in dialog box. • System authenticates Moderator • System displays the “edit users” window

  26. What is wrong with this example? • Moderator enters ID and password in dialog box. • System authenticates Moderator • System displays the “edit users” window • Limits possible designs by specifying UI

  27. Here’s an essential-style example • Moderator identifies self. • System authenticates Moderator’s identity. • This version leaves open novel solutions such as hardware authenticators that the other system could not accomodate

  28. Here’s another motivating example Consider a UC step that says “The system generates a SQL INSERT statement for the sale…” What assumptions does the UC make? How might those assumptions limit you? How can you prevent customersfrom accidentally imposingthese sorts of unnecessaryrequirements?

  29. Guideline: Use black-box style • Do not describe internal workings of system • Say what the system does, not how it does it • Think of system in terms of its responsibilities

  30. How might you word this step using black box? • The system generates a SQL INSERT statement for the sale…

  31. How might you word this step using black box? • The system generates a SQL INSERT statement for the sale… • Like this: The system records the sale.

  32. Consider this motivating quote “the software industry is littered with failed projectsthat did not deliver what people really needed”— Larman How can we make sure we deliver what our customers really need?

  33. Guideline: Actor and actor-goal perspective • Write requirements focusing on the users (actors) of a system, asking about their goals and typical situations • Look for different types of users • Focus on understanding what the actor considers a valuable result

  34. We know that the customers have difficulty effectively communicating requirements How can we discover requirements thatthe customer might not think to tell us about?

  35. Guideline for finding requirements • Ask probing questions that focus on: • The primary actors and their goals • The system boundary • Prototyping and other activities

  36. Such probing might producea helpful diagram like this Bicyclestations The System Mobile/webcustomer Phonecustomer Phone system Servicetech Phonesupport

More Related