Behavior Driven Development with Cucumber
Feature: Attending RailsSchool Scenario: Come in Person Given I am in Charlottesville And I'm at RailsSchool And it's 5:30pm EST on March 6th Then I will be learning about BDD Scenario: Join the Hangout Given it's 5:30pm EST on March 6th And I'm logged into RailsSchool And I visit the whiteboard for this lesson Then I will see a google hangout link
Behavior Driven Development, also called outside-in development and specification by example is a process we use to communicate about what we're building in terms that should make sense to anyone close to the project (especially those who don't have development experience!).
Aslak Hellesøy created cucumber, a tool that facilitates this process. Using cucumber, we can write down what an application should do in the form of simple language and examples (like the above scenarios). Cucumber then lets us run these examples as tests, which can be used to:
- Show that our app behaves the way we want it to, at least for the example cases
- Guide our development by allowing us to focus on a single failing test at a time
- Provide automated regression testing as the app becomes more complex
- Communicate with others about what the app can do, or where it broke