Quentin Crain
2017-09-07 13:13:58 UTC
Hi!
I have searched the archives but have not found any answers which provided
links to documents explaining why ordered dependencies between scenarios
(vs features) is considered bad; are there any?
Lets just make up a simple example, and perhaps it can be a starting point.
Imagine this feature file:
Feature: Depositing Monies
Scenario: Create Account
Given a bank
When I create an account for Bob
Then the account is created
And the account's balance is $0.00
Scenario: Depositing $5.00 increases the balance by $5.00
Given Bob's account
When I deposit $5.00
Then the account's balance is $5.00
Scenario: Depositing $10.00 increases the balance by $10.00
Given Bob's account
When I deposit $10.00
Then the account's balance is $15.00
Without scenario dependencies, this would be:
Scenario: Creating an account for Bob and starting with a balance of $0.00,
depositing $5.00 results in a balance of $5.00
Given a bank in which I create an account for Bob with an initial balance
of $0.00
When I deposit $5.00
Then the accountâs balance is $5.00
Scenario: Creating an account for Bob and starting with a balance of $5.00,
depositing $10.00 results in a balance of $15.00
Given a bank in which I create an account for Bob with an initial balance
of $5.00
When I deposit $10.00
Then the accountâs balance is $15.00
(If there is a 3rd version that is the canonical and preferred version of
this, that would be awesome to know! grin!)
The first feature file is much more representative of how the world works,
meaning it is a truer test of real-world conditions: Deposits come in over
time. Also, the first is much more likely due to test accretion: The very
first test I might write is "Can I create an account and its initial
balance should be $0.00". Later I might find it important to test
depositing. The second version requires me to do more testing that I might
want to do at any moment in time.
In short, I have never read a good justification for the disapproval of
scenario dependencies.
Reference would be much appreciated! Thanks!!
Quentin
I have searched the archives but have not found any answers which provided
links to documents explaining why ordered dependencies between scenarios
(vs features) is considered bad; are there any?
Lets just make up a simple example, and perhaps it can be a starting point.
Imagine this feature file:
Feature: Depositing Monies
Scenario: Create Account
Given a bank
When I create an account for Bob
Then the account is created
And the account's balance is $0.00
Scenario: Depositing $5.00 increases the balance by $5.00
Given Bob's account
When I deposit $5.00
Then the account's balance is $5.00
Scenario: Depositing $10.00 increases the balance by $10.00
Given Bob's account
When I deposit $10.00
Then the account's balance is $15.00
Without scenario dependencies, this would be:
Scenario: Creating an account for Bob and starting with a balance of $0.00,
depositing $5.00 results in a balance of $5.00
Given a bank in which I create an account for Bob with an initial balance
of $0.00
When I deposit $5.00
Then the accountâs balance is $5.00
Scenario: Creating an account for Bob and starting with a balance of $5.00,
depositing $10.00 results in a balance of $15.00
Given a bank in which I create an account for Bob with an initial balance
of $5.00
When I deposit $10.00
Then the accountâs balance is $15.00
(If there is a 3rd version that is the canonical and preferred version of
this, that would be awesome to know! grin!)
The first feature file is much more representative of how the world works,
meaning it is a truer test of real-world conditions: Deposits come in over
time. Also, the first is much more likely due to test accretion: The very
first test I might write is "Can I create an account and its initial
balance should be $0.00". Later I might find it important to test
depositing. The second version requires me to do more testing that I might
want to do at any moment in time.
In short, I have never read a good justification for the disapproval of
scenario dependencies.
Reference would be much appreciated! Thanks!!
Quentin
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.