The document discusses achieving testing nirvana through test-driven development (TDD). It states that TDD involves writing tests before code, which provides confidence in the code and allows being more productive. It describes three levels of enlightenment through TDD: 1) tests answer "How" and provide access to testing, refactoring, and automation tools; 2) TDD is about design and tests answer "What"; 3) tests are behavior-driven development (BDD) specs in a domain-specific language (DSL), making them less brittle.
2. what is testing nirvana?
you want to write tests
know what to test, what not to test
confidence in your code
more productive writing tests before code,
then just code alone
3. what is testing nirvana?
[ stolen without permission or regard from: ]
http://www.ayende.com/Blog/archive/6905.aspx
4. 1 Unit Test
st
Feelings of discomfort
Strange sense of obviousness
These symptoms will pass
[ paraphrased from http://behavior-driven.org/Introduction ]
6. 1 Enlightenment
st
congratulations, TDD status achieved!
Tests answer “How”
access to new tools for: testing, refactoring, automation
[ paraphrased from http://behavior-driven.org/Introduction ]
8. 2
nd
Enlightenment
TDD is about Design
Tests answer “What”
no longer want all those design tools
[ paraphrased from http://behavior-driven.org/Introduction ]
11. 3 Enlightenment
rd
you are now BDD worthy
tests are henceforth specs
test in a framework, spec in a DSL
[ paraphrased from http://behavior-driven.org/Introduction ]
15. Story Tests
Story: simple addition
As an accountant
I want to add numbers Story
So that I can count beans As a [role]
Scenario: add one plus one I want to [do some action]
Given an addend of 1
And an addend of 1 So that [business value]
When the addends are added
Then the sum should be 2
And the corks should be popped Scenario
Given [initial state]
Scenario: add two plus five
Given an addend of 2 When [action]
And an addend of 5
When the addends are added
Then [result]
Then the sum should be 7
[ stolen without permission or regard from: ]
http://blog.davidchelimsky.net/articles/2007/10/25/plain-text-stories-part-iii
http://peepcode.com/products/rspec-user-stories
16. Story Tests
#google_bar
3 boxes { .container
#search
17. Story Tests
Story: google's homepage
As a gmail user
I want visit google's homepage
So that I can search the web or check my gmail
Scenario: The google bar has a link to gmail when I am logged in
Given there is a gmail user ben.burkert@gmail.com
And they are logged into gmail
When they view the google homepage
Then they should see the google_bar box
And they should see the user's email_address within the google_bar box
And they should see a Gmail link within the google_bar box
Scenario: The search box allows the user to search the net
Given there is a gmail user ben.burkert@gmail.com
When they view the google homepage
Then they should see a container box
And they should see the search box within a container box
And they should see a quot;Google Searchquot; button within the search box
And they should see a quot;I'm feeling luckyquot; button within the search box