bdd in action – principles, practices and real-world application
TRANSCRIPT
![Page 1: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/1.jpg)
John Ferguson Smart
BDD In Action Principles, practices and real-world applications
![Page 2: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/2.jpg)
John Ferguson Smart
Consultant Trainer Mentor Author Speaker Coder
![Page 3: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/3.jpg)
There are only two problems in software development
1) Building the software wrong
2) Building the wrong software
![Page 4: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/4.jpg)
BDD
Feature InjectionAutomated Acceptance
Criteria
API and code design
Collaboration
Building the software right
Building the right software
Living Documentation
What is Behaviour Driven Development
![Page 5: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/5.jpg)
Behaviour Driven Development is…
Conversa>on Focused
![Page 6: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/6.jpg)
Story
bug reports
Working code boring
manual tes>ng
WASTEBA
Developer
Tester
Many teams build features like this…
Conversa>on Focused
![Page 7: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/7.jpg)
…but a little cooperation goes a long way…
Working code and
Working Automated Acceptance Tests Exploratory tes>ng,
usability tes>ng...
Shared understanding
StoryExamplesAutomated acceptance criteria
Conversa>on Focused
![Page 8: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/8.jpg)
We call this “The Three Amigos”
BA and/or product owner
Tester Developer Automatable Acceptance Criteria
Shared understanding
Conversa>on Focused
![Page 9: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/9.jpg)
We call this “The Three Amigos”
Conversa>on Focused
![Page 10: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/10.jpg)
Behaviour Driven Development is…
Example-‐based
![Page 11: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/11.jpg)
Example-‐based
![Page 12: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/12.jpg)
Behaviour Driven Development is…
Value-‐Driven
![Page 13: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/13.jpg)
Behaviour Driven Development is…
Outside-‐in
OutsideIn
![Page 14: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/14.jpg)
Behaviour Driven Development is…
Executable Specifica>ons
![Page 15: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/15.jpg)
More value faster
Delivery Time
Trad
i>on
al
Using BDD
31% faster delivery
Behaviour Driven Development is…
![Page 16: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/16.jpg)
Higher Quality
Defect Rate
Trad
i>on
al
Using BDD
4 >mes less defects
Behaviour Driven Development is…
![Page 17: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/17.jpg)
Scenario
Step Defini>ons
Low level specifica>ons (aka “unit tests”)
Applica>on Code
BDD guides development
![Page 18: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/18.jpg)
Oh, the things you can learn…
BDD guides development
![Page 19: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/19.jpg)
What would we like the API to look like?
BDD guides development
![Page 20: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/20.jpg)
Then write low-‐level specifica>ons for the code
BDD guides development
![Page 21: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/21.jpg)
Then write low-‐level specifica>ons for the code
BDD guides development
![Page 22: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/22.jpg)
“Every class is an API for someone”
![Page 23: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/23.jpg)
BDD in Ac>on -‐ some real-‐world examples
![Page 24: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/24.jpg)
Mission cri;cal legacy web applica;on
Case 1 -‐ an e-‐commerce web site
Frequent small changes
Business requires fast release cycle
Background
![Page 25: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/25.jpg)
Case 1 -‐ an e-‐commerce web site
Approach
“BDD-‐style” regression tests
High communica;on value
Designed for ease of maintenance
Illustrate key business scenarios
Minimum ini;al impact on team
![Page 26: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/26.jpg)
“BDD-‐style” regression tests
Case 1 -‐ an e-‐commerce web site
Approach
![Page 27: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/27.jpg)
Case 1 -‐ an e-‐commerce web site
Outcomes
Living documenta;on
![Page 28: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/28.jpg)
Case 1 -‐ an e-‐commerce web site
Outcomes
Living documenta;on
![Page 29: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/29.jpg)
Case 1 -‐ an e-‐commerce web site
Outcomes
Living documenta;on
![Page 30: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/30.jpg)
New large-‐scale project
Case 2 -‐ a large financial ins>tu>on
7 years, 2 Scrum teams
Conserva;ve organisa;on
Background
Regulatory and traceability
![Page 31: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/31.jpg)
Approach
Full team-‐wide BDD adop;on
Test automa;on for (almost) all acceptance criteria
Tight integra;on with JIRA for traceability
“Three-‐amigos” sessions to refine acceptance criteria
High ini;al impact on team
Case 2 -‐ a large financial ins>tu>on
![Page 32: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/32.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
Stories
Features
Capabilities
Goals
Requirements organised by feature and capability
![Page 33: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/33.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
Stories
Features
Capabilities
Goals
Requirements managed in JIRA
![Page 34: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/34.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
StoryExamplesAutomated acceptance criteria
“Three amigos” sessions refine acceptance criteria
![Page 35: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/35.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
Acceptance Criteria map back to JIRA
![Page 36: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/36.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
Stories
Features
Capabilities
Goals
Manual test cases managed in Zephyr
![Page 37: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/37.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
Stories
Features
Capabilities
Goals
Automated and Manual Tests produce Living Documenta;on
Acceptance Criteria
![Page 38: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/38.jpg)
\Approach
Case 2 -‐ a large financial ins>tu>on
Releases organised in JIRA
![Page 39: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/39.jpg)
\Outcomes
Case 2 -‐ a large financial ins>tu>on
Code coverage when from 8% to 80+%
Very liZle rework to delivered features
Well documented APIs
Automated tests used to demonstrate features
Happy teams!
![Page 40: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/40.jpg)
BDD involves a major culture change
BDD Adop>on -‐ Tips and Tricks
Don’t skimp on training!
Put care into your test automa;on
Need tester and BA buy-‐in
![Page 41: BDD in Action – principles, practices and real-world application](https://reader035.vdocument.in/reader035/viewer/2022062710/55a5b9141a28ab750e8b45e5/html5/thumbnails/41.jpg)
References
http://jbehave.orgBDD in Java
http://thucydides.infoLiving Documentation
Issue tracking and Agile project management
Manual test case management in JIRA