SlideShare a Scribd company logo
Living with! 
Acceptance Tests: 
Beyond Write-Once 
Daniel Wellman 
Twitter: @wellman! 
E-mail: dan@danielwellman.com 
www.intentmedia.com
Activity
Goal! 
Build the least helpful, 
most frustrating 
acceptance test suite
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 
End-to-End Tests 
Test Database Queue
New Project 
End-to-End! 
Acceptance Test
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! 
End-to-End! 
Acceptance Test 
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?
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
Example: Fraud Protection 
for an Amazon-like store
Example: Fraud Protection 
for an Amazon-like store 
Example from Gojko Adzic, “Specification by Example”
Example: Fraud Protection 
for an Amazon-like store 
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 from Gojko Adzic, “Specification by Example”
Domain 
Ports 
Adapters
Domain 
Ports 
Adapters 
GUI 
DB
Domain 
Ports 
Adapters 
GUI 
DB 
Memory
Domain 
Ports 
Adapters 
GUI 
DB 
Memory 
End-to-End Test
Domain 
Ports 
Adapters 
GUI 
DB 
Memory 
End-to-End Test 
Test Using! 
Domain
Before: End-to-End 
When(/^the user places an order with 
delivery country (.*),$/) do |country_name| 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
end
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
After: Using Domain Model 
When(/^the user places an order with 
delivery country (.*),$/) do |country_name| 
# ... 
country = Country.new(country_name) 
order = Order.new( ..., 
! 
! 
! 
! 
! 
! 
! 
! 
! 
end 
ship_to : Address.new( 
street: ..., 
country: country)) 
sales_clerk.accept(order) 
# ...
UI 
Service 
Unit 
The Testing Pyramid
UI 
Service 
Unit 
The Testing Pyramid
Create a Separate 
System Test Suite
Alternate Step 
Implementations
Alternate Steps: 
Use Conditionals 
use_browser = ENV['USE_BROWSER_FOR_TESTS']
Alternate Steps: 
Use Conditionals 
use_browser = ENV['USE_BROWSER_FOR_TESTS'] 
! 
! 
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
Write Tests 
Without Specifying 
Implementation Details
Imperative! 
vs.! 
Declarative! 
Style
Imperative 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
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”
Declarative Style 
You can’t tell how these are implemented! 
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”
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

More Related Content

What's hot

Automate Debugging with git bisect
Automate Debugging with git bisectAutomate Debugging with git bisect
Automate Debugging with git bisect
Camille Bell
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
Derek Jacoby
 
Untangling11
Untangling11Untangling11
Untangling11
Derek Jacoby
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
Thinkful
 
Introduction to jOOQ
Introduction to jOOQIntroduction to jOOQ
Introduction to jOOQ
Kostadin Golev
 
Legacy: A Retrospective - Open West 2016
Legacy: A Retrospective - Open West 2016Legacy: A Retrospective - Open West 2016
Legacy: A Retrospective - Open West 2016
Jessica Mauerhan
 
Testing for Agility: Bringing Testing into Everything
Testing for Agility: Bringing Testing into EverythingTesting for Agility: Bringing Testing into Everything
Testing for Agility: Bringing Testing into Everything
Camille Bell
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
Sam Davarnia
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
Andreas Grabner
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
Viresh Doshi
 
Growing Manual Testers into Automators
Growing Manual Testers into AutomatorsGrowing Manual Testers into Automators
Growing Manual Testers into Automators
Camille Bell
 

What's hot (11)

Automate Debugging with git bisect
Automate Debugging with git bisectAutomate Debugging with git bisect
Automate Debugging with git bisect
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
 
Untangling11
Untangling11Untangling11
Untangling11
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
 
Introduction to jOOQ
Introduction to jOOQIntroduction to jOOQ
Introduction to jOOQ
 
Legacy: A Retrospective - Open West 2016
Legacy: A Retrospective - Open West 2016Legacy: A Retrospective - Open West 2016
Legacy: A Retrospective - Open West 2016
 
Testing for Agility: Bringing Testing into Everything
Testing for Agility: Bringing Testing into EverythingTesting for Agility: Bringing Testing into Everything
Testing for Agility: Bringing Testing into Everything
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
 
Growing Manual Testers into Automators
Growing Manual Testers into AutomatorsGrowing Manual Testers into Automators
Growing Manual Testers into Automators
 

Similar to Living with Acceptance Tests: Beyond Write-Once

Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a Standard
Neotys_Partner
 
Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15
Tabăra de Testare
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
Seb Rose
 
No REST - Architecting Real-time Bulk Async APIs
No REST - Architecting Real-time Bulk Async APIsNo REST - Architecting Real-time Bulk Async APIs
No REST - Architecting Real-time Bulk Async APIs
C4Media
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
Niels Frydenholm
 
Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!
DiUS
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
lisab517
 
Consumer Driven Contracts - A Deep Dive
Consumer Driven Contracts - A Deep DiveConsumer Driven Contracts - A Deep Dive
Consumer Driven Contracts - A Deep Dive
Ramya Authappan
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
 
Lect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptxLect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptx
zainm7032
 
