Introduction to Outside-in Development with Cucumber

This is a basic introduction to integration testing with cucumber. In it, I describe how to use cucumber and rspec to implement a feature in a web application, emphasizing the importance of writing tests before code, which is often referred to as TDD (test-driven development) or BDD (behavior-driven development, a refinement of the original TDD).
Download 146.8 MB
Download (iphone & ipod) 46.9 MB

{ 21 comments… read them below or add one }

Anonymous September 7, 2009 at 4:47 pm

This is a very nice step by step intro to Outside-In with Cucumber. I love how you’re showing that Cucumber actually tells you what to do next, and that you’re not taking any shortcuts.

I usually use create! instead of create in my step definitions and specs. That will make exceptions bubble up if you have validation errors.

Personally I have started to go very light on the controller and view specs because it is often redundant to and more ceremonial than cucumber features. I mostly use RSpec for ActiveRecord models when I write Rails apps.

Still, I think it’s good to have a “recommended” workflow – especially for people who are new to working Outside-In/BDD/TDD.

Thanks Carl!

Reply

aslakhellesoy September 7, 2009 at 4:47 pm

This is a very nice step by step intro to Outside-In with Cucumber. I love how you're showing that Cucumber actually tells you what to do next, and that you're not taking any shortcuts.

I usually use create! instead of create in my step definitions and specs. That will make exceptions bubble up if you have validation errors.

Personally I have started to go very light on the controller and view specs because it is often redundant to and more ceremonial than cucumber features. I mostly use RSpec for ActiveRecord models when I write Rails apps.

Still, I think it's good to have a “recommended” workflow – especially for people who are new to working Outside-In/BDD/TDD.

Thanks Carl!

Reply

Carl Youngblood September 7, 2009 at 10:24 pm

Thanks for the tips Aslak. There is certainly some duplication between the controller specs and cucumber, so I agree that it might be a good idea to dispense with them altogether. Glad to hear from you!

Reply

Carl Youngblood September 7, 2009 at 10:24 pm

Thanks for the tips Aslak. There is certainly some duplication between the controller specs and cucumber, so I agree that it might be a good idea to dispense with them altogether. Glad to hear from you!

Reply

Anonymous September 8, 2009 at 3:59 pm

I’ve noticed that my RSpec model tests seem to be very useful but my controller and view tests seem very un-DRY.

Reply

elitwin September 8, 2009 at 3:59 pm

I've noticed that my RSpec model tests seem to be very useful but my controller and view tests seem very un-DRY.

Reply

Anonymous October 8, 2009 at 3:02 am

Great intro to both Cucumber and TDD…nice work Carl!

Reply

gaveeno October 8, 2009 at 3:02 am

Great intro to both Cucumber and TDD…nice work Carl!

Reply

Alexandre Gherschon October 24, 2009 at 7:06 am

Really helpful, thank you !

Reply

Alexandre Gherschon October 24, 2009 at 7:06 am

Really helpful, thank you !

Reply

surfup January 13, 2010 at 6:52 am

Maybe its because I’m a total newbie, but I lost your around 10 min line. Could you perhaps a little bit more in your next screencast? You start with Cucumber, then you move onto rspec and lose me there.

Reply

JK May 17, 2010 at 9:26 pm

Ditto.

Reply

surfup January 13, 2010 at 6:52 am

Maybe its because I'm a total newbie, but I lost your around 10 min line. Could you perhaps a little bit more in your next screencast? You start with Cucumber, then you move onto rspec and lose me there.

Reply

Mike Williams March 10, 2010 at 9:34 am

Excellent intoduction to Cucumber, even to a non-rails Ruby newbie

Reply

Mike Williams March 10, 2010 at 9:34 am

Excellent intoduction to Cucumber, even to a non-rails Ruby newbie

Reply

JK May 17, 2010 at 9:26 pm

Ditto.

Reply

Andrii February 19, 2011 at 12:11 am

Now I understand how Cucumber relates to Rspec, thank you.

Reply

Andrii February 19, 2011 at 12:11 am

Now I understand how Cucumber relates to Rspec, thank you.

Reply

Kavin May 10, 2011 at 9:57 am

Great video carl. Rally usefull

Reply

Kavin May 10, 2011 at 9:57 am

Great video carl. Rally usefull

Reply

Patrik Nygren May 15, 2013 at 8:25 am

Great introduction to how to do TTD development. I like the fact that you show the process and not only how the stuff works. Really good job!

Reply

Leave a Comment

{ 5 trackbacks }