BDD Outside In Rails with Cucumber

Test first.

 

An admirable goal.

 

Sometimes, admirable seems impractical. Testing takes time, and writing tests before code requires understanding both the code and the tests.

 

But the evidence is clear: with experience, "test first" results in better designed software, with architecture that is maintainable and scalable. Almost by definition.  However, there are many kinds of tests.

 

At the East Bay Rails March[masked] Meetup, we're going to look at a specific type of "behavior-driven" test called "outside in." 

 

"Outside in" means we're going define a sequence of events modeling a user's interaction. We're going to write these events in an easy-to-understand domain-specific language (read like Plain English). Then we're going to "drive out" a fresh Rails application to pass these test. Some details:

  • Pure outside-in, starts from a Cucumber feature file on a bare Rails application.
  • No RSpec, pure Cucumber w/Capybara matchers.
  • Should take 60-90 minutes to get through. Follow along with your own Rails application.
  • Material based on an article written by Sarah Mei (Pivotal Labs) a couple of years ago, and updated for Rails 3.1 with material from a Pragmatic Programmers book.
  • It's fun!

 

Seriously, driving out test code can be a blast. You do all the hard work up front, which is figuring out what code you want to write. Once you know what to write, the writing of it easy. Just write code until all the tests pass.

 

Hope to see you there!

 

 

Join or login to comment.

  • Dave D.

    Alexander, it was not recorded, but here is a link to the deck: https://github.com/doolin/outsidein
    I have a blog post somewhere too.

    April 3, 2012

  • Dave D.

    Sascha, thanks for this tip for vi. I've now used it a couple of times, works great!

    March 21, 2012

  • WalterYu

    Excellent meetup, Dave did a full walk-through of BDD with Cucumber.

    March 20, 2012

  • Christopher M.

    I enjoyed the format, and the speed of the presentation. I'm hoping to see a "part 2" where we dig a bit deeper, and get into scenarios requiring more advanced features of cucumber (Background, for example) and more advanced, less "skeleton" rails code.

    March 2, 2012

  • Blanka

    it was very well presented.

    March 2, 2012

  • A former member
    A former member

    Here's the vim snippet for pasting indented code in vim:
    map! <Leader>p :set paste<CR>i
    imap <Leader>pp <C-O>:set paste<CR><C-r>*<C-O>:set nopaste<CR>

    March 2, 2012

  • A former member
    A former member

    Great presentation!

    March 2, 2012

  • Karla

    Food for thought...

    March 2, 2012

  • Dave D.

    Other way around: I'm astonished the email did not save *my* event preferences between drafts.

    February 9, 2012

  • BrianY

    Is your astonishment the reason why one e-mail said the gate fee for this was $20? ;)

    February 8, 2012

  • Dave D.

    Please forgive the multiple emails, Meetup has simply *astonished* me again with their user interface for announcing events.

    February 8, 2012

29 went

Your organizer's refund policy for BDD Outside In Rails with Cucumber

Refunds are not offered for this Meetup.

People in this
Meetup are also in:

Create a Meetup Group and meet new people

Get started Learn more
Henry

I decided to start Reno Motorcycle Riders Group because I wanted to be part of a group of people who enjoyed my passion... I was excited and nervous. Our group has grown by leaps and bounds. I never thought it would be this big.

Henry, started Reno Motorcycle Riders

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy