SlideShare a Scribd company logo
How to deliver the
right software
Spec by example
Asier Barrenetxea
Agenda
- Intro
- The problem
- The solution
- Questions / discussion
2
before we start..
3
I am recording 🎥
4
Feedback welcome 😊
● Which feedback?
○ Communication skills
○ Content of the talk
● How to give me feedback?
○ at the end of the talk
○ after the talk in person
○ send me and email, chat..
● Why feedback?
○ I am learning and I would like to improve
○ I believe I am in safe space
5
A bit of context about this talk
● A few years ago, I learned about BDD and ATDD and
“practiced” it in a couple of places - I thought I was
doing things right
● Later, I learned about spec by example (training by
Gojko Adzic)
○ I was working in a place where we were doing BDD
○ I brought some of the ideas to that company
● After that, I have been to other places
○ people are doing BDD and ATDD
○ but I keep seeing the same mistakes
● Spec by example fixes many of these things
● Not many people know about spec by example!
6
The problem
7
What is the
single greatest
cause of
software failure?
8
REQUIREMENTS!!
9
Software fails because requirements..
● are wrong
● are badly written
● are incomplete
● The programmers and the specifiers understand the
requirements differently
1
0
Classical approach: testing at the end
1
1
Requirements Development Testing
Hand-over of requirements
1
2
PO / BADev
QA
Each source telling a different story
● Tests ≠ Requirements
● How system really works ≠ Requirements
● Documentation gets stale
1
3
Late feedback
● Business misunderstands get arisen late on the process
○ When developer implementing requirements.
○ When qa testing it.
○ When software gets into production.
● Huge WASTE
1
4
The solution
1
5
Spec by example
to the rescue
1
6
Bring testing to the front
1
7
Requirements Development Testing
Bring testing to the front
1
8
Requirements
+
Testing
Development
Verification
(automated)
Bring testing to the front
1
9
Examples Development
Verification
(automated)
Use examples
● Easy to understand
● Plain English
● Unambiguous
● Concrete instead of abstract
Write examples collaboratively
● Business people, developers and testers in the same
room.
● Transfer the knowledge.
● Learn about the domain.
○ Ubiquitous language.
● Early feedback of misunderstandings.
○ In 30 min meeting can find out things that it would
take a whole iteration or even more.
○ everybody understands the same thing.
Write examples collaboratively
● When you write down the rules - Inconsistencies and
gaps are easy to spot
● Find out incorrect assumptions.
● Find out real business value.
● Everybody gets this feeling of ownership.
Writing examples: Different approaches
● Whole team with stakeholders
● Three amigos: QA + Dev + PO/BA
● One developer with a stakeholder/domain expert
● Specification workshop
2
3
Specification workshop
● For harder to specify stories.
● Meeting with 10+ people. POs, BAs, devs, QAs..
● Bring people from other teams if necessary.
● Create 3 teams and write examples in one board
each.
● Compare. Look for inconsistencies. Why do we have
them?
Automate examples
● Map examples to executable tests.
○ Use tools as Cucumber, Fitness, Specflow, Jasmine,
Rspec..
● Do not modify examples when automating.
Implementing the code is simple!
● Test first approach.
● Developers will have to code just what was specified in
the examples.
● Make the tests green -> Done.
Single source of truth
● Examples = Requirements.
● Examples = Automated tests.
● Examples = What the system does.
Living documentation
● Run examples with every change to the system.
● Documentation never gets out-dated.
● All tests green -> system is doing what examples say.
User stories
● Relate examples with a user story.
○ Gives context.
● Focus on business goal.
As a <role>
I want <software feature>
In order to <goal/desire>
I order to <goal/desire>
as a <role>
so that <software feature>
What makes a good example
● Focused on a single thing.
● Self explanatory.
● Uses the domain language.
● SMART
○ Specific
○ Measurable
○ Achievable
○ Relevant
○ Time-bound.
Tools & Syntax - Gherkin/Cucumber
● Is the most common
● AAA style of structuring an example:
○ Given -> arrange
○ When -> act
○ Then -> assert
Tools & Syntax - Context/Specification
● Used in tools like: Jasmine, RSpec
● Also AAA style
○ describe - arrange
○ when - act
○ it - assert
3
2
3
3
common
mistakes
3
4
Mistake 1: Slow test suites
● Misconception: every example has to be a test against
the UI or API - this is slow!
● Test pyramid.
● Good practice: For a feature
○ main scenario through the UI/API
○ rest of scenarios & edge cases with unit/integration
tests
Mistake 2: Unreliable/Flaky tests
● UI tests are hard to maintain
○ this is because the UI changes a lot!
● Page Object pattern - to isolate UI Changes
Mistake 2: Unreliable/Flaky tests
● Do not couple your examples to the UI!
BAD
Given I enter “Asier” in the username input
And I enter “p4ssw0rd” in the password input
When I click the button “register”
Then a page is loaded with the text “welcome Asier!”
GOOD
When I register with name “Asier” and “p4ssw0rd”
Then I get notified with the text “welcome Asier!”
Mistake 3: Relaying too much in automation
● You can NOT automate EVERYTHING
● There would always be some manual testing.
○ Usability testing.
○ Exploratory testing.
● Be aware of this. Don’t forget that lovely manual QA ;)
Summary: benefits
● Quicker feedback in the software lifecycle and
huge reduction of waste
● Alignment through early and frequent
conversations - avoid misunderstandings
● Reliable documentation: Living documentation &
Single source of truth
● Catalyst for ubiquitous language
Summary: Communication > Automation
● The important thing is to communicate
● Automation and tools are nice, but don’t get your
main focus on them
● “Individuals and interactions over processes
and tools”
- Agile Manifesto
● “I want to bridge the gap between business people
and technical people”
- Kent Beck about XP
More Info + resources
Book. Specification by Example: How Successful
Teams Deliver the Right Software , Gojko Adzic
http://www.amazon.co.uk/Specification-Exam
ple-Successful-Deliver-Software/dp/161729008
4
Blog post. A.T. FAIL!, Robert C. Martin
http://blog.8thlight.com/uncle-bob/2013/09/2
6/AT-FAIL.html
Specification by Example and Agile Acceptance
Testing, Gojko Adzic
http://www.slideshare.net/gojkoadzic/specific
ation-by-example-and-agile-acceptance-testing
My blog post.
http://asierba.net/2014/04/03/spec-by-examp
le/
But wait..
● Can’t we reduce WASTE even more?
● Are our user stories wasteful?
● Are we really building what the user needs?
● How can we improve the feedback cycle?
● Can we be more LEAN?
4
2
4
3
THANK YOU
asier.b@thoughtworks.com
My experience with spec by example
● Company W:
○ Refinement meeting with PO, BA, QA and 1 dev - examples
written collaboratively
● Company F:
○ Examples written by PO and refined/tweaked at kick off with BA
○ Demo at the end of feature development
● Company E:
○ Examples written by devs and refined/tweak with PO & QA.
○ Demo/Desk check at the end of development
○ PO & QA constantly checking living documentation
● Company O:
○ Examples written by BA, kick off with devs and PO
○ Demo at the end of feature development
4
5

More Related Content

PPTX
TDD & Refactoring
PPTX
Go/Ruby/Java: What's next?
PDF
Lessons learned with Bdd: a tutorial
PPTX
Exceptions: Why, When, How and Where!
PPTX
The essentials of the IT industry or What I wish I was taught about at Univer...
PPTX
Training methdology testers to developers
PDF
Basics of writing clean code
PDF
Technical testing evaluated
TDD & Refactoring
Go/Ruby/Java: What's next?
Lessons learned with Bdd: a tutorial
Exceptions: Why, When, How and Where!
The essentials of the IT industry or What I wish I was taught about at Univer...
Training methdology testers to developers
Basics of writing clean code
Technical testing evaluated

What's hot (19)

PPTX
Writing clean scientific software Murphy cleancoding
PDF
Effective Unit Testing
PDF
How Indeed asks coding interview questions
PDF
Why You're A Bad PHP Programmer
PDF
Tips sukses berkarir sebagai developer dan programmer 2021
PDF
Behavior Driven Education: A Story of Learning ROR
PDF
From ic to tech lead
PPTX
[Hanoi, june 2015] One normal day of an agile developer
PDF
[Hanoi, june 2015] one normal day of an agile developer
ODP
Sqa days2013
PPTX
Developing Better Software
PDF
What is the best programming language for your web product?
PDF
Evolutionary Design - Refactoring Heuristics
PPTX
2013 09-11 java zone - extreme programming live
PPTX
Steps in translation process
PPTX
clean code - uncle bob
PDF
Test Driven Development
PDF
SFScon 2020 - Xiaofeng Wang Jorge Melegati - Stop talking requirementsstart t...
PDF
Under the hood of architecture interviews at indeed
Writing clean scientific software Murphy cleancoding
Effective Unit Testing
How Indeed asks coding interview questions
Why You're A Bad PHP Programmer
Tips sukses berkarir sebagai developer dan programmer 2021
Behavior Driven Education: A Story of Learning ROR
From ic to tech lead
[Hanoi, june 2015] One normal day of an agile developer
[Hanoi, june 2015] one normal day of an agile developer
Sqa days2013
Developing Better Software
What is the best programming language for your web product?
Evolutionary Design - Refactoring Heuristics
2013 09-11 java zone - extreme programming live
Steps in translation process
clean code - uncle bob
Test Driven Development
SFScon 2020 - Xiaofeng Wang Jorge Melegati - Stop talking requirementsstart t...
Under the hood of architecture interviews at indeed
Ad

Similar to How to deliver the right software (Specification by example) (20)

PPTX
How to Deliver the Right Software (Specification by example)
PPTX
Specification by example
PPTX
Software testing and quality assurance
PDF
Automation Testing Best Practices.pdf
PPTX
Aim (A).pptx
PDF
Implement BDD with Cucumber and SpecFlow
PPTX
Agile Testing and Test Automation
PDF
Specification-By-Example with Gherkin
PDF
Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013
PPTX
Devops Journey - internet tech startup
PPTX
Spec by-example
PPT
Software Project Management lecture 10
PDF
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
PPTX
BDD Primer
PDF
Spec(ing) Out Your Workflow with SpecFlow
PDF
Specification-By-Example with Gherkin
PPTX
SE - Lecture 8 - Software Testing State Diagram.pptx
PPTX
Agile Testing Agile Ottawa April 2015
PPTX
Software testing
How to Deliver the Right Software (Specification by example)
Specification by example
Software testing and quality assurance
Automation Testing Best Practices.pdf
Aim (A).pptx
Implement BDD with Cucumber and SpecFlow
Agile Testing and Test Automation
Specification-By-Example with Gherkin
Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013
Devops Journey - internet tech startup
Spec by-example
Software Project Management lecture 10
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
BDD Primer
Spec(ing) Out Your Workflow with SpecFlow
Specification-By-Example with Gherkin
SE - Lecture 8 - Software Testing State Diagram.pptx
Agile Testing Agile Ottawa April 2015
Software testing
Ad

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
ai tools demonstartion for schools and inter college
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Transform Your Business with a Software ERP System
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
System and Network Administration Chapter 2
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
Adobe Illustrator 28.6 Crack My Vision of Vector Design
ai tools demonstartion for schools and inter college
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Transform Your Business with a Software ERP System
How Creative Agencies Leverage Project Management Software.pdf
ManageIQ - Sprint 268 Review - Slide Deck
How to Choose the Right IT Partner for Your Business in Malaysia
VVF-Customer-Presentation2025-Ver1.9.pptx
CHAPTER 2 - PM Management and IT Context
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
How to Migrate SBCGlobal Email to Yahoo Easily
System and Network Administration Chapter 2
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Online Work Permit System for Fast Permit Processing
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Odoo Companies in India – Driving Business Transformation.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development

How to deliver the right software (Specification by example)

  • 1. How to deliver the right software Spec by example Asier Barrenetxea
  • 2. Agenda - Intro - The problem - The solution - Questions / discussion 2
  • 4. I am recording 🎥 4
  • 5. Feedback welcome 😊 ● Which feedback? ○ Communication skills ○ Content of the talk ● How to give me feedback? ○ at the end of the talk ○ after the talk in person ○ send me and email, chat.. ● Why feedback? ○ I am learning and I would like to improve ○ I believe I am in safe space 5
  • 6. A bit of context about this talk ● A few years ago, I learned about BDD and ATDD and “practiced” it in a couple of places - I thought I was doing things right ● Later, I learned about spec by example (training by Gojko Adzic) ○ I was working in a place where we were doing BDD ○ I brought some of the ideas to that company ● After that, I have been to other places ○ people are doing BDD and ATDD ○ but I keep seeing the same mistakes ● Spec by example fixes many of these things ● Not many people know about spec by example! 6
  • 8. What is the single greatest cause of software failure? 8
  • 10. Software fails because requirements.. ● are wrong ● are badly written ● are incomplete ● The programmers and the specifiers understand the requirements differently 1 0
  • 11. Classical approach: testing at the end 1 1 Requirements Development Testing
  • 13. Each source telling a different story ● Tests ≠ Requirements ● How system really works ≠ Requirements ● Documentation gets stale 1 3
  • 14. Late feedback ● Business misunderstands get arisen late on the process ○ When developer implementing requirements. ○ When qa testing it. ○ When software gets into production. ● Huge WASTE 1 4
  • 16. Spec by example to the rescue 1 6
  • 17. Bring testing to the front 1 7 Requirements Development Testing
  • 18. Bring testing to the front 1 8 Requirements + Testing Development Verification (automated)
  • 19. Bring testing to the front 1 9 Examples Development Verification (automated)
  • 20. Use examples ● Easy to understand ● Plain English ● Unambiguous ● Concrete instead of abstract
  • 21. Write examples collaboratively ● Business people, developers and testers in the same room. ● Transfer the knowledge. ● Learn about the domain. ○ Ubiquitous language. ● Early feedback of misunderstandings. ○ In 30 min meeting can find out things that it would take a whole iteration or even more. ○ everybody understands the same thing.
  • 22. Write examples collaboratively ● When you write down the rules - Inconsistencies and gaps are easy to spot ● Find out incorrect assumptions. ● Find out real business value. ● Everybody gets this feeling of ownership.
  • 23. Writing examples: Different approaches ● Whole team with stakeholders ● Three amigos: QA + Dev + PO/BA ● One developer with a stakeholder/domain expert ● Specification workshop 2 3
  • 24. Specification workshop ● For harder to specify stories. ● Meeting with 10+ people. POs, BAs, devs, QAs.. ● Bring people from other teams if necessary. ● Create 3 teams and write examples in one board each. ● Compare. Look for inconsistencies. Why do we have them?
  • 25. Automate examples ● Map examples to executable tests. ○ Use tools as Cucumber, Fitness, Specflow, Jasmine, Rspec.. ● Do not modify examples when automating.
  • 26. Implementing the code is simple! ● Test first approach. ● Developers will have to code just what was specified in the examples. ● Make the tests green -> Done.
  • 27. Single source of truth ● Examples = Requirements. ● Examples = Automated tests. ● Examples = What the system does.
  • 28. Living documentation ● Run examples with every change to the system. ● Documentation never gets out-dated. ● All tests green -> system is doing what examples say.
  • 29. User stories ● Relate examples with a user story. ○ Gives context. ● Focus on business goal. As a <role> I want <software feature> In order to <goal/desire> I order to <goal/desire> as a <role> so that <software feature>
  • 30. What makes a good example ● Focused on a single thing. ● Self explanatory. ● Uses the domain language. ● SMART ○ Specific ○ Measurable ○ Achievable ○ Relevant ○ Time-bound.
  • 31. Tools & Syntax - Gherkin/Cucumber ● Is the most common ● AAA style of structuring an example: ○ Given -> arrange ○ When -> act ○ Then -> assert
  • 32. Tools & Syntax - Context/Specification ● Used in tools like: Jasmine, RSpec ● Also AAA style ○ describe - arrange ○ when - act ○ it - assert 3 2
  • 33. 3 3
  • 35. Mistake 1: Slow test suites ● Misconception: every example has to be a test against the UI or API - this is slow! ● Test pyramid. ● Good practice: For a feature ○ main scenario through the UI/API ○ rest of scenarios & edge cases with unit/integration tests
  • 36. Mistake 2: Unreliable/Flaky tests ● UI tests are hard to maintain ○ this is because the UI changes a lot! ● Page Object pattern - to isolate UI Changes
  • 37. Mistake 2: Unreliable/Flaky tests ● Do not couple your examples to the UI! BAD Given I enter “Asier” in the username input And I enter “p4ssw0rd” in the password input When I click the button “register” Then a page is loaded with the text “welcome Asier!” GOOD When I register with name “Asier” and “p4ssw0rd” Then I get notified with the text “welcome Asier!”
  • 38. Mistake 3: Relaying too much in automation ● You can NOT automate EVERYTHING ● There would always be some manual testing. ○ Usability testing. ○ Exploratory testing. ● Be aware of this. Don’t forget that lovely manual QA ;)
  • 39. Summary: benefits ● Quicker feedback in the software lifecycle and huge reduction of waste ● Alignment through early and frequent conversations - avoid misunderstandings ● Reliable documentation: Living documentation & Single source of truth ● Catalyst for ubiquitous language
  • 40. Summary: Communication > Automation ● The important thing is to communicate ● Automation and tools are nice, but don’t get your main focus on them ● “Individuals and interactions over processes and tools” - Agile Manifesto ● “I want to bridge the gap between business people and technical people” - Kent Beck about XP
  • 41. More Info + resources Book. Specification by Example: How Successful Teams Deliver the Right Software , Gojko Adzic http://www.amazon.co.uk/Specification-Exam ple-Successful-Deliver-Software/dp/161729008 4 Blog post. A.T. FAIL!, Robert C. Martin http://blog.8thlight.com/uncle-bob/2013/09/2 6/AT-FAIL.html Specification by Example and Agile Acceptance Testing, Gojko Adzic http://www.slideshare.net/gojkoadzic/specific ation-by-example-and-agile-acceptance-testing My blog post. http://asierba.net/2014/04/03/spec-by-examp le/
  • 42. But wait.. ● Can’t we reduce WASTE even more? ● Are our user stories wasteful? ● Are we really building what the user needs? ● How can we improve the feedback cycle? ● Can we be more LEAN? 4 2
  • 43. 4 3
  • 45. My experience with spec by example ● Company W: ○ Refinement meeting with PO, BA, QA and 1 dev - examples written collaboratively ● Company F: ○ Examples written by PO and refined/tweaked at kick off with BA ○ Demo at the end of feature development ● Company E: ○ Examples written by devs and refined/tweak with PO & QA. ○ Demo/Desk check at the end of development ○ PO & QA constantly checking living documentation ● Company O: ○ Examples written by BA, kick off with devs and PO ○ Demo at the end of feature development 4 5