什么是用例?如何识别用例?

发布于 2024-08-03 04:08:43 字数 1459 浏览 10 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

別甾虛僞 2024-08-10 04:08:43

用例具体地标识用户将能够使用程序完成的任务或目标。它应该用用户可以理解的术语编写。

维基百科的描述过于正式。我很快就会浏览我的其他文本。
相比之下,原始 wiki 的文章更容易访问。

Alastair Cockburn 的早期文章,由 实用程序员包含一个很好的模板。

这个问题,就在几天前,与此密切相关,但稍微具体一些。

A use case identifies, with specificity, a task or goal that users will be able to accomplish using a program. It should be written in terms that users can understand.

Wikipedia's description is overly formal. I'll dig through my other texts shortly.
In contrast, the original wiki's article is much more accessible.

An early article by Alastair Cockburn, cited positively by The Pragmatic Programmer, contains a good template.

This question, from just a few days ago, is very closely related, but slightly more specific.

十级心震 2024-08-10 04:08:43

用例的定义很简单:

参与者与系统的交互,以创造具有商业价值的东西。

更正式地说:

执行的一系列事务
通过产生可测量的系统
特定参与者的一组值。

它们的目的非常简单:参与者、交互、价值。您可以添加一些细节,但不能太多。

使用用例很容易。阅读此内容:http://www.gatherspace.com/static/use_case_example.html

最大的错误是忽视了参与者和系统之间的交互。用例不是写下冗长、详细的技术算法设计的地方。用例是参与者做某事的地方。

人们与系统交互,以便他们可以采取行动(下订单、批准账单、拒绝保险索赔等)。要采取行动,他们首先做出决定。为了做出决定,他们需要信息

  • 信息
  • 决策
  • 行动

这些是用例的“交互”部分的成分。

The definition of use case is simple:

An actor's interactions with a system to create something of business value.

More formally:

a sequence of transactions performed
by a system that yield a measurable
set of values for a particular actor.

They're intended to be very simple: Actor, Interaction, Value. You can add some details, but not too many.

Using use cases is easy. Read this: http://www.gatherspace.com/static/use_case_example.html

The biggest mistake is overlooking the interaction between actor and system. A use case is not a place to write down long, detailed, technical algorithm designs. A use case is where an actor does something.

People interact with systems so they can take actions (place orders, approve billing, reject an insurance claim, etc.) To take an action, they first make a decision. To make a decision, they need information

  • Information
  • Decision
  • Action

These are the ingredients in the "Interaction" portion of a use case.

¢蛋碎的人ぎ生 2024-08-10 04:08:43

有效的用例可以描述:

  • 目标受众/用户
  • 先决条件(即必须已登录等)
  • 预期结果
  • 可能的故障点
  • 用户的工作流程

A valid use case could describe:

  • intended audience / user
  • pre-requisites (ie must have logged in, etc)
  • expected outcome(s)
  • possible points of failure
  • workflow of user
樱花细雨 2024-08-10 04:08:43

来自指南:识别和概述参与者和使用Eclipse 人员的案例:

识别参与者

查找与其关联的外部实体
正在开发的系统必须
相互影响。候选人包括以下团体
需要帮助的用户
系统执行任务并运行
系统的主要或次要
功能以及外部
硬件、软件和其他系统。

通过命名来定义每个候选演员
并写一个简短的描述。
包括演员的面积
的责任和目标
演员将尝试完成什么时候
使用该系统。消除演员
没有任何目标的候选人。

这些问题很有用
识别参与者:

  • 谁将供应、使用或移除
    来自系统的信息?
  • 谁会
    使用系统?
  • 谁有兴趣
    提供的某些功能或服务
    系统?
  • 谁将支持并
    维护系统?
  • 有哪些
    系统的外部资源?
  • 什么
    其他系统需要交互
    系统正在开发中?

查看利益相关者列表
你在愿景声明中捕捉到了。
并非所有利益相关者都是参与者
(意思是,它们不会全部相互作用
直接与系统下
开发),但是这个列表
利益相关者有助于识别
演员候选人。

识别用例

查找用例的最佳方法是
考虑每个演员的要求
系统。对于每个演员,无论是人类还是
不是,请问:

  • 演员的目标是什么
    尝试通过系统完成任务?
  • 主要任务是什么
    演员希望系统执行?
  • 演员会创造、存储、改变、
    删除或读取系统中的数据?
  • 演员是否需要告知
    系统如何应对突然的外部变化?
  • 是否需要告知演员
    关于某些事件,例如
    网络资源不可用,
    在系统中?
  • 演员会表演吗
    系统启动或关闭?

了解目标如何
组织的运作方式以及它是如何运作的
信息系统可能是
纳入现有业务
给出了系统的一个想法
周围环境。该信息可以
揭示其他候选用例。

给出一个独特的名称和简介
描述清楚地描述了
每个用例的目标。如果
候选用例没有
目标,问自己为什么存在,以及
然后要么确定一个目标,要么
消除用例。

概述用例