Beta testing iPhone apps
Beta testing iPhone appsBeta testing iPhone apps
Beta testing iPhone apps
Shawn Grimes
 
How Shutl Delivers Even Faster Using Neo4J
How Shutl Delivers Even Faster Using Neo4JHow Shutl Delivers Even Faster Using Neo4J
How Shutl Delivers Even Faster Using Neo4J
C4Media
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
Lindsay Holmwood
 
Continuous Deployment to the cloud
Continuous Deployment to the cloudContinuous Deployment to the cloud
Continuous Deployment to the cloud
VMware Tanzu
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
Taylor Lovett
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOne
ciberkleid
 
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
Amazon Web Services
 
Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014
Barry Kooij
 
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
Amazon Web Services
 

Similar to Living with Acceptance Tests: Beyond Write-Once (20)

Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a Standard
 
Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
 
No REST - Architecting Real-time Bulk Async APIs
No REST - Architecting Real-time Bulk Async APIsNo REST - Architecting Real-time Bulk Async APIs
No REST - Architecting Real-time Bulk Async APIs
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
 
Consumer Driven Contracts - A Deep Dive
Consumer Driven Contracts - A Deep DiveConsumer Driven Contracts - A Deep Dive
Consumer Driven Contracts - A Deep Dive
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Lect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptxLect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptx
 
Beta testing iPhone apps
Beta testing iPhone appsBeta testing iPhone apps
Beta testing iPhone apps
 
How Shutl Delivers Even Faster Using Neo4J
How Shutl Delivers Even Faster Using Neo4JHow Shutl Delivers Even Faster Using Neo4J
How Shutl Delivers Even Faster Using Neo4J
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Continuous Deployment to the cloud
Continuous Deployment to the cloudContinuous Deployment to the cloud
Continuous Deployment to the cloud
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOne
 
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
 
Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014
 
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
 

Recently uploaded

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 

Recently uploaded (20)

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 

Living with Acceptance Tests: Beyond Write-Once

  • 1. Living with! Acceptance Tests: Beyond Write-Once Daniel Wellman Twitter: @wellman! E-mail: dan@danielwellman.com www.intentmedia.com
  • 2.
  • 3.
  • 4.
  • 5.
  • 7. Goal! Build the least helpful, most frustrating acceptance test suite
  • 8.
  • 9. Revise Your Tests With the Same Care as Your Production Code
  • 10.
  • 12. Refactor with New Insights
  • 14. Problem:! Slow and Flaky Tests
  • 15. Server End-to-End Tests Test Database Queue
  • 16. New Project End-to-End! Acceptance Test
  • 17. 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! End-to-End! Acceptance Test 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
  • 18. How did it get this way?
  • 19. Run Acceptance Tests in Parallel
  • 21. Failures are Hard to Diagnose
  • 23. Don’t make every acceptance test run end-to-end
  • 24. Ports and Adapters! a.k.a. Hexagonal Architecture
  • 25. Example: Fraud Protection for an Amazon-like store
  • 26. Example: Fraud Protection for an Amazon-like store Example from Gojko Adzic, “Specification by Example”
  • 27. Example: Fraud Protection for an Amazon-like store 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 from Gojko Adzic, “Specification by Example”
  • 30. Domain Ports Adapters GUI DB Memory
  • 31. Domain Ports Adapters GUI DB Memory End-to-End Test
  • 32. Domain Ports Adapters GUI DB Memory End-to-End Test Test Using! Domain
  • 33.
  • 34. Before: End-to-End When(/^the user places an order with delivery country (.*),$/) do |country_name| ! ! ! ! ! ! ! ! ! ! end
  • 35. 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’ # ...
  • 36. After: Using Domain Model When(/^the user places an order with delivery country (.*),$/) do |country_name| ! ! ! ! ! ! ! ! ! end
  • 37. After: Using Domain Model When(/^the user places an order with delivery country (.*),$/) do |country_name| # ... country = Country.new(country_name) order = Order.new( ..., ! ! ! ! ! ! ! ! ! end ship_to : Address.new( street: ..., country: country)) sales_clerk.accept(order) # ...
  • 38. UI Service Unit The Testing Pyramid
  • 39. UI Service Unit The Testing Pyramid
  • 40. Create a Separate System Test Suite
  • 42. Alternate Steps: Use Conditionals use_browser = ENV['USE_BROWSER_FOR_TESTS']
  • 43. Alternate Steps: Use Conditionals use_browser = ENV['USE_BROWSER_FOR_TESTS'] ! ! 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
  • 44.
  • 45.
  • 46. Write Tests Without Specifying Implementation Details
  • 49. 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 ...
  • 51. 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”
  • 52. Declarative Style You can’t tell how these are implemented! 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”
  • 53. Use Declarative Style to Help Keep Implementation Details Out of Tests
  • 54. Problem: I’m not sure what is actually tested…
  • 55. How did it get this way?
  • 57. Have you introduced a new domain concept?
  • 58. Are you in a new stage of your product’s life?
  • 59.
  • 60. 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
  • 62. 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
  • 63. Living with! Acceptance Tests: Beyond Write-Once Daniel Wellman Twitter: @wellman! E-mail: dan@danielwellman.com www.intentmedia.com