O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

From Use case to User Story

Mais Conteúdo rRelacionado

Audiolivros relacionados

Gratuito durante 30 dias do Scribd

Ver tudo

From Use case to User Story

  2. 2. Use Case Introduction
  3. 4. Why are Requirements important <ul><li>1/3 budget to correct errors originate from requirements </li></ul><ul><li>Defining requirements is crucial to all project stakeholders </li></ul><ul><li>Many techniques and models available </li></ul>USE CASE MODEL
  4. 5. Why should you be interested ? <ul><li>IDEO Story: </li></ul><ul><ul><li>Biker water bottle – heart valve </li></ul></ul><ul><ul><li>Multidiscipline cooperation </li></ul></ul>
  5. 6. What are Requirements <ul><li>It covers : </li></ul><ul><li>Functional requirements </li></ul><ul><ul><li>User requirements </li></ul></ul><ul><li>Nonfunctional requirements </li></ul><ul><ul><li>Quality attributes: performance, security, archiving, database </li></ul></ul>defined operational capabilities business needs satisfy
  6. 7. Software Requirements <ul><li>Three perspectives: </li></ul><ul><ul><li>Business level </li></ul></ul><ul><ul><li>User level </li></ul></ul><ul><ul><li>Technical level </li></ul></ul>
  7. 8. Business Level <ul><li>Define the vision </li></ul><ul><li>Build the right software </li></ul><ul><li>Define project stakeholders: </li></ul><ul><ul><li>including direct users (actors) </li></ul></ul>
  8. 9. User Level <ul><li>Use cases : </li></ul><ul><ul><li>“ voice of customers” </li></ul></ul><ul><ul><li>consists of : </li></ul></ul><ul><ul><li>interaction </li></ul></ul><ul><ul><li>has name </li></ul></ul><ul><ul><li>step-by-step </li></ul></ul><ul><ul><li>exception conditions </li></ul></ul><ul><ul><li>variant paths </li></ul></ul>
  9. 10. Technical Level <ul><li>Technical requirements: </li></ul><ul><ul><li>Functional requirements based on user requirements </li></ul></ul><ul><ul><li>Nonfunctional requirements </li></ul></ul>
  10. 11. Use Case Concepts and Definitions
  11. 12. Use Case <ul><li>Describes how the system should respond under various conditions to a request from one of the stakeholders to deliver a specific goal . </li></ul><ul><ul><ul><li>stakeholder = primary actor </li></ul></ul></ul>
  12. 13. Use Case <ul><li>The use case is primarily done in the form of a scenario that describes a sequence of steps . </li></ul><ul><li>Each use case captures a ‘contract’ for the behavior of the System under Discussion (SuD) to deliver a single goal . </li></ul>
  13. 14. Actors <ul><li>Anyone or anything with behavior. </li></ul><ul><li>Generally is a role (rather than a specific person, job title or a thing) </li></ul><ul><li>Not every stakeholder will show up </li></ul><ul><li>Important to discover these ‘hidden’ actors </li></ul>
  14. 15. Primary Actor <ul><li>Stakeholder that interacts with the SuD to achieve a specific goal </li></ul>
  15. 16. Supporting Actor <ul><li>An (external) actor that needs to provide a service to the SuD </li></ul><ul><li>A primary actor for one use case can become a supporting actor for another </li></ul>
  16. 17. Scenario <ul><li>sequence of steps </li></ul><ul><li>fulfill a goal </li></ul>
  17. 18. Scenario <ul><li>Must be easy to read </li></ul><ul><li>Avoid more than nine steps </li></ul><ul><li>Use active voice </li></ul><ul><li>Stating who or what is doing what </li></ul><ul><li>Approver approve a task </li></ul><ul><ul><li>The approver open My Tasks </li></ul></ul><ul><ul><li>The approver choose a task </li></ul></ul><ul><ul><li>The approver approves the task </li></ul></ul><ul><ul><li>The system returns the approver to My Tasks list </li></ul></ul>
  18. 19. Main Success Scenario <ul><li>Everything goes as planned </li></ul><ul><li>Happy Path </li></ul>
  19. 20. Extensions <ul><li>Exceptions that requires a deviation from the planned scenario </li></ul><ul><li>Exceptions documented as extension </li></ul>
  20. 21. Extensions <ul><li>Approver approve a task </li></ul><ul><li>Main Success Scenario </li></ul><ul><ul><li>The approver open My Tasks </li></ul></ul><ul><ul><li>The approver choose a task </li></ul></ul><ul><ul><li>The approver approves the task </li></ul></ul><ul><ul><li>The system returns the approver to My Tasks list </li></ul></ul><ul><li>Extensions </li></ul><ul><li>3a The task has been approved by another approver </li></ul><ul><ul><li>3a1 The system returns error message to the approver </li></ul></ul><ul><li>3b The approver decides to postpone the approval process </li></ul><ul><ul><li>3b1 The approver click the ‘Back’ button </li></ul></ul><ul><ul><li>3b2 The system returns the approver to My Tasks list </li></ul></ul>
  21. 22. Use Case Properties <ul><li>Design Scope </li></ul><ul><li>Stakeholder </li></ul><ul><li>Primary Actor </li></ul><ul><li>Description </li></ul><ul><li>Level </li></ul><ul><li>Pre-conditions </li></ul><ul><li>Post-conditions </li></ul><ul><li>Trigger </li></ul>
  22. 23. Design Scope <ul><li>Definition of the boundary of the System Under Discussion (SuD) </li></ul><ul><li>Set of systems that will be designed </li></ul>
  23. 24. Design Scope <ul><li>A business use case has enterprise as its scope and focus on business flow </li></ul><ul><li>A system use case has computer system as its scope and focus on how actors communicate with the system </li></ul><ul><li>A component use case has subsystem or component of the system as its scope </li></ul>
  24. 25. Use Case Level <ul><li>Summary (cloud level or kite level) </li></ul><ul><ul><li>outlines the context of a set of User Goal use cases </li></ul></ul><ul><li>User Goal (sea level) </li></ul><ul><ul><li>addresses “Can the primary actor go away happily after the use case finished ?” </li></ul></ul><ul><li>Subfunction (under water level) </li></ul><ul><ul><li>created to move out an isolated part of a scenario to a separate use case </li></ul></ul>source : Alistair Cockburn, Writing Effective Use Cases
  25. 26. Use Case level <ul><li>Summary </li></ul><ul><li>User Goal </li></ul><ul><li>Subfunction </li></ul>
  26. 27. Stakeholder & Primary Actor <ul><li>Stakeholder: </li></ul><ul><ul><li>someone / something that has an interest in the goal of the use case delivers </li></ul></ul><ul><li>Primary Actor: </li></ul><ul><ul><li>the stakeholder who or which initiates the use case to achieve a goal </li></ul></ul>
  27. 28. Description <ul><li>Brief description of the goal the use case supposed to deliver </li></ul>
  28. 29. Preconditions <ul><li>conditions that must hold true before the scenario of the use case starts </li></ul><ul><li>will not be checked again after that </li></ul>
  29. 30. Post conditions <ul><li>Minimal Guarantees </li></ul><ul><ul><li>What at least should hold true when the goal is not met </li></ul></ul><ul><ul><ul><li>Example: </li></ul></ul></ul><ul><ul><ul><li>“ All entered information have been stored.” </li></ul></ul></ul><ul><li>Success Guarantees </li></ul><ul><ul><li>What must have been achieved at the end of the main success scenario or any alternate route. </li></ul></ul><ul><ul><ul><li>Example: </li></ul></ul></ul><ul><ul><ul><li>“ The task is approved” </li></ul></ul></ul>
  30. 31. Trigger <ul><li>event or sequence of events that initiate the use case </li></ul>
  31. 32. Use cases Process Flow
  32. 33. Develop in Iterations <ul><li>Identify all actors and their goals </li></ul><ul><li>Use MoSCoW list to define the scope of the project. </li></ul><ul><li>Set up Actor-Goal List </li></ul>
  33. 34. MoSCoW List <ul><li>Must Have : The requirement is essential, key stakeholder needs will not be satisfied if this requirement is not delivered and the timebox will be considered to have failed </li></ul><ul><li>Should Have : This is an important requirement but if it is not delivered within the current timebox, there is an acceptable workaround until it is delivered during a subsequent timebox </li></ul><ul><li>Could Have : This is a ‘nice to have’ requirement; we have estimated that it is possible to deliver this in the given time but will be one of the requirements de-scoped if we have underestimated </li></ul><ul><li>Won't Have : The full name of this category is ‘Would like to have but Won’t Have during this timebox’; requirements in this category will not be delivered within the timebox that the prioritisation applies to </li></ul>
  34. 35. Actor-Goal List L Find unfinished task and reject it Reject unfinished task Support H Receive request and approve it Approve Request Approver H Make change in edit group and send it Submit Change Request Requestor Prio Brief Descriptions Goals Actor
  35. 36. Recipe <ul><li>Identify the actors </li></ul><ul><li>List their goals </li></ul><ul><li>Add brief descriptions to the goals </li></ul><ul><li>Create an initial use case for each goal </li></ul><ul><li>Describe the main success scenario for each use case </li></ul><ul><li>Identify the exceptions to the main success scenario and work them out as extension </li></ul><ul><li>Validate the use cases </li></ul><ul><li>Optimize the use cases </li></ul>
  36. 37. Cheat Sheet <ul><li>http://www. slingcode .com/ref/ UseCaseQuestions . pdf </li></ul><ul><li>by Alistair Cockburn </li></ul><ul><li>author of a popular use case book: “Writing Effective Use Cases”, ISBN 0-201-70225-8, ISBN 978-0201702255 </li></ul>
  37. 38. Use Case Best Practices
  38. 39. 7 Best Practices <ul><li>Scope the domain </li></ul><ul><li>Scope your use cases </li></ul><ul><li>Validate use cases </li></ul><ul><li>Define the requirements models </li></ul><ul><li>Determine the strategy to elicit requirements </li></ul><ul><li>Settle on a standard format for your uses cases </li></ul><ul><li>Develop a project glossary </li></ul>
  39. 40. 1. Scope the Domain <ul><li>Manage avoidable scope creep </li></ul><ul><li>Be flexible on unavoidable market and business condition changing </li></ul>
  40. 41. How to name a Use Case <ul><li>Well named use cases </li></ul><ul><ul><li>enable business customers (or any readers) to easily infer who the actor is </li></ul></ul>What’s in a name ?
  41. 42. Best practices (1) <ul><li>action verb + [qualified] object </li></ul><ul><ul><li>place order, request product or service </li></ul></ul><ul><li>avoid vague verbs, such as do or process </li></ul><ul><li>avoid low-level, database oriented verbs, such as create, read, update, delete </li></ul><ul><li>The “object” part of the use case name can be a noun, (such as inventory), or a qualified noun (such as in-stock inventory ) </li></ul>
  42. 43. Best Practices (2) <ul><li>make sure the project glossary defines the object </li></ul><ul><li>Add each object to the domain model (as a class, entity, or attribute) </li></ul><ul><li>Bring forth actors and use cases concurrently and associate them </li></ul>
  43. 44. 2. Scope Your Use Cases <ul><li>A use case </li></ul><ul><ul><li>addresses a single actor goal </li></ul></ul><ul><ul><li>is not overly complex </li></ul></ul><ul><ul><li>avoid partial processes in the business </li></ul></ul><ul><ul><li>avoid CRUD (create-read-update-delete) </li></ul></ul><ul><ul><li>avoid separate use cases for alternative courses </li></ul></ul>
  44. 45. 2. Scope Your Use Cases <ul><li>Frame each use case with: </li></ul><ul><ul><li>triggering events </li></ul></ul><ul><ul><li>event responses </li></ul></ul>
  45. 46. 2. Scope Your Use Cases <ul><li>Different kind of events: </li></ul><ul><ul><li>Business Events: </li></ul></ul><ul><ul><ul><li>subject + verb + object </li></ul></ul></ul><ul><ul><ul><li>for eq: “Customers requests book” </li></ul></ul></ul><ul><ul><li>Temporal Events: </li></ul></ul><ul><ul><ul><li>time to <verb + object> </li></ul></ul></ul><ul><ul><ul><li>for eq: “ Time to generate report” </li></ul></ul></ul>
  46. 47. 2. Scope Your Use Cases <ul><li>Context diagram: </li></ul><ul><ul><li>simple diagram </li></ul></ul><ul><ul><li>system as a single ‘black box’ </li></ul></ul><ul><ul><li>actors “give” or “get” something to or from the system </li></ul></ul>
  47. 48. 3. Validate Use Cases <ul><li>Questions to validate: </li></ul><ul><ul><li>help achieve goals and visions ? </li></ul></ul><ul><ul><li>address the problem ? </li></ul></ul><ul><ul><li>key differentiator ? </li></ul></ul><ul><ul><li>address all stakeholders ? </li></ul></ul><ul><ul><li>priority for initial release ? </li></ul></ul>
  48. 49. 4. Define the Requirements Model <ul><li>acts as a blueprint </li></ul><ul><li>primary purpose to communicate </li></ul><ul><li>discovery process </li></ul><ul><li>emphasize on one view </li></ul><ul><li>multiple model => separation of concerns </li></ul>
  49. 50. 4. Define the Requirements Model <ul><li>Multiple views: </li></ul><ul><ul><li>use cases: behavioral </li></ul></ul><ul><ul><li>class diagram: structural </li></ul></ul><ul><ul><li>statechart diagram: dynamic (lifecycles) </li></ul></ul><ul><ul><li>business rules: control </li></ul></ul>
  50. 51. 5.Determine Your Elicitation Strategy <ul><li>One-on-one or groups interviews </li></ul><ul><li>Facilitated workshops </li></ul><ul><li>Generate list of scenarios </li></ul><ul><li>Reuse existing requirements </li></ul><ul><li>Prototype user interface </li></ul><ul><li>Observe end users </li></ul><ul><li>Focus groups </li></ul><ul><li>Market surveys </li></ul><ul><li>Regulations and procedures </li></ul><ul><li>Customer complaints, help desk logs </li></ul><ul><li>Competitive analyses </li></ul>
  51. 52. 5. Determine Your Elicitation Strategy <ul><li>Commercial software: market surveys, on-site visits, facilitated workshops </li></ul><ul><li>In-house business system with large user base: review help desk logs, reusing existing requirements, workshops </li></ul><ul><li>Smaller user base: facilitated workshops and observation. </li></ul>
  52. 53. 6. Settle on Standard Format <ul><li>use case name only (“verb + [qualified] object”) </li></ul><ul><li>use case name and a single-sentence goal statement </li></ul><ul><li>use case brief description (2 to 5 sentences) </li></ul><ul><li>use case outline (bulleted or numbered list of use case steps, with alternative flows outlined separately or not listed at all) </li></ul>
  53. 54. 6. Settle on Standard Format <ul><li>Use case conversational format (use case header information plus two columns – one for actors and one for system responses – written in a conversational style) </li></ul><ul><li>Use case description (a sequential, conversational, or narrative text description that includes normal path, alternative, exceptions and extensions) </li></ul>
  54. 56. 7. Develop Glossary <ul><li>communication gaps between software vs business people </li></ul><ul><li>each side has its acronyms and jargon </li></ul><ul><li>glossary should be a living, vital part </li></ul>
  55. 57. USE CASE Modeling
  56. 58. Use case Modeling <ul><li>Use case is a text form </li></ul><ul><li>Use case diagram provides an index to use cases </li></ul>
  57. 59. Actor <ul><li>Someone or something outside the scope of the use case that initiate the use case </li></ul><ul><li>May trigger or recipient of the use case </li></ul>
  58. 60. Actor / Use case Associations <ul><li>relationship between an actor and a use case </li></ul><ul><li>actor initiates the use case </li></ul><ul><li>use case provides the actor with results </li></ul>
  59. 61. Generalization <ul><li>To express some high-level functional need of a system </li></ul><ul><li>“ a kind of” relationship </li></ul>
  60. 62. Inclusion <ul><li>Higher-level use cases may call ( includes) lower-level use cases </li></ul>
  61. 63. Extension <ul><li>An alternate route to the main success scenario. </li></ul><ul><li>Extension point: the point it exits the originating use case </li></ul><ul><li>Return point: the point at which it returns </li></ul>Abort Transaction Trigger : any time in Buy Ticket the Car Driver can abort the trans. Main Success Scenario 1. The Ticket Machine returns the coins that have been entered
  62. 64. User Stories Scrum methodology
  63. 65. What is a User Story ? <ul><li>A concise, written description of a piece of functionality that will be valuable to a user (or owner) of the software </li></ul>
  64. 66. User Story Description <ul><li>As a [user role] I want to [goal] so I can [reason] </li></ul><ul><li>For example: </li></ul><ul><li>As a registered user I want to log in so I can access subscriber-only content </li></ul>
  65. 67. How detail should a User Story be ? <ul><li>Detailed enough </li></ul><ul><li>Detailed enough for the team to work from, and further details to be established and clarified at the time of development. </li></ul>
  66. 68. User Stories Summary <ul><li>User Stories combine written and verbal communications, supported with a picture where possible. </li></ul><ul><li>User Stories should describe features that are of value to the user, written in a user’s language. </li></ul><ul><li>User Stories detail just enough information and no more. </li></ul><ul><li>Details are deferred and captured through collaboration just in time for development. </li></ul><ul><li>Test cases should be written before development, when the User Story is written. </li></ul><ul><li>User Stories need to be the right size for planning. </li></ul>
  67. 69. Use Case vs User Stories When to use What
  68. 70. Structured Requirements <ul><li>Goals are achieved through use cases </li></ul><ul><li>Use cases are enabled by functional requirements </li></ul><ul><li>Functional requirements lead to design and implementation. </li></ul><ul><li>Non-functional requirements characterize how functional requirements must work. </li></ul><ul><li>Constraints restrict how functional requirements may be implemented </li></ul>source: Software Requirements, 2 nd Edition, Karl E Wiegers
  69. 71. Documentation Overhead source : http://tynerblain.com
  70. 72. What are the differences ? <ul><li>Formal use cases require the most effort </li></ul><ul><ul><li>Describe all permutations </li></ul></ul><ul><li>Informal use cases are pretty much the same - just less formal </li></ul><ul><ul><li>Need the right level of detail </li></ul></ul><ul><li>Use case briefs have almost no overhead </li></ul><ul><ul><li>Same challenges “how much is enough ?” </li></ul></ul><ul><li>User stories have the least overhead, and provide the least context. </li></ul>
  71. 73. Level of Details captured source : http://tynerblain.com
  72. 74. Level of Reader expertise source : http://tynerblain.com
  73. 75. References <ul><li>Ellen Gottesdiener, “Use Cases: Best Practices”, IBM, 6/11/2003 </li></ul><ul><li>Jan Kettenis, Getting Started With Use Case Modelling, An Oracle White Paper, March 2005 </li></ul><ul><li>Dan Pilone, UML 2 in A Nutshell, O’Reilly </li></ul><ul><li>http://tynerblain.com/blog </li></ul>
  74. 76. Q&A

