15. BDD
Behavior-driven development (or BDD) is an
agile software development technique devised
by Dan North as a response to the issues he
encountered whilst teaching Test-Driven
Development:
¡ñ Where to start
¡ñ What to test and what not to test
¡ñ How much to test in one go
¡ñ What to call the tests
¡ñ How to understand why a test fails
24. Feature: Title
In order to [Business Value]
As a [Role]
I want to [Some action]
Scenario: Title
Given [Context]
When [Action]
Then [Outcome]
25. Scenario: Create Post
Given I am a registered User
And I have signed in
When I go to Create Post Page
And I create a Post and Publish it
Then I should see the Post in the Index
Page
26. Scenario: Create a Post
Given I am a registered User with name "Chuck", email
"chuck@Norris.com" and password "123456"
And I sign in as "chuck@Norris.com/123456"
When I visit Create Post Page
And I fill up Title as "Best Post"
And I fill up Content as "Chuck Norris counted to infinity
- twice."
And I publish the Post
Then I should see message "Post was successfully
created."
And I should see post in the index page
27. Scenario: Artist creates an art work
Given I am a registered artist
And I follow the add new artwork link from the
dashboard
When I fill the form with the artwork data
And I upload a picture
Then I should see a confirmation message telling me
that the artwork was added to my collection
28. Scenario: Artist creates an art work
Given I am a registered artist
And I am on my dashboard
And I follow "Add an artwork" within "#dashboard"
When I fill in "Title" with "The Arnolfini Portrait"
And I fill in "Description" with "A nice portrait."
And I select "Painting" from "Category"
And I attach "arnolfini.jpg" to "Select picture"
And I press "Create"
Then I should see "The Arnolfini Portrait was
successfully added to your art collection."
35. Magic Kingdom
Don¡¯t use Cucumber unless you live in the
magic kingdom of non-programmers-writing-
tests (and send me a bottle of fairy dust if you¡¯
re there!)
http://37signals.com/svn/posts/3159-testing-like-the-tsa