Use case

From Wikipedia, the free encyclopedia
  (Redirected from Use Case)
Jump to: navigation, search
A UML Use Case Diagram for the interaction of a client (the actor) and a restaurant (the system)

In software and systems engineering, a use case is a list of steps, typically defining interactions between a role (known in UML as an "actor") and a system, to achieve a goal. The actor can be a human or an external system.

In systems engineering, use cases are used at a higher level than within software engineering, often representing missions or stakeholder goals. The detailed requirements may then be captured in SysML or as contractual statements.

Contents

History [edit]

In 1986 Ivar Jacobson first formulated textual, structural and visual modeling techniques for specifying use cases. In 1992 his co-authored book[1] helped to popularize the technique for capturing functional requirements, especially in software development. Originally he used the terms usage scenarios and usage case – the latter being a direct translation of his Swedish term användningsfall – but found that neither of these terms sounded natural in English, and eventually he settled on use case.[2] Since then, others have contributed to improving this technique, notably including Alistair Cockburn. In 2011, Ivar Jacobson published an update to use cases called Use Case 2.0, the intention being to incorporate many of his practical experiences of applying use cases since its original inception.[3]

Use case structure [edit]

Martin Fowler [edit]

Martin Fowler states "There is no standard way to write the content of a use case, and different formats work well in different cases."[4]:100 He describes "a common style to use" as follows:[4]:101

  • Title: "goal the use case is trying to satisfy"[4]:101
  • Main Success Scenario: numbered list of steps[4]:101
    • Step: "a simple statement of the interaction between the actor and a system"[4]:101
  • Extensions: separately numbered lists, one per Extension[4]:101
    • Extension: "a condition that results in different interactions from .. the main success scenario". An extension from main step 3 is numbered 3a, etc.[4]:101

Alistair Cockburn [edit]

Alistair Cockburn describes a more detailed structure for a use case, but permits it to be simplified when less detail is needed. His "fully dressed" use case structure is:[5]:9-10

Fully dressed use case structure [edit]

Cockburn's Fully dressed use case template lists the following fields:[6]

  • Title: "an active-verb goal phrase that names the goal of the primary actor"[7]
  • Primary Actor
  • Goal in Context
  • Scope
  • Level
  • Stakeholders and Interests
  • Precondition
  • Minimal Guarantees
  • Success Guarantees
  • Trigger
  • Main Success Scenario
  • Extensions
  • Technology & Data Variations List
  • Related Information.

In addition, Cockburn suggests using two devices to indicate the nature of each use case: icons for design scope and goal level.

Cockburn's approach has influenced other authors; for example, Alexander and Beus-Dukic generalize Cockburn's "Fully dressed use case" template from software to systems of all kinds, with the following fields differing from Cockburn:[8]

  • Variation scenarios "(maybe branching off from and maybe returning to the main scenario)"
  • Exceptions "i.e. exception events and their exception-handling scenarios"

Casual use case structure [edit]

Cockburn recognizes that projects may not always need detailed "fully dressed" use cases. He describes a Casual use case with the fields:[6]

  • Title (goal)
  • Primary Actor
  • Scope
  • Level
  • (Story): the body of the use case is simply a paragraph or two of text, informally describing what happens.

Design scope icon [edit]

Cockburn suggests annotating each use case with a symbol to show the "Design Scope", which may be black-box (internal detail is hidden) or white-box (internal detail is shown). Five symbols are available:[9]

  • Organization (black-box), a filled icon of a house
  • Organization (white-box), an unfilled icon of a house
  • System (black-box), a filled icon of a box
  • System (white-box), an unfilled icon of a box
  • Component, an icon of a screw or bolt.

Other authors sometimes call use cases at Organization level "Business use cases".[10]

Goal level icon [edit]

Cockburn suggests annotating each use case with a symbol to show the "Goal Level";[11] the preferred level is "User-goal" (or colloquially "sea level"[4]:101).

  • Very high summary, an icon of a cloud
  • Summary, an icon of a flying kite
  • User-goal, an icon of waves at sea
  • Subfunction, an icon of a fish
  • Too low, an icon of a seabed clam-shell.

Actors [edit]

A use case defines the interactions between external actors and the system under consideration to accomplish a goal. Actors must be able to make decisions, but need not be human: "An actor might be a person, a company or organization, a computer program, or a computer system — hardware, software, or both."[12] Actors are always stakeholders, but many stakeholders are not actors, since they "never interact directly with the system, even though they have the right to care how the system behaves."[12] For example, "the owners of the system, the company's board of directors, and regulatory bodies such as the Internal Revenue Service and the Department of Insurance" could all be stakeholders but are unlikely to be actors.[12]

Similarly, a person using a system may be represented as different actors because he is playing different roles. For example, user "Joe" could be playing the role of a Customer when using an Automated Teller Machine to withdraw cash from his own account, or playing the role of a Bank Teller when using the system to restock the cash drawer on behalf of the bank.

Actors are often working on behalf of someone else. Cockburn writes that "These days I write 'sales rep for the customer' or 'clerk for the marketing department' to capture that the user of the system is acting for someone else." This tells the project that the "user interface and security clearances" should be designed for the sales rep and clerk, but that the customer and marketing department are the roles concerned about the results.[13]

