liveBook · Manning

Behavior-driven development

As explained in Spec-Driven Development

Behavior-driven development is a software development practice that specifies system behavior collaboratively using examples and shared language.

Behavior-driven development (BDD) structures collaboration around examples and acceptance criteria, building shared understanding between business and technology. Its value lies in the conversation, not Gherkin syntax. section 1.2

Listing 1.1 User story for password reset
As an account holder
I want to reset my password
So that I can regain control of my account if I suspect it has been compromised

A password-reset user story makes the account holder’s need and reason explicit. section 1.2

Listing 1.2 Acceptance criteria password reset user story
Scenario: Resetting a password revokes existing access
 
Given I am an account holder with one or more active sessions
And I have requested a password reset
When I successfully set a new password using the reset link
Then all existing sessions for my account are invalidated
And I must log in again on any device
 
Scenario: A reset link is valid only for a limited time
 
Given I have requested a password reset
When I open the reset link within 30 minutes
Then I am allowed to choose a new password
 
Scenario: An expired reset link cannot be used
 
Given I have requested a password reset
When I open the reset link after 30 minutes
Then the link is rejected
And I am prompted to request a new one

These scenarios turn intent into verifiable behavior, including session revocation and reset-link expiration. section 1.2

How Spec-Driven Development covers it

How deep it goes
Centers collaborative acceptance criteria and shared scenarios rather than Gherkin syntax as an end in itself.
Examples
Uses a password-reset user story and scenarios for session invalidation and 30-minute reset-link validity.
What you can do after
Practice turning a user need into collaboratively authored, verifiable behavior scenarios.
How it connects
Links user stories and acceptance criteria through Gherkin, alongside test-driven development as a related practice.

Also explained in

Compare how 8 books explain behavior-driven development →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spec-Driven Development. The section links point to the parts of the book it draws on.