SlideShare a Scribd company logo
1 of 53
Living with
Acceptance Tests:
Beyond Write-Once
Daniel Wellman
Twitter: @wellman
E-mail: dan@danielwellman.com
www.intentmedia.com
XP NYC #xpnyc
February 10, 2015
Activity
Goal
Build the least helpful,
most frustrating
acceptance test suite
Write-Once
Tests
Revise Your Tests
With the Same Care as
Your Production Code
Check for Duplication
Refactor with
New Insights
Monitor for Problems
Problem:
Slow and Flaky Tests
Server
Database QueueTest
End-to-End Tests
New Project
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
End-to-End
Acceptance Test
How did it get this
way?
No
Alternatives
Institutionalized
Response to
Failure
Tests
Explain
User Interface
Run Acceptance
Tests in Parallel
Faster Build
Same Risk
Failures are
Hard to Diagnose
Problem:
Flaky Tests
Don’t make every
acceptance test run
end-to-end
Ports and Adapters
a.k.a. Hexagonal Architecture
Adapters
Ports
Domain
GUI
DB
Memory
End-to-End Test
Test Using
Domain
Example: Fraud Protection
for an Amazon-like store
Example from Gojko Adzic, “Specification by Example”
Given a user with no previous transaction history,
And the user’s account registration country is the UK,
When the user places an order with delivery country U.S.,
Then the transaction is marked as suspicious,
But the user sees order status as “Pending.”
Before: End-to-End
When(/^the user places an order with
delivery country (.*),$/) do |country_name|
end
# ...
fill_in 'Address', with: ...
select country_name, from: 'Country Selector’
click_button 'Ship To This Address'
expect(page).to have_content
'Your order has been placed’
# ...
After: Using Domain Model
When(/^the user places an order with
delivery country (.*),$/) do |country_name|
end
# ...
country = Country.new(country_name)
order = Order.new( ...,
ship_to : Address.new(
street: ...,
country: country))
sales_clerk.accept(order)
# ...
Service
UI
Unit
The Testing Pyramid
Create a Separate
System Test Suite
Alternate Step
Implementations
Alternate Steps:
Use Conditionals
When(/^the user places an order with
delivery country (.*),$/) do |country_name|
if use_browser
# drive a browser using Capybara; slower
else
# use domain objects; faster
end
end
use_browser = ENV['USE_BROWSER_FOR_TESTS']
Write Tests
Without Specifying
Implementation Details
Imperative
vs.
Declarative
Style
Imperative Style
Given I am on the registration page,
And I enter "UK" as my billing country,
And I press the "Register" button,
And I add an item to my cart,
When I checkout
And I enter "U.S." as my shipping country,
And ...
Declarative Style
Given a user with no previous transaction history,
And the user’s account registration country is the UK,
When the user places an order with delivery country U.S.,
Then the transaction is marked as suspicious,
But the user sees order status as “Pending.”
Example by Gojko Adzic, “Specification by Example”
You can’t tell how these are implemented!
Use Declarative Style
to Help Keep
Implementation
Details Out
of Tests
Problem: I’m not sure
what is actually
tested…
How did it get this
way?
Periodically
Evaluate
Your
Test Suite
Have you introduced a
new domain concept?
Are you in a new stage
of your product’s life?
Suggestions
• Maintain your acceptance tests just like production
code
• Write tests which describe what, not how, so their
implementations can easily evolve later
• Decide when you can start moving acceptance
tests from end-to-end to using the domain directly
• Re-evaluate your product’s tests and testing
strategy as your system grows
Resources
Photo Credits
“HighLine_061409_2779” by Jessica Sheridan is licensed under CC BY 2.0
“Highline New York” by Rebecca Krebs is licensed under CC BY 2.0
“NYC: The Highline" by Wally Gobetz is licensed under CC BY-NC-ND 2.0
“Rot”, “Yellow Cart”, and “Many Hands Make Light Work” by Oliver Rich are licensed
under CC BY-NC-ND 2.0
“highline-1010384.jpg” by keroism is licensed under CC BY-SA 2.0
“highline” by Elijah Porter is licensed under CC BY-NC-SA 2.0
“Highline_030” by Timothy Vogel is licensed under CC BY-NC 2.0
“201106073451_DSC_0014_1.JPG” by Leonel Ponce is licensed under CC BY-NC 2.0
“193” by verndogs is licensed under CC BY-NC 2.0
Living with
Acceptance Tests:
Beyond Write-Once
Daniel Wellman
Twitter: @wellman
E-mail: dan@danielwellman.com
www.intentmedia.com
XP NYC #xpnyc
February 10, 2015

