BDD- Behavior-driven development
History
• Author : Dan North
• First appeared in 2003
• Derived from TDD
TDD Issues
• Where to start
• What to test
• What not to test
• How much to test
• What to call the test
• Why a test fail...
Test Names - agiledox
• Should be sentences
• Before:
– testIsASingleton
– testAReallyLongNameIsA
GoodThing
• After:
• is ...
Test Names - Should
• “Behaviour” is a more
useful word than “test”
• Start with should
• Target Class:TyreBuilder
Tests
...
When a test fails
1. You broke it – FIX it
2. The behavior was moved
somewhere else - Move the test
as well
3. The behavio...
BDD is also “ubiquitous”
Scenarios Template
As a [X]
I want [Y]
so that [Z]
“A story’s behaviour is
simply its acceptance
...
JBehave
Scenarios Template
Given : x with value 2
When : I divide by 2
Then : x should equal 1
JBehave
JBehave
Thanks
• QUESTIONS?
http://www.linkedin.com/in/diegomendonca
Upcoming SlideShare
Loading in …5
×

Bdd - Behavior Driven Design

584 views

Published on

Conceitos de BDD- Behavior Driven Design

Concepts of BDD

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
584
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Bdd - Behavior Driven Design

  1. 1. BDD- Behavior-driven development
  2. 2. History • Author : Dan North • First appeared in 2003 • Derived from TDD
  3. 3. TDD Issues • Where to start • What to test • What not to test • How much to test • What to call the test • Why a test failed
  4. 4. Test Names - agiledox • Should be sentences • Before: – testIsASingleton – testAReallyLongNameIsA GoodThing • After: • is a singleton • a really long name is a good thing
  5. 5. Test Names - Should • “Behaviour” is a more useful word than “test” • Start with should • Target Class:TyreBuilder Tests  testShouldInflate - OK  testShouldAccelerate - FAIL
  6. 6. When a test fails 1. You broke it – FIX it 2. The behavior was moved somewhere else - Move the test as well 3. The behavior changed - Don´t be afraid of deleting it.
  7. 7. BDD is also “ubiquitous” Scenarios Template As a [X] I want [Y] so that [Z] “A story’s behaviour is simply its acceptance criteria. So we created a template to capture a story’s acceptance criteria.”
  8. 8. JBehave Scenarios Template Given : x with value 2 When : I divide by 2 Then : x should equal 1
  9. 9. JBehave
  10. 10. JBehave
  11. 11. Thanks • QUESTIONS? http://www.linkedin.com/in/diegomendonca

×