用户故事 是一个小的有价值的功能片段,用于规划和优先考虑敏捷团队的工作。
一个好的用户故事 应该
- 提供一个可演示的功能片段
- 具有可测试的验收标准
并且是
- Independent (独立)
- Negotiable (可协商)
- Valuable (有价值)
- Estimable (可估计)
- Small (小)
- Testable (可测试)
故事格式
一个好的用户故事 应该描述谁 (<actor>
)、什么 (<feature>
) 和为什么 (<benefit>
)。
As an <actor>
I want a <feature>
So that <benefit>
示例
As an mobile bank customer
I want to see balance on my accounts
So that I can make better informed decisions about my spending
使用黄瓜语言的验收标准
验收标准是 (软件) 产品必须满足的条件,才能被用户、客户或其他利益相关者接受。
这些最好使用黄瓜语言和 Gherkin 语法 来编写。
Feature: Some important feature
Scenario: Get something
Given I have something
When I do something
Then I get something else
Scenario: Get something different
Given I have something
And I have also some other thing
When I do something different
Then I get something different
… 等等,根据需要添加更多场景。
示例
Feature: Some important feature
Scenario: Do not show balance if not logged in
Given I am not logged on to the mobile banking app
When I open the mobile banking app
Then I can see a login page
And I do not see account balance
Scenario: Show balance on the accounts page after logging in
Given I have just logged on to the mobile banking app
When I load the accounts page
Then I can see account balance for each of my accounts