5 things cucumber is bad at by Richard Lawrence

14
By Richard Lawrence For CukeUp NYC, Sept 30, 2014 (& why thats a good thing) 5 Things Cucumber Is Bad At

description

This talk will look at 5 things Cucumber’s bad at, why that’s a good thing, and what it tells us about Cucumber’s sweet spot in a team’s toolkit. Many times, when people complain about something Cucumber’s not good at, they’re unwittingly describing something Cucumber shouldn't be good at. They’re revealing that they don’t quite understand BDD and Cucumber’s role in it. Cucumber is the world's most misunderstood collaboration tool and people need to hear this over and over again.

Transcript of 5 things cucumber is bad at by Richard Lawrence

Page 1: 5 things cucumber is bad at by Richard Lawrence

By Richard Lawrence For CukeUp NYC, Sept 30, 2014

(& why that’s a good thing)

5 Things Cucumber Is Bad At

Page 2: 5 things cucumber is bad at by Richard Lawrence

As we get started…

Discuss with one or two people near you:

What are some common complaints you hear (or say) about Cucumber?

Page 3: 5 things cucumber is bad at by Richard Lawrence

Problems with My Car

Page 4: 5 things cucumber is bad at by Richard Lawrence

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

Page 5: 5 things cucumber is bad at by Richard Lawrence

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

Page 6: 5 things cucumber is bad at by Richard Lawrence

5 “Problems” with Cucumber

that can teach us about Cucumber,

BDD, and us

Page 7: 5 things cucumber is bad at by Richard Lawrence

“Problems” with Cucumber #1 Gherkin isn’t a very powerful language.

Where are my Gherkin macros? How am I supposed to program with this?

Page 8: 5 things cucumber is bad at by Richard Lawrence

“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    

Page 9: 5 things cucumber is bad at by Richard Lawrence

“Problems” with Cucumber #3 Step definitions are all global.

Why don’t I get namespaces? Won’t this lead to ambiguity?

Page 10: 5 things cucumber is bad at by Richard Lawrence

“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])+)])  

Page 11: 5 things cucumber is bad at by Richard Lawrence

“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)  

Page 12: 5 things cucumber is bad at by Richard Lawrence

“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?

Page 13: 5 things cucumber is bad at by Richard Lawrence

SO What?

Page 14: 5 things cucumber is bad at by Richard Lawrence

Questions? Contact me… Twitter: @rslawrence Email: [email protected] Blog: www.richardlawrence.info