不讲细节,写一个
事件流程初稿
被识别为的用例
高优先级。首先,写一个
简单的逐步描述
用例的基本流程。这
分步描述很简单
之间相互作用的有序列表
演员和系统。例如,
基本流程的描述
提取现金用例
自动柜员机 (ATM) 将
像这样:

  1. 客户插入银行卡。
  2. 系统验证卡并提示
    输入个人信息的人
    识别码 (PIN)。
  3. 客户输入 PIN 码。
  4. 系统
    验证 PIN 并提示
    客户选择一项操作。
  5. 客户选择提取现金。
  6. 系统提示客户选择
    哪个帐户。
  7. 客户选择
    支票账户。
  8. 系统
    提示输入金额。
  9. 客户
    输入要提款的金额。

  10. 系统验证金额(假设
    足够的资金),然后发行
    现金和收据。
  11. 顾客拿走现金和收据,然后
    取回银行卡。
  12. 用例结束。

当您逐步创建此内容时
基本流程描述
事件,您可以发现替代方案
和异常的流量。例如,
如果客户输入一个
PIN 码无效?记录姓名和
每个替代方案的简要说明
您确定的流程。

表示之间的关系
参与者和用例

演员和演员之间的关系
可以捕获用例,或者
记录在案。有几种方法可以
做这个。如果您正在使用用例
项目上的模型,您可以创建
用例图显示参与者如何
和用例彼此相关。
请参阅指南:用例
型号
了解更多信息。

如果您没有使用用例模型
对于该项目,确保每个
用例标识关联的
主要和次要参与者。

From Guideline: Identify and Outline Actors and Use Cases by the Eclipse people:

Identifying actors

Find the external entities with which
the system under development must
interact. Candidates include groups of
users who will require help from the
system to perform their tasks and run
the system's primary or secondary
functions, as well as external
hardware, software, and other systems.

Define each candidate actor by naming
it and writing a brief description.
Includes the actor's area of
responsibility and the goals that the
actor will attempt to accomplish when
using the system. Eliminate actor
candidates who do not have any goals.

These questions are useful in
identifying actors:

  • Who will supply, use, or remove
    information from the system?
  • Who will
    use the system?
  • Who is interested in a
    certain feature or service provided by
    the system?
  • Who will support and
    maintain the system?
  • What are the
    system's external resources?
  • What
    other systems will need to interact
    with the system under development?

Review the list of stakeholders that
you captured in the Vision statement.
Not all stakeholders will be actors
(meaning, they will not all interact
directly with the system under
development), but this list of
stakeholders is useful for identifying
candidates for actors.

Identifying use cases

The best way to find use cases is to
consider what each actor requires of
the system. For each actor, human or
not, ask:

  • What are the goals that the actor will
    attempt to accomplish with the system?
  • What are the primary tasks that the
    actor wants the system to perform?
  • Will the actor create, store, change,
    remove, or read data in the system?
  • Will the actor need to inform the
    system about sudden external changes?
  • Does the actor need to be informed
    about certain occurrences, such as
    unavailability of a network resource,
    in the system?
  • Will the actor perform
    a system startup or shutdown?

Understanding how the target
organization works and how this
information system might be
incorporated into existing operations
gives an idea of system's
surroundings. That information can
reveal other use case candidates.

Give a unique name and brief
description that clearly describes the
goals for each use case. If the
candidate use case does not have
goals, ask yourself why it exists, and
then either identify a goal or
eliminate the use case.

Outlining Use Cases

Without going into details, write a
first draft of the flow of events of
the use cases identified as being of
high priority. Initially, write a
simple step-by-step description of the
basic flow of the use case. The
step-by-step description is a simple
ordered list of interactions between
the actor and the system. For example,
the description of the basic flow of
the Withdraw Cash use case of an
automated teller machine (ATM) would
be something like this:

  1. The customer inserts a bank card.
  2. The system validates the card and prompts
    the person to enter a personal
    identification number (PIN).
  3. The customer enters a PIN.
  4. The system
    validates the PIN and prompts the
    customer to select an action.
  5. The customer selects Withdraw Cash.
  6. The system prompts the customer to choose
    which account.
  7. The customer selects
    the checking account.
  8. The system
    prompts for an amount.
  9. The customer
    enters the amount to withdraw.
  10. The
    system validates the amount (assuming
    sufficient funds), and then issues
    cash and receipt.
  11. The customer takes the cash and receipt, and then
    retrieves the bank card.
  12. The use case ends.

As you create this step-by-step
description of the basic flow of
events, you can discover alternative
and exceptional flows. For example,
what happens if the customer enters an
invalid PIN? Record the name and a
brief description of each alternate
flow that you identified.

Representing relationships between
actors and use cases

The relationship between actors and
use cases can be captured, or
documented. There are several ways to
do this. If you are using a use-case
model on the project, you can create
use-case diagrams to show how actors
and use cases relate to each other.
Refer to Guideline: Use-Case
Model
for more information.

If you are not using a use-case model
for the project, make sure that each
use case identifies the associated
primary and secondary actors.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文