A stakeholder may play both an active and an inactive role: for example, a Consumer is both a "mass-market purchaser" (not interacting with the system) and a User (an actor, actively interacting with the purchased product).[14] In turn, a User is both a "normal operator" (an actor using the system for its intended purpose) and a "functional beneficiary" (a stakeholder who benefits from the use of the system).[14] For example, when user "Joe" withdraws cash from his account, he is operating the Automated Teller Machine and obtaining a result on his own behalf.

Cockburn advises to look for actors among the stakeholders of a system, the primary and supporting (secondary) actors of a use case, the system under design (SuD) itself, and finally among the "internal actors", namely the components of the system under design.[12]

Use case notation [edit]

In the Unified Modeling Language, the relationships between all (or a set of) the use cases and actors are represented in a Use Case Diagram or diagrams, originally based upon Ivar Jacobson's Objectory notation. SysML, a UML profile, uses the same notation at the system block level.

Limitations [edit]

Limitations of use cases include:

  • Use cases are not well suited to capturing non-interaction based requirements of a system (such as algorithm or mathematical requirements) or non-functional requirements (such as platform, performance, timing, or safety-critical aspects). These are better specified declaratively elsewhere.
  • Use case templates do not automatically ensure clarity. Clarity depends on the skill of the writer(s).
  • Use cases are complex to write and to understand, for both end users and developers.
  • As there are no fully standard definitions of use cases, each project must form its own interpretation.
  • Some use case relationships, such as extends, are ambiguous in interpretation and can be difficult for stakeholders to understand.
  • In Agile, simpler user stories are preferred to use cases.
  • Use case developers often find it difficult to determine the level of user interface (UI) dependency to incorporate in a use case. While use case theory suggests that UI not be reflected in use cases, it can be awkward to abstract out this aspect of design, as it makes the use cases difficult to visualize. In software engineering, this difficulty is resolved by applying requirements traceability, for example with a traceability matrix. Another approach to associate UI elements with use cases, is to attach a UI design to each step in the use case. This is called a use case storyboard.
  • Use cases can be over-emphasized. Bertrand Meyer discusses issues such as driving system design too literally from use cases, and using use cases to the exclusion of other potentially valuable requirements analysis techniques.[15]
  • Use cases are a starting point for test design, [16] but since each test needs its own success criteria, use cases may need to be modified to provide separate postconditions for each path.[17]

See also [edit]

References [edit]

  1. ^ Jacobson et al, 1992.
  2. ^ "Alistair Cockburn, "Use cases, ten years later"". Alistair.cockburn.us. Retrieved 2013-04-17. 
  3. ^ "Business Analysis Conference Europe 2011 - 26-28 September 2011, London, UK". Irmuk.co.uk. Retrieved 2013-04-17. 
  4. ^ a b c d e f g h Fowler, 2004.
  5. ^ Cockburn, 2001
  6. ^ a b Cockburn, 2001. Page 120.
  7. ^ Cockburn, 2001. Inside rear cover. Field "Use Case Title".
  8. ^ Alexander and Beus-Dukic, 2009. Page 121
  9. ^ Cockburn, 2001. Inside front cover. Icons "Design Scope".
  10. ^ Suzanne Robertson. Scenarios in Requirements Discovery. Chapter 3 in Alexander and Maiden, 2004. Pages 39-59.
  11. ^ Cockburn, 2001. Inside front cover. Icons "Goal Level".
  12. ^ a b c d Cockburn, 2001. Page 53.
  13. ^ Cockburn, 2001. Page 55.
  14. ^ a b Alexander and Beus-Dukic, 2009. Page 39.
  15. ^ Meyer, 2000. (page needed)
  16. ^ Armour and Miller, 2000. (page needed)
  17. ^ Denney, 2005. (page needed)

Bibliography [edit]

Alexander, Ian, and Beus-Dukic, Ljerka. Discovering Requirements: How to Specify Products and Services. Wiley, 2009.
Alexander, Ian, and Maiden, Neil. Scenarios, Stories, Use Cases. Wiley 2004.
Armour, Frank, and Granville Miller. Advanced Use Case Modeling: Software Systems. Addison-Wesley, 2000.
Cockburn, Alistair. Writing Effective Use Cases. Addison-Wesley, 2001.
Denney, Richard. Succeeding with Use Cases: Working Smart to Deliver Quality. Addison-Wesley, 2005.
Fowler, Martin. UML Distilled (Third Edition). Addison-Wesley, 2004.
Jacobson Ivar, Christerson M., Jonsson P., Övergaard G., Object-Oriented Software Engineering - A Use Case Driven Approach, Addison-Wesley, 1992.
Jacobson Ivar, Spence I., Bittner K. Use Case 2.0: The Guide to Succeeding with Use Cases, IJI SA, 2011.
Meyer, Bertrand. Object Oriented Software Construction. (2nd edition). Prentice Hall, 2000.
Schneider, Geri and Winters, Jason P. Applying Use Cases 2nd Edition: A Practical Guide.Addison-Wesley, 2001.

External links [edit]