一个 Gherkin 场景可以有多个用户角色吗?
Can a single Gherkin scenario have multiple user roles?
我有以下内容:
As an approver #... ?
Scenario : approve a profile
When : I approve a profile
Then : the profile owner should be notified about his profile's approval
# (on his android device)
And : I should see the profile as a valid profile
And : guests should be able to see the profile
或者我可以说:
As an owner
Scenario : approve a profile
When : my profile is approved
Then : I should be notified about my profile's approval
...?
因为 my profile is approved
是一个事件,它在这个和其他限界上下文中有多重后果。
有些后果是立竿见影的,有些最终会变得一致。
并且将单个事件放在多个功能中会导致难以管理团队、估算时间等。
有什么建议吗?
提前致谢。
使用场景大纲并根据执行某些操作时保存的一些变量,您可以添加 if 或 switch 来进行验证。
是的,在一个场景中拥有多个具有不同角色的用户是非常合适的。 Gherkin 场景是用例的场景;一个用例有多个参与者是正常的。
我会这样写你的场景:
Scenario: User approves a profile
Given there is a user "owner"
And there is a user "approver"
And there is a user "guest"
And "owner" has a profile
When "approver" approves the profile
Then "owner" should be notified that their profile was approved
And "approver" should see the profile as a valid profile
And "guest" should see the profile as a valid profile
您可能需要更多或不同的步骤来为不同的用户提供不同的权限,但这应该能让您明白。
在这种情况下,批准者是最重要的参与者,但是您在介绍性 ("As") 部分中放置的内容取决于功能文件的范围(除了这个之外它还包含哪些场景)。如果它涵盖了配置文件的所有用途,那么它就是 "As a user";如果它涵盖所有配置文件管理,它将是 "As a profile administrator";如果它只涵盖配置文件批准,它将是 "As a profile approver".
首先按依赖边界对逻辑流进行分组,然后按用户角色分组。
尝试解决哪些可以由单个开发人员完成,哪些可以分解成更小的部分(因此需要更短的交付时间)。
例如,在 CQRS
系统中,当您使用最终一致性(应由需求定义)时,您可以轻松地将 write
需求的 gherkin
与 read
分开要求 gherkin
。但是,如果您的场景需要即时一致性,您最好不要将读取端的 gherkin
与写入端的 gherkin
分开,而让一个(或一对)开发人员处理它。
我认为用户角色不太重要,但如果您的角色来自不同的 BC,您最好为每个角色编写不同的 gherkins
。故事应该是独立的,task prioritization
是 Product Owner's job
但我宁愿根据 技术 问题优先考虑其中的一些故事。
我有以下内容:
As an approver #... ?
Scenario : approve a profile
When : I approve a profile
Then : the profile owner should be notified about his profile's approval
# (on his android device)
And : I should see the profile as a valid profile
And : guests should be able to see the profile
或者我可以说:
As an owner
Scenario : approve a profile
When : my profile is approved
Then : I should be notified about my profile's approval
...?
因为 my profile is approved
是一个事件,它在这个和其他限界上下文中有多重后果。
有些后果是立竿见影的,有些最终会变得一致。 并且将单个事件放在多个功能中会导致难以管理团队、估算时间等。
有什么建议吗? 提前致谢。
使用场景大纲并根据执行某些操作时保存的一些变量,您可以添加 if 或 switch 来进行验证。
是的,在一个场景中拥有多个具有不同角色的用户是非常合适的。 Gherkin 场景是用例的场景;一个用例有多个参与者是正常的。
我会这样写你的场景:
Scenario: User approves a profile
Given there is a user "owner"
And there is a user "approver"
And there is a user "guest"
And "owner" has a profile
When "approver" approves the profile
Then "owner" should be notified that their profile was approved
And "approver" should see the profile as a valid profile
And "guest" should see the profile as a valid profile
您可能需要更多或不同的步骤来为不同的用户提供不同的权限,但这应该能让您明白。
在这种情况下,批准者是最重要的参与者,但是您在介绍性 ("As") 部分中放置的内容取决于功能文件的范围(除了这个之外它还包含哪些场景)。如果它涵盖了配置文件的所有用途,那么它就是 "As a user";如果它涵盖所有配置文件管理,它将是 "As a profile administrator";如果它只涵盖配置文件批准,它将是 "As a profile approver".
首先按依赖边界对逻辑流进行分组,然后按用户角色分组。
尝试解决哪些可以由单个开发人员完成,哪些可以分解成更小的部分(因此需要更短的交付时间)。
例如,在 CQRS
系统中,当您使用最终一致性(应由需求定义)时,您可以轻松地将 write
需求的 gherkin
与 read
分开要求 gherkin
。但是,如果您的场景需要即时一致性,您最好不要将读取端的 gherkin
与写入端的 gherkin
分开,而让一个(或一对)开发人员处理它。
我认为用户角色不太重要,但如果您的角色来自不同的 BC,您最好为每个角色编写不同的 gherkins
。故事应该是独立的,task prioritization
是 Product Owner's job
但我宁愿根据 技术 问题优先考虑其中的一些故事。