More Related Content

What's hot

Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)Neil Studd
 
Testit 2017 - Exploratory Testing for Everyone
Testit 2017 - Exploratory Testing for EveryoneTestit 2017 - Exploratory Testing for Everyone
Testit 2017 - Exploratory Testing for EveryoneJohan Hoberg
 
How to measure the business impact of web performance
How to measure the business impact of web performanceHow to measure the business impact of web performance
How to measure the business impact of web performanceSOASTA
 
Essential Technical SEO learnings from 120+ site migrations
Essential Technical SEO learnings from 120+ site migrationsEssential Technical SEO learnings from 120+ site migrations
Essential Technical SEO learnings from 120+ site migrationsChris Green
 
Tis The Season: Load Testing Tips and Checklist for Retail Seasonal Readiness
Tis The Season: Load Testing Tips and Checklist for Retail Seasonal ReadinessTis The Season: Load Testing Tips and Checklist for Retail Seasonal Readiness
Tis The Season: Load Testing Tips and Checklist for Retail Seasonal ReadinessSOASTA
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingAnna Royzman
 
How to get Automated Testing "Done"
How to get Automated Testing "Done"How to get Automated Testing "Done"
How to get Automated Testing "Done"TEST Huddle
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinQA or the Highway
 
Shifting is more than shifting left
Shifting is more than shifting leftShifting is more than shifting left
Shifting is more than shifting leftPractiTest
 
Behavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's ExplorationBehavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's Explorationdtcoutu
 
AB Testing at Expedia
AB Testing at ExpediaAB Testing at Expedia
AB Testing at ExpediaPaul Lucas
 
How To Write A SQL Server Performance Review
How To Write A SQL Server Performance ReviewHow To Write A SQL Server Performance Review
How To Write A SQL Server Performance ReviewQuest Software
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...FalafelSoftware
 
THE PLEASURES OF ON-PREM, TOMER GABEL
THE PLEASURES OF ON-PREM, TOMER GABELTHE PLEASURES OF ON-PREM, TOMER GABEL
THE PLEASURES OF ON-PREM, TOMER GABELDevOpsDays Tel Aviv
 
Developer Night - Opticon18
Developer Night - Opticon18Developer Night - Opticon18
Developer Night - Opticon18Optimizely
 
Developer Night Opticon 2017
Developer Night Opticon 2017Developer Night Opticon 2017
Developer Night Opticon 2017Optimizely
 
Hacker News Meetup April 2014
Hacker News Meetup April 2014Hacker News Meetup April 2014
Hacker News Meetup April 2014Dan Quine
 
Don't lose revenue. Go viral with no downtime.
Don't lose revenue. Go viral with no downtime.Don't lose revenue. Go viral with no downtime.
Don't lose revenue. Go viral with no downtime.WP Engine
 
Test driven, why not?
Test driven, why not?Test driven, why not?
Test driven, why not?irenella89
 

What's hot (19)

Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)
 
Testit 2017 - Exploratory Testing for Everyone
Testit 2017 - Exploratory Testing for EveryoneTestit 2017 - Exploratory Testing for Everyone
Testit 2017 - Exploratory Testing for Everyone
 
How to measure the business impact of web performance
How to measure the business impact of web performanceHow to measure the business impact of web performance
How to measure the business impact of web performance
 
Essential Technical SEO learnings from 120+ site migrations
Essential Technical SEO learnings from 120+ site migrationsEssential Technical SEO learnings from 120+ site migrations
Essential Technical SEO learnings from 120+ site migrations
 
Tis The Season: Load Testing Tips and Checklist for Retail Seasonal Readiness
Tis The Season: Load Testing Tips and Checklist for Retail Seasonal ReadinessTis The Season: Load Testing Tips and Checklist for Retail Seasonal Readiness
Tis The Season: Load Testing Tips and Checklist for Retail Seasonal Readiness
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing Testing
 
