3 ms·
I drank the Cucumber Kool-Aid and had an app with basically 100% Cucumber coverage. If I wanted to change something, I would first write a cuke for it, write sp
by erikpukinskis 13y ago
I drank the Cucumber Kool-Aid and had an app with basically 100% Cucumber coverage. If I wanted to change something, I would first write a cuke for it, write specs as necessary, and only as necessary write actual code.
Of course I got into the same spot that almost everyone gets into doing that: too many "and then I click..." scenarios. Great coverage, but then the requirements change substantially and the test base is just a massive snarl of interdependent assumptions. At one point I had effectively written, in cucumber, a natural language interface to my app.
But then at some point I needed to move and I needed to move fast and I just let the whole infrastructure rot. Now I'm doing almost everything on the client side anyway, so it's all a little moot.
All of that being said, I'm still a Cucumber fan, but I approach it differently. Here's what I think:
You should have cukes for the 5-10 things that if they don't work make your product completely pointless.
On Gmail, there would be cukes like:
When I receive the email from Fred about dinner
And I open it
Then I should see the message
When I reply
Then Fred should get my reply
And those cukes basically don't need to have wildcards:
When /^I reply$/ do
click "reply_button"
fill_in "message", :with => "I'll be there!"
click "Send"
end
Essentially:
* Use cucumber as a way to force you to keep track of the handful of absolutely critical integrated experiences
* Don't use fancy grammars... Think of steps as human-readable function names.
* Don't do anything fancy in the steps. They should just be a list of actions that users would have to do.
And yeah, there's no reason you couldn't do all of this in Steak. I think Cucumber is just nice in that it encourages you to write it out in human terms.
- jrochkind1 13y agoWhat's the major benefit of having those 5 or 10 things be cucumber/gherkin, instead of straight rspec? (or straight minitest!) What are the costs of having to understand and maintain code written using a seperate little technology stack (cucumber) for just 5 or 10 scenarios? Okay, you sort of answer that: " I think Cucumber is just nice in that it encourages you to write it out in human terms." Okay. If it's worth the cost to you to do this. You could also, of course, just write things out in human terms in comments above the 5 or 10 tests written in rspec or whatever.