You are not allowed to write any production code unless it is to make a failing unit test pass
You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures
You are not allowed to write any more production code than is sufficient to pass the one failing unit test
BDD isn’t about the tools. It’s about the conversations you have
A formal language fulfilling the requirements that a good specification is:
Feature: Google Searching As a web surfer, I want to search Google, so that I can learn new things. Scenario: Simple Google search Given a web browser is on the Google page When the search phrase "panda" is entered Then results for "panda" are shown And the related results include "Panda Express" But the related results do not include "pandemonium"
Feature: Google Searching
As a web surfer, I want to search Google, so that I can learn new things.
Background:
Given a web browser is on the Google page
Scenario: Simple Google search for pandas
When the search phrase "panda" is entered
Then results for "panda" are shown
Scenario: Simple Google search for elephants
When the search phrase "elephant" is entered
Then results for "elephant" are shown
Scenario: Simple Google search for elephants
When the search phrase "elephant" is entered
Then results for "elephant" are shown
Examples: Phrases
| phrase |
| panda |
| elephant |
Scenario: Simple Google search
When the search phrase "panda" is entered
Then results for "panda" are shown
And the following related results are shown
| related |
| Panda Express |
| giant panda |
| panda videos |