How to get Automated Testing "Done"
How to get Automated Testing "Done"How to get Automated Testing "Done"
How to get Automated Testing "Done"
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Shifting is more than shifting left
Shifting is more than shifting leftShifting is more than shifting left
Shifting is more than shifting left
 
Behavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's ExplorationBehavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's Exploration
 
AB Testing at Expedia
AB Testing at ExpediaAB Testing at Expedia
AB Testing at Expedia
 
How To Write A SQL Server Performance Review
How To Write A SQL Server Performance ReviewHow To Write A SQL Server Performance Review
How To Write A SQL Server Performance Review
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
 
THE PLEASURES OF ON-PREM, TOMER GABEL
THE PLEASURES OF ON-PREM, TOMER GABELTHE PLEASURES OF ON-PREM, TOMER GABEL
THE PLEASURES OF ON-PREM, TOMER GABEL
 
Developer Night - Opticon18
Developer Night - Opticon18Developer Night - Opticon18
Developer Night - Opticon18
 
Developer Night Opticon 2017
Developer Night Opticon 2017Developer Night Opticon 2017
Developer Night Opticon 2017
 
Hacker News Meetup April 2014
Hacker News Meetup April 2014Hacker News Meetup April 2014
Hacker News Meetup April 2014
 
Don't lose revenue. Go viral with no downtime.
Don't lose revenue. Go viral with no downtime.Don't lose revenue. Go viral with no downtime.
Don't lose revenue. Go viral with no downtime.
 
Test driven, why not?
Test driven, why not?Test driven, why not?
Test driven, why not?
 

Viewers also liked

Giving an agile flavor to Use Case documentation
Giving an agile flavor to Use Case documentationGiving an agile flavor to Use Case documentation
Giving an agile flavor to Use Case documentationWalter Carpio Molina
 
Fusing the Agile Testing into an Agile Team
Fusing the Agile Testing into an Agile TeamFusing the Agile Testing into an Agile Team
Fusing the Agile Testing into an Agile TeamManoel Pimentel Medeiros
 
Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing MethodologyGaya1985
 
Agile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile TesterAgile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile TesterDeclan Whelan
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing ProcessIntetics
 
Introduction to Agile software testing
Introduction to Agile software testingIntroduction to Agile software testing
Introduction to Agile software testingKMS Technology
 

Viewers also liked (7)

Giving an agile flavor to Use Case documentation
Giving an agile flavor to Use Case documentationGiving an agile flavor to Use Case documentation
Giving an agile flavor to Use Case documentation
 
Fusing the Agile Testing into an Agile Team
Fusing the Agile Testing into an Agile TeamFusing the Agile Testing into an Agile Team
Fusing the Agile Testing into an Agile Team
 
Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing Methodology
 
Agile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile TesterAgile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile Tester
 
Agile Testing by Example
Agile Testing by ExampleAgile Testing by Example
Agile Testing by Example
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing Process
 
Introduction to Agile software testing
Introduction to Agile software testingIntroduction to Agile software testing
Introduction to Agile software testing
 

Similar to Living with acceptance tests: Beyond Write-Once (XP NYC)

Living with Acceptance Tests: Beyond Write-Once
Living with Acceptance Tests: Beyond Write-OnceLiving with Acceptance Tests: Beyond Write-Once
Living with Acceptance Tests: Beyond Write-OnceDaniel Wellman
 
Ocqa kickoff meeting2012_12_10
Ocqa kickoff meeting2012_12_10Ocqa kickoff meeting2012_12_10
Ocqa kickoff meeting2012_12_10joerichards67
 
4 Steps Toward Scientific A/B Testing
4 Steps Toward Scientific A/B Testing4 Steps Toward Scientific A/B Testing
4 Steps Toward Scientific A/B TestingJanessa Lantz
 
Test analysis & design good practices@TDT Iasi 17Oct2013
Test analysis & design   good practices@TDT Iasi 17Oct2013Test analysis & design   good practices@TDT Iasi 17Oct2013
Test analysis & design good practices@TDT Iasi 17Oct2013Tabăra de Testare
 
Approval Tests in Action: A LEGO Exercise and an Experience Report
Approval Tests in Action: A LEGO Exercise and an Experience ReportApproval Tests in Action: A LEGO Exercise and an Experience Report
Approval Tests in Action: A LEGO Exercise and an Experience Reporthouseofyin
 
So You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft WebinarSo You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft WebinarXBOSoft
 
Getting Started with Server-Side Testing
Getting Started with Server-Side TestingGetting Started with Server-Side Testing
Getting Started with Server-Side TestingOptimizely
 
YOU Don't Need No Stinking Test Cases? - XBOSoft Webinar
YOU Don't Need No Stinking Test Cases? - XBOSoft WebinarYOU Don't Need No Stinking Test Cases? - XBOSoft Webinar
YOU Don't Need No Stinking Test Cases? - XBOSoft WebinarXBOSoft
 
Continuous business goal validation
Continuous business goal validationContinuous business goal validation
Continuous business goal validationHylke Stapersma
 
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...Chris Goward
 
Agile testingandautomation
Agile testingandautomationAgile testingandautomation
Agile testingandautomationjeisner
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplaceDonny Wals
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplaceDonny Wals
 
Optimize Your Funnel By Getting Inside Your Buyer's Head
Optimize Your Funnel By Getting Inside Your Buyer's HeadOptimize Your Funnel By Getting Inside Your Buyer's Head
Optimize Your Funnel By Getting Inside Your Buyer's HeadDavid Skok
 
10 Principles of Apex Testing
10 Principles of Apex Testing10 Principles of Apex Testing
10 Principles of Apex TestingKevin Poorman
 
SAMPLE SIZE – The indispensable A/B test calculation that you’re not making
SAMPLE SIZE – The indispensable A/B test calculation that you’re not makingSAMPLE SIZE – The indispensable A/B test calculation that you’re not making
SAMPLE SIZE – The indispensable A/B test calculation that you’re not makingZack Notes
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examplesSeb Rose
 
Acceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles BradleyAcceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles BradleySynerzip
 
Remote research uxpa talk
Remote research uxpa talkRemote research uxpa talk
Remote research uxpa talkGavin Fung
 

Similar to Living with acceptance tests: Beyond Write-Once (XP NYC) (20)

Living with Acceptance Tests: Beyond Write-Once
Living with Acceptance Tests: Beyond Write-OnceLiving with Acceptance Tests: Beyond Write-Once
Living with Acceptance Tests: Beyond Write-Once
 
Ocqa kickoff meeting2012_12_10
Ocqa kickoff meeting2012_12_10Ocqa kickoff meeting2012_12_10
Ocqa kickoff meeting2012_12_10
 
4 Steps Toward Scientific A/B Testing
4 Steps Toward Scientific A/B Testing4 Steps Toward Scientific A/B Testing
4 Steps Toward Scientific A/B Testing
 
Test analysis & design good practices@TDT Iasi 17Oct2013
Test analysis & design   good practices@TDT Iasi 17Oct2013Test analysis & design   good practices@TDT Iasi 17Oct2013
Test analysis & design good practices@TDT Iasi 17Oct2013
 
Approval Tests in Action: A LEGO Exercise and an Experience Report
Approval Tests in Action: A LEGO Exercise and an Experience ReportApproval Tests in Action: A LEGO Exercise and an Experience Report
Approval Tests in Action: A LEGO Exercise and an Experience Report
 
So You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft WebinarSo You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft Webinar
 
10 Principles of Apex Testing
10 Principles of Apex Testing10 Principles of Apex Testing
10 Principles of Apex Testing
 
Getting Started with Server-Side Testing
Getting Started with Server-Side TestingGetting Started with Server-Side Testing
Getting Started with Server-Side Testing
 
YOU Don't Need No Stinking Test Cases? - XBOSoft Webinar
YOU Don't Need No Stinking Test Cases? - XBOSoft WebinarYOU Don't Need No Stinking Test Cases? - XBOSoft Webinar
YOU Don't Need No Stinking Test Cases? - XBOSoft Webinar
 
Continuous business goal validation
Continuous business goal validationContinuous business goal validation
Continuous business goal validation
 
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
 
Agile testingandautomation
Agile testingandautomationAgile testingandautomation
Agile testingandautomation
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplace
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplace
 
Optimize Your Funnel By Getting Inside Your Buyer's Head
Optimize Your Funnel By Getting Inside Your Buyer's HeadOptimize Your Funnel By Getting Inside Your Buyer's Head
Optimize Your Funnel By Getting Inside Your Buyer's Head
 
10 Principles of Apex Testing
10 Principles of Apex Testing10 Principles of Apex Testing
10 Principles of Apex Testing
 
SAMPLE SIZE – The indispensable A/B test calculation that you’re not making
SAMPLE SIZE – The indispensable A/B test calculation that you’re not makingSAMPLE SIZE – The indispensable A/B test calculation that you’re not making
SAMPLE SIZE – The indispensable A/B test calculation that you’re not making
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
 
Acceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles BradleyAcceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles Bradley
 
Remote research uxpa talk
Remote research uxpa talkRemote research uxpa talk
Remote research uxpa talk
 

Recently uploaded

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 

Living with acceptance tests: Beyond Write-Once (XP NYC)

Editor's Notes

  1. My name is Daniel Wellman and I’m a software engineer at Intent Media here in New York. I worked for eight years as a software developer building projects using Test-Driven Development, and coached teams in learning and applying TDD. In that time, I’ve learned some lessons about writing acceptance tests - and some ideas I’m trying out that I’d like to talk about today.
  2. This is the High Line Park in New York. If you haven’t had a chance to see it, I highly recommend you check it out. It’s a park on the West Side of New York, 30 feet above the ground.
  3. The High Line was originally an elevated rail track built in the 1930s. It allowed freight trains to unload directly in the busy factories and warehouses of the West Side. But after nearly 50 years of service, the last train ran in 1980.
  4. The railway sat abandoned for twenty years. Grasses and plants, left unchecked, overtook the rails. The steel rusted away. Many people called it an eyesore, and it was scheduled for demolition. But a group saw potential and wanted to save it.
  5. And with a lot of care, the old, abandoned railway become something new. I chose to share this with you because I think there are similar themes of growth, renewal, and maintenance that we can apply to our software test suites. .. AND it’s a nice park and I’d encourage you to go!
  6. But first - an activity to start our evening out! Imagine you’re on a team and your goal is to build the least helpful, most frustrating acceptance test suite possible. How would you do that? —>
  7. Although I’ve not set out to build a test suite like this, sometimes it happens anyways. So how do the tests get this way, and how do we improve them?
  8. Many teams have write-once tests; that create them as part of a story, get them to pass, and then never touch them again. Or maybe they add additional conditions and clauses on to that test.
  9. If there’s one theme to this talk that I’d ask you to take away is to treat your tests with just as much care as you would your production code.
  10. Left untended, your acceptance tests can grow out of control. If they are written well, they may continue to pass and stay green as your system evolves, and you may never notice as their runtimes creep up longer and longer. But you can practice the same activities you do with your production code:
  11. … “Is this feature that I’m testing tested somewhere else?”
  12. Have I learned something new about my domain that might suggest a restructuring or dividing of responsibilities?
  13. Measuring test runtime is one easy metric to track. I’ve heard of teams that set limits on their build times, and call a point of order when the tests get to that threshhold. Then they must decide to speed up the tests or allow the runtime to grow to another checkpoint.
  14. Slow tests are a problem because … Flaky tests are a problem because …
  15. End-to-End Tests The way I like to start a project is with an end-to-end test… as a user would use it.
  16. When I start a system, I’ll start with an end-to-end test to help me learn about the external components I need to interact with. I use it to help drive down risk, and I’m willing to pay the price up front of building a thorough end-to-end test because it helps get confidence that I understand how all the pieces might talk to each other. But these tests can grow rapidly and slowly cause build times to creep up.
  17. Let’s do some root cause analysis!
  18. No other alternative besides end-to-end / People copy patterns (but need examples of other ways to test beyond end-to-end test)
  19. That is, when you find a failure, make an end-to-end test. And repeat every single time. There are other ways to deal with this problem — we’ll come back to this.
  20. Acceptance tests written to explain user experience
  21. This is the most common solution I see teams take; and often stop there. … but maybe I’m viewing projects at a similar point in time!
  22. For a little while, this can work…. … If you have a 45 minute build and run it in parallel to get 10 minutes, you still have the risk of the 45 minute build - it just runs in 10 minutes. Problems: Same flakiness, risk of failure but now more frequent! Susceptible to many environment issues like network, timing, etc.
  23. End-to-end tests help you learn that something failed, but because so much is being tested, it can be hard to get diagnostics telling you why it failed. So when we parallelize, our tests run faster, but our ability to diagnose failures does not get faster.
  24. So how might we deal with the flaky tests?
  25. Skip?
  26. Maybe, but you can view acceptance tests as living documentation of how your system works. If you delete them, you won’t have a complete picture.
  27. At some point in our project’s lifecycle, we may have confidence that our end-to-end acceptance tests are giving us the safety we need. At this point, we can switch to start writing tests that use the domain directly. But how can we ensure we aren’t missing any tests?
  28. The slow and flaky parts of your test tend to be the external integration points. So why not isolate those parts of the system, and in the process focus on the clarity of your application’s domain?
  29. Separate your application into the inside (the domain) and the outside (technical infrastructure). This has the nice side effect of pushing domain logic into the center that might have been only covered by tests.
  30. Meta: Tim said this was when squeezing your tests into the domain, it helps you discover when you have business logic in your adapter layer / in the UI.
  31. We’re shipping orders that customers did not place. We need to detect when a transaction is likely to be fraudulent so that we can stop shipment to investigate to see if this order is legitimate.
  32. … focused on interacting with the UI elements …
  33. You’d call the objects in your domain that your adapter layers would call to do their work.
  34. THEREFORE: This means you can replace some of your slow end-to-end tests with fast ones. (but you’ll still want some!) * Take a breath!!! *
  35. Manage your risk by splitting out a separate suite just for testing system integrations. Not necessarily using the same tools you use for your acceptance test suites Might only be for the programmers Probably only check happy paths
  36. In general, I recommend a balance of tests something like this. Remember, your acceptance tests are not necessarily end-to-end! Jez Humble’s “Journey Tests” as an alternative to story-level acceptance tests.
  37. … use an environment variable, and you could use an ‘if’ statement … … or something more clever like a factory. See ‘The Cucumber Book for Java’ for examples of how to do this.
  38. … * Take a breath *
  39. “… But all the tests interact with the UI!” If that’s the case, change how you write the tests.
  40. That is, no steps involving a GUI, web services, etc.
  41. “So let’s take a moment to read this example…” *pause* Problem is if you want to replace the implementation, you can’t. You’re stuck talking about the GUI. Explains how, not what. UI interactions, procedural steps, etc. Note: Not always bad, sometimes the focus *is* the interaction!
  42. “Now let’s take a moment to read this other example…” *pause* “What you want to have happen, now how you want it to happen.” … you read this test, and you don’t know how it’s implemented - it could be interacting with a web browser, or a REST web service, or directly with the domain objects. This gives you the freedom to change your mind later about how you want to test it.
  43. And the benefit of doing this is that you get the freedom later on in your project to change your mind how you want to implement those tests. Which means you have freedom to replace with fast or slow implementations. * Take a breath *
  44. Pretend you are describing a human workflow (not systems) Helps you focus on the domain language
  45. Let’s look at a positive spin… this could be a sign of a successful product that is evolving. Product Lifecycle (Simple IM Story here?)
  46. Technical So are there examples of other ways to implement or write tests?
  47. … just like you would with your production code. Spring Cutback at High Line. They do this at the beginning of Spring every year. And they don’t throw away the plants - they trim them back so they can grow again. … What would that look like on your project?
  48. Product Cognitive dissonance (“It says this but we all know it really means …”) (Example???) … In DDD, you may be discovering new terms in your ubiquitous language.
  49. Product Things may have changed and your tests may need revisiting. “Where does this feature belong?” “Who do I talk to about this feature?” “Is this feature still relevant now?”
  50. IM Slurp Story — Big product, one team -> Little systems sprouted out to support the major business function, then over time the little systems become important on their own.
  51. * Pause to let people take a photo *
  52. Thank you!