Notas do Editor

  • discuss background, and explain about segments and at the end of each segments I will pause for any discussions
  • Here is how we visualize a software project
  • Typical software projects spend roughly one-third of their overall budget correcting errors that originate in requirements project stakeholders such as clients, end users, develoeprs, testers and managers Years of experience led to development of a number of techniques and models to assist the process Use case model is the most well-known
  • You might say that this is more for the IT folks, that is not completely true. Example is IDEO story. How innovation is produced from multidiscipline cooperation You will also be involved from .
  • To understand Use Case, first let’s take a look at Requirements. Requirements are the defined operational capabilities of a system or process that must exist to satisfy a business need. User requirements: tasks that users need to achieve using the software.
  • Requirements don’t come out of thin air. They are products of systematic discovery and definition process where analyst plays a key role. Software requirements came from process of thinking through three perspectives of requirements.
  • At the highest level (or business level), you begin by understanding and clarifying the business’ goals and objectives. Then you define the vision on how to achieve it. You ensure that you will build the right software. In addition, you also define the correct project stakeholders.
  • This is where use cases come in. Use cases is the interaction between an external actor and the system
  • Technical requirements include functional requirements based on user requirements and nonfunctional requirements
  • Use cases are fundamentally a text form. The scenario describes how the system should respond to a request of a primary actor to deliver a specific goal of that actor.
  • (bullet points first) Incidentally actor can be a person, job title or a thing, although generally it is a role The SuD is also an actor.
  • A scenario describes a sequence of steps that are executed in order to fulfill the goal the use case is supposed to deliver.
  • We just discussed about some of the use cases components, now we’ll look into the detail of different properties of the each use case
  • There are different scope depends on the type of use cases
  • From Alistair Cockburn.
  • How do we develop use cases
  • example is shown in the table
  • scope creep: scope of the projects expands as the work proceeds requirements may change because of changing market and business conditions -&gt; unavoidable manage the avoidable scope creep
  • The first step is to just name the use cases, and not the details
  • best practice on how to give a name
  • elicit: to draw or bring out or forth; educe; evoke: to elicit the truth; to elicit a response with a question.
  • This is different than the Design Scope
  • trigger: customer wants money, responses: ATM gave out the money
  • a context diagram is a simple diagram that represents the system as a single ‘black box” surrounded by its major interfaces, thus showing the system in its environment.
  • Ensure that each one is necessary to meet the business opportunities in your product vision. To validate, answers the following questions; How does this uc help us achieve our goals and visions Does this use case address some aspect of the problem in our problem statement ? Does this use case differentiate our product in some way ? Do we have use cases to address all the stakeholder and user groups we identified in our vision statement Which use cases will be implemented in our initial release ?
  • A requirement model is a set of models which acts as a blueprint for a software product. Example are: event lists, use cases, context diagrams, data models, business rules, actor maps, storyboards Defining requirement is a discovery process for users and customers. It evolve from the process of users trying out their requirements through models. Using multiple views (behavior, structure, dynamics, or control ) gives a rich context for eliciting user requirements and aligns with separation of concerns.
  • The list is with order of increasing complexity
  • A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts: &amp;quot;Excuse me, can you tell me where I am?&amp;quot; The man below says: &amp;quot;Yes you&apos;re in a hot air balloon, hovering 30 feet above this field.&amp;quot; &amp;quot;You must be a software developer,&amp;quot; says the balloonist. &amp;quot;I am,&amp;quot; replies the man. &amp;quot;How did you know?&amp;quot; &amp;quot;Well,&amp;quot; says the balloonist, &amp;quot;everything you have told me is technically correct, but it&apos;s of no use to anyone.&amp;quot; The man below says, &amp;quot;You must work in business as a manager.&amp;quot; &amp;quot;I do,&amp;quot; replies the balloonist, &amp;quot;but how did you know?&amp;quot; &amp;quot;Well,&amp;quot; says the man, &amp;quot;you don&apos;t know where you are or where you are going, but you expect me to be able to help. You&apos;re in the same position you were before we met but now it&apos;s my fault.&amp;quot;
  • conventionally you read use case diagrams from left to right, with actors initiating use cases on the left and actors that receive use case results on the right. Also put primary actor on the top.
  • When use case A specializes use case B (or B generalizes A) you express that A is “a kind of” B, implying that whatever applies to B also applies to A. A adds to or may override behavior of B.
  • A typical example is a Summary use case that includes User Goal use cases, or User Goal use case that includes some reusable Subfunction use case. The included use case is typically not complete on its own and is required part of the larger use cases.
  • Karl Wieger’s Structured Requirements Software Requirements, 2nd Edition, Karl E. Wiegers .
  • See next screen. Formal and informal use cases describes different permutations. Use case brief may use single paragraph. User stories provides the least context. http://tynerblain.com/blog/2009/02/02/user-stories-and-use-cases/comment-page-1/#comment-497898
  • http://tynerblain.com/blog/2009/02/02/user-stories-and-use-cases/ Use case briefs may be a single paragraph use case
  • User stories, as it has less overhead of documentation, it also captures less detail. It is ok with assumption the communication is high. At some point it becomes inefficient.
  • The level of conversation will be influenced by the level of the reader domain expertise. If the reader already understand the requirements, user stories might be enough. When the developer team struggles to implement the stories, then a more structured documentation is needed. Can the writer trust the reader will understand with brief information ?