Skip to content

使用 AI 生成和细化用户故事

用户故事 (User Story) 是敏捷开发中描述功能需求的常用方法。一个好的用户故事能清晰地传达用户价值。然而,从模糊的想法到结构化的用户故事需要花费大量时间。AI 在这个环节可以扮演一个出色的业务分析师或产品经理助手。

场景一:从一个模糊的想法到完整的用户故事

当团队只有一个初步的想法时,可以用 AI 来发散思维、定义角色并创建标准格式的用户故事。

Prompt 示例:

扮演一个经验丰富的产品经理。

我们的产品是: 一个在线学习平台。

初步想法: 我们希望学生能够保存他们喜欢的课程,方便以后查看。

你的任务:

  1. 识别这个功能的核心用户角色。
  2. 为这个角色编写一个或多个标准格式的用户故事(As a [角色], I want [功能], so that [价值])。
  3. 为每个用户故事,编写 3-5 条具体的验收标准 (Acceptance Criteria)。

AI 可能的输出:

当然,我们来分析这个功能。

核心用户角色: 注册学生 (Registered Student)


用户故事 1: As a Registered Student, I want to be able to add a course to my "Favorites" list from the course details page, so that I can easily find and access it later without searching again.

验收标准:

  • Given I am on a course details page, When I click the "Add to Favorites" button (e.g., a heart icon), Then the button should change to a "favorited" state (e.g., a filled heart icon).
  • Given I have added a course to my favorites, When I navigate to my user dashboard, Then I should see the favorited course in a "My Favorites" section.
  • Given a course is already in my favorites list, When I click the "favorited" button again, Then the course should be removed from my favorites list, and the button should revert to its initial state.

场景二:细化和拆分复杂的用户故事

有时候一个用户故事可能过于庞大(被称为“史诗” Epic)。AI 可以帮助我们将其拆分成更小、更易于管理和估算的故事。

Prompt 示例:

扮演一个敏捷教练。

我们有以下这个史诗级的用户故事: "As a user, I want to be able to register, log in, and manage my profile, so that I can use the application."

你的任务: 将这个史诗故事拆分成多个更小的、可以放入一个 Sprint 中开发的独立用户故事,并为每个故事提供简要说明。

AI 可能的输出:

好的,这个史诗故事可以拆分为以下几个更小的用户故事:

  1. 用户注册:

    • 故事: As a new visitor, I want to be able to register for an account using my email and a password, so that I can access the platform's features.
    • 说明: 涵盖了注册表单、输入验证和账户创建的后端逻辑。
  2. 用户登录:

    • 故事: As a registered user, I want to be able to log in with my email and password, so that I can access my personal dashboard.
    • 说明: 涵盖了登录表单、身份验证和会话管理。
  3. 用户登出:

    • 故事: As a logged-in user, I want to be able to log out of my account, so that I can protect my account's security on a shared computer.
    • 说明: 涵盖了登出功能和会话的终止。
  4. 查看个人资料:

    • 故事: As a logged-in user, I want to be able to view my profile information (e.g., name, email), so that I can confirm my details are correct.
    • 说明: 涵盖了个人资料的只读展示页面。
  5. 编辑个人资料:

    • 故事: As a logged-in user, I want to be able to update my profile information, such as my name, so that I can keep my details current.
    • 说明: 涵盖了编辑表单、信息更新的后端逻辑。

总结

通过与 AI 协作,产品经理和开发团队可以:

  • 节省时间: 快速将想法结构化,减少在撰写标准文档上的时间消耗。
  • 提高质量: AI 可以帮助思考各种边界情况,从而编写出更全面的验收标准。
  • 促进沟通: 清晰、一致的用户故事是团队高效沟通的基础。

AI 在这个阶段充当了一个不知疲倦的创意伙伴和细心的文书,让团队能更专注于需求的本质和用户价值。