5 things cucumber is bad at by richard lawrence

Post on 05-Dec-2014

900 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

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

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: richard.lawrence@agileforall.com Blog: www.richardlawrence.info

top related