BDD is a technique for helping team members collaborate and discover requirements in their project. It uses examples to illustrate the intended behavior of systems before they're implemented, so that the team can discover more examples and develop a shared understanding of the requirements. In this talk Liz will show why conversations are the most important aspect of BDD, how examples can help you discover things early, and why discovery is an inevitable part of software development.
2. BDD uses examples to illustrate behaviour
Conversations are the most important aspect
Examples can help you discover things early
Sometimes you discover that you don’t know
3.
4. An Example of an Example
Given Fred has bought a microwave
And the microwave cost £100
When we refund the microwave
Then Fred should be refunded £100.
5. Examples
Given a context
When an event happens
Then an outcome should occur
6. Cucumber
Feature: Addition
In order to avoid silly mistakes
This is what most people
As a math idiot
I want to be told the sum of two numbers
associate with BDD
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
Then the result should be 120 on the screen
9. Boring!
Given Fred bought a microwave
And has receipt number 1857123
And receipt 1857123 list it at £100
When we scan the receipt
Then the screen should show the list of items
When we select the microwave
And we refund it
And scan Fred’s credit card
Then Fred should be refunded £100.
10.
11. Examples
Given a context
When an event happens
Then an outcome should occur
15. Is there a context in which
this event will create
a different outcome?
16. Examples
Given Fred has bought a microwave
And the microwave cost £100
And the microwave was on 10% discount
When we refund the microwave
Then Fred should be refunded £90.
17. Is this the only outcome
that matters?
If we could achieve it with pixies,
would it be enough?
18. Examples
Given Fred has bought a microwave
And the microwave cost £100
When we refund the microwave
Then the microwave should be
added to the stock count.
19. And you can keep going…
Given Fred has bought a microwave
And the microwave cost £100
And the microwave is faulty
When we refund the microwave
Then a fault ticket should be printed.