機能とシナリオの違いに光を当てる背景情報を探しています。
言ってやるが、私はファイルを持っているuse_administration.feature
Feature: Use administration area
So that I can administrate the application
As an administrator
I can visit the administration area
Scenario: Get a login form
Given I am not logged in
When I visit the administration dashboard
Then I should see a login-form
Scenario: Access the Dashboard
Given I am not logged in
And there is a user "admin@example.com" with password "password"
When I log in with username "admin@example.com" and password "password"
Then I should see a dashboard
これらのシナリオはかなり明確に定義されていると思います。
ただし、別のものを見るとFeature
、問題はより明確になります
Feature: Manage campings
So that a writer can manage her campings
As a logged in writer
I want to update and delete campings
Scenario: Logged in writer can create a new camping
Given I am administrator
And no campings on the campings listing
When I create a Camping named "Beautifull Green"
And I visit the "Campings" administration page
Then I should see a camping "Beautifull Green"
Scenario: Logged in writer sees own campings dashboard
Given I am administrator
And I have a camping "Beautifull Green"
When I visit the administration dashboard
Then I should see a panel titled "My Campings"
Then I should see camping "Beautifull Green"
Scenario: Logged in writer can update campings
Given I am administrator
And I have a camping "Beautifull Green"
When I visit the update page for "Beautifull Green"
And I update the name to "updated!"
And I visit the "Campings" administration page
Then I should see a camping "updated!"
Scenario: Logged in writer can update camping from dashboard
Given I am administrator
And I have a camping "Beautifull Green"
When I visit the administration dashboard
Then I should see the "edit"-link for "Beautifull Green"
これらのシナリオの多くは重複しているため、おそらくそれ自体が機能であるはずです。重複は主に共有ステップでカバーされていることに注意してください。それでもなお、多くの繰り返しがあります。
私の主な質問は、いつ何かが機能であり、いつそれがシナリオであるかということです。経験則はありますか?機能に含まれるシナリオの数に関するグッドプラクティスはありますか?それとも私はこのトピック全体を完全に誤解していますか?