Date post: | 05-Dec-2014 |
Category: |
Technology |
Upload: | skills-matter |
View: | 898 times |
Download: | 1 times |
By Richard Lawrence For CukeUp NYC, Sept 30, 2014
(& why that’s a good thing)
5 Things Cucumber Is Bad At
As we get started…
Discuss with one or two people near you:
What are some common complaints you hear (or say) about Cucumber?
Problems with My Car
Problems with My Car
1. Doesn’t taste good 2. Doesn’t fit in my carry-on luggage 3. Buggy entertainment system 4. Some people think it’s ugly 5. Bigger than most other cars 6. Relatively low gas mileage
Two kinds of Weaknesses
Those that represent opportunities for improvement
Those that teach us what the thing is & what we do or don’t need
5 “Problems” with Cucumber
that can teach us about Cucumber,
BDD, and us
“Problems” with Cucumber #1 Gherkin isn’t a very powerful language.
Where are my Gherkin macros? How am I supposed to program with this?
“Problems” with Cucumber #2 I have to describe things in 2 places. Background: Given a provider named "Complex Schedule Provider" serving: | From | To | When | Both Ways? | | Boulder | Boulder | M-‐F 7:30am-‐5pm | yes | | Boulder | Lafayette | M 7:30am-‐5pm; W 7:30am-‐5pm | yes | | Boulder | Louisville | M-‐F 7:30am-‐5pm | no | And I'm logged in as a non-‐admin user
Given /^a provider named "([^"]*)" serving:$/ do |provider_name, schedule| # ... end Given /I'm logged in as a non-‐admin user/ do # ... end
“Problems” with Cucumber #3 Step definitions are all global.
Why don’t I get namespaces? Won’t this lead to ambiguity?
“Problems” with Cucumber #4 Regular expressions.
(?:[a-‐z0-‐9!#$%&'*+/=?^_`{|}~-‐]+(?:.[a-‐z0-‐9!#$%&'*+/=?^_`{|}~-‐]+)*|"(?:[x01-‐x08x0bx0cx0e-‐x1fx21x23-‐x5bx5d-‐x7f]|[x01-‐x09x0bx0cx0e-‐x7f])*")@(?:(?:[a-‐z0-‐9](?:[a-‐z0-‐9-‐]*[a-‐z0-‐9])?.)+[a-‐z0-‐9](?:[a-‐z0-‐9-‐]*[a-‐z0-‐9])?|[(?:(?:25[0-‐5]|2[0-‐4][0-‐9]|[01]?[0-‐9][0-‐9]?).){3}(?:25[0-‐5]|2[0-‐4][0-‐9]|[01]?[0-‐9][0-‐9]?|[a-‐z0-‐9-‐]*[a-‐z0-‐9]:(?:[x01-‐x08x0bx0cx0e-‐x1fx21-‐x5ax53-‐x7f]|[x01-‐x09x0bx0cx0e-‐x7f])+)])
“Problems” with Cucumber #4 Regular expressions.
(.+)
See h%p://www.agileforall.com/2010/07/ just-‐enough-‐regular-‐expressions-‐for-‐cucumber/
an? cucumbers?
(\d+) (?:I'm logged|I log)
“Problems” with Cucumber #5 My stakeholders won’t write feature files.
Doesn’t it defeat the purpose of Gherkin and separate feature files if I still have to write it all anyway?
SO What?
Questions? Contact me… Twitter: @rslawrence Email: [email protected] Blog: www.richardlawrence.info