SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Zero to Tested
“Bullet proof test automation in hostile
environments.”
The test automation promised land
Small team of full stack developers (with specialists in specific areas)
BDD/TDD
Strong adherence to the Test Pyramid
Isolation of different layers (good use of stubs, mocks, fakes)
Thin layer of e2e tests
For most projects
Fairly unrealistic, at least not anytime soon...
But this means...
“Often reliant on end to end automated tests
which have a terrible reputation!”
Why?
People acknowledge e2e tests are essential
Tests are flaky
CI infrastructure is poorly managed (configuration drift)
Development of tests lags behind the development cycle (“test sprints”)
Often ignored by most of the team
Worth reading...
http://googletesting.blogspot.co.uk/2015/04/just-say-no-to-more-end-to-end-tests.html
http://www.alwaysagileconsulting.com/articles/end-to-end-testing-considered-harmful/
http://devblog.songkick.com/2012/07/16/from-15-hours-to-15-seconds-reducing-a-crushing-build-time/
But I prefer
https://www.symphonious.net/2015/04/30/making-end-to-end-tests-work/
10,000 end to end acceptance tests, primary form of quality control
complete in 50 minutes, including deploying/starting and tearing down the servers
all required to pass before we consider a version releasable
included in our information radiators to ensure the team has constant visibility
are owned by the whole team
My theory.
Us “test automation” folk have let ourselves down
Even if we are not in an agile utopia…
Have we exhausted every avenue to make tests reliable?
Need to prove we are doing everything we can to write bulletproof tests
Now for the practical stuff!
Even with minimal influence on budget/project direction we can usually hugely
improve on:
CI Infrastructure automation
Automation code and architecture
Let’s take a look at a thin vertical slice through a solid automation setup...
CI Infrastructure automation
Infrastructure automation
Start from an empty EC2 account and finish with:
Fully functioning Jenkins instance
Automated tests running successfully against a “flaky” test application
Deployed in < 5 mins, very little code, fully automated and “Ephemeral”
DevOps Toys - Chef, Packer, Terraform, AWS, Docker
BAKE SPIN UP RUN TESTS
Chef
Packer
DevOps Toys - Chef, Packer, Terraform, AWS, Docker
BAKE SPIN UP RUN TESTS
Terraform
DevOps Toys - Chef, Packer, Terraform, AWS, Docker
BAKE SPIN UP RUN TESTS
Jenkins Job
DSL Plugin
Docker
Docker
Has it finished?
Recap...
Automated provisioning of AWS infrastructure
Automated build of ‘pre-baked’ AMI
Automatically provisioned Jenkins with Docker
Docker allows clients to have complete control over dependencies
Job DSL for building jobs
Take away
Everything is in source control, no more snowflake CI boxes, no more
handcrafted Jenkins jobs.
“But it’s not scalable!” - switch to agent model with auto scaled agents
“But it’s not secure!”- not at the moment, but easy to add e.g. github auth
More importantly It’s ephemeral - you can destroy if compromised
Automation Code & Architecture
Tooling choice
In Ruby Land the “go-to” libraries are:
Capybara
Selenium Webdriver
Poltergeist/PhantomJS
SitePrism
Automation Code
What are the biggest failings of most end to end regression test suites?
My thoughts
Inappropriate synchronisation strategies (page load, async JS)
Inability to deal with non-deterministic applications and environments
Inability to deal with “eventual consistency”
Poor reporting of failure when it occurs
RETRY ALL THE THINGS!
A flaky app...
Page Load
Handled by Selenium Webdriver!
Async JS
Avoid this...
Async JS
Good libraries have first class support for this:
Visibility
Elements exist in DOM but CSS means they are not visible.
Good libraries have first class support for this:
Visibility
Worth remembering…
● display:none
● visibility:hidden
● Opacity:0
● Dimensions
And remember there is a W3C spec for Webdriver:
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-element-displayed
Non determinism
Should we be expected to deal with this?
Maybe, maybe not
Either way don’t just give up, at least detect, log and report on it!
Non determinism
Don’t just rely on re-run - be proactive and report on failure
Libraries probably won’t help here!
Eventual Consistency
Caching, load balancing, asynchronous architectures etc.
TL;DR - You might need to wait a bit...
Eventual Consistency
You might have to ‘roll your own’ wait helpers from time to time
Logging
Configurable levels: debug, info, warn, error etc
Pretty colours - makes debugging broken builds easier
Have log aggregation for your application? (RSyslog, Logstash, Kibana)
Now you can combine test and application logs for super debugging power!
Test the tests
We should unit test any “library code” that has significant complexity.
Static Analysis
Helps maintain consistency, best practice and readability of code.
Reporting
Reporting
Wrapping up
We need to up our game when writing end to end tests
Make the provision of CI infrastructure automated and ephemeral
Write automation code that can handle hostile conditions
Report on your findings to effect change
The code...
https://github.com/mcrmfc/zero-to-tested
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Kens Scrum Presentation
Kens Scrum PresentationKens Scrum Presentation
Kens Scrum Presentation
James Peckham
 

Was ist angesagt? (20)

Continuous, continuous, continuous
Continuous, continuous, continuousContinuous, continuous, continuous
Continuous, continuous, continuous
 
Kens Scrum Presentation
Kens Scrum PresentationKens Scrum Presentation
Kens Scrum Presentation
 
Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...
Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...
Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...
 
BDD - Collaboration for Continuous Delivery
BDD - Collaboration for Continuous DeliveryBDD - Collaboration for Continuous Delivery
BDD - Collaboration for Continuous Delivery
 
Selenium as a trend
Selenium as a trendSelenium as a trend
Selenium as a trend
 
Software Craftsmanship - It's an Imperative
Software Craftsmanship - It's an ImperativeSoftware Craftsmanship - It's an Imperative
Software Craftsmanship - It's an Imperative
 
CodeOne 2018 - Better software, faster: principles of Continuous Delivery and...
CodeOne 2018 - Better software, faster: principles of Continuous Delivery and...CodeOne 2018 - Better software, faster: principles of Continuous Delivery and...
CodeOne 2018 - Better software, faster: principles of Continuous Delivery and...
 
Big rewrites without big risks
Big rewrites without big risksBig rewrites without big risks
Big rewrites without big risks
 
The Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at PluralsightThe Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at Pluralsight
 
Integrating Hardware (Waterfall) and Software (Agile) Development
Integrating Hardware (Waterfall) and Software (Agile) DevelopmentIntegrating Hardware (Waterfall) and Software (Agile) Development
Integrating Hardware (Waterfall) and Software (Agile) Development
 
Why software projects fail in 2021?
Why software projects fail in 2021?Why software projects fail in 2021?
Why software projects fail in 2021?
 
Tec314f
Tec314fTec314f
Tec314f
 
Diy continuous integration
Diy continuous integrationDiy continuous integration
Diy continuous integration
 
ScrumOps - Scrum + Practical DevOps
ScrumOps - Scrum + Practical DevOpsScrumOps - Scrum + Practical DevOps
ScrumOps - Scrum + Practical DevOps
 
JUG Bonn June 2021 - The DevOps disaster
JUG Bonn June 2021 - The DevOps disasterJUG Bonn June 2021 - The DevOps disaster
JUG Bonn June 2021 - The DevOps disaster
 
Continuous testing the new must have skill of tomorrow's tech leaders
Continuous testing  the new must have skill of tomorrow's tech leadersContinuous testing  the new must have skill of tomorrow's tech leaders
Continuous testing the new must have skill of tomorrow's tech leaders
 
Working with software dev teams
Working with software dev teamsWorking with software dev teams
Working with software dev teams
 
DevOps Anti-Patterns
DevOps Anti-PatternsDevOps Anti-Patterns
DevOps Anti-Patterns
 
Pair programming demystified
Pair programming demystifiedPair programming demystified
Pair programming demystified
 
SDET approach for Agile Testing
SDET approach for Agile TestingSDET approach for Agile Testing
SDET approach for Agile Testing
 

Andere mochten auch (7)

BDD - Collaboration & Hands-on practices
BDD - Collaboration & Hands-on practicesBDD - Collaboration & Hands-on practices
BDD - Collaboration & Hands-on practices
 
Agile for CIOs
Agile for CIOsAgile for CIOs
Agile for CIOs
 
Transforming Legacy In To The New World Of DevOps and PaaS
Transforming Legacy In To The New World Of DevOps and PaaSTransforming Legacy In To The New World Of DevOps and PaaS
Transforming Legacy In To The New World Of DevOps and PaaS
 
Culture Before Tools or Does Tooling Foster Culture?
Culture Before Tools or Does Tooling Foster Culture?Culture Before Tools or Does Tooling Foster Culture?
Culture Before Tools or Does Tooling Foster Culture?
 
Can you work agile in a waterfall organisation? Wagile
Can you work agile in a waterfall organisation? Wagile  Can you work agile in a waterfall organisation? Wagile
Can you work agile in a waterfall organisation? Wagile
 
Brilliant People Management in an Agile Setting
Brilliant People Management in an Agile SettingBrilliant People Management in an Agile Setting
Brilliant People Management in an Agile Setting
 
2 speed IT and how to get there
2 speed IT and how to get there2 speed IT and how to get there
2 speed IT and how to get there
 

Ähnlich wie Zero to tested

Ähnlich wie Zero to tested (20)

Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
 
Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)
 
Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (IWOMM)Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (IWOMM)
 
Serverless in production, an experience report
Serverless in production, an experience reportServerless in production, an experience report
Serverless in production, an experience report
 
Practical Cloud & Workflow Orchestration
Practical Cloud & Workflow OrchestrationPractical Cloud & Workflow Orchestration
Practical Cloud & Workflow Orchestration
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)
 
Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)
 
Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)
 
AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)
 
Automated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsAutomated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE Applications
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
 
Serverless in production, an experience report (London js community)
Serverless in production, an experience report (London js community)Serverless in production, an experience report (London js community)
Serverless in production, an experience report (London js community)
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
 
Graceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous IntegrationGraceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous Integration
 
Serverless in production, an experience report (NDC London, 31 Jan 2018)
Serverless in production, an experience report (NDC London, 31 Jan 2018)Serverless in production, an experience report (NDC London, 31 Jan 2018)
Serverless in production, an experience report (NDC London, 31 Jan 2018)
 
Serverless in production, an experience report (NDC London 2018)
Serverless in production, an experience report (NDC London 2018)Serverless in production, an experience report (NDC London 2018)
Serverless in production, an experience report (NDC London 2018)
 

Mehr von MagenTys

Mehr von MagenTys (8)

How Retail Store Design Enhances Customer Experience
 How Retail Store Design Enhances Customer Experience How Retail Store Design Enhances Customer Experience
How Retail Store Design Enhances Customer Experience
 
The Blurring Line Between Online and Offline Commerce Experiences
The Blurring Line Between Online and Offline Commerce ExperiencesThe Blurring Line Between Online and Offline Commerce Experiences
The Blurring Line Between Online and Offline Commerce Experiences
 
Ed Oughton 2015 digital communications for a digital economy
Ed Oughton 2015 digital communications for a digital economyEd Oughton 2015 digital communications for a digital economy
Ed Oughton 2015 digital communications for a digital economy
 
Cambridge meetup
Cambridge meetupCambridge meetup
Cambridge meetup
 
Bdd masterclass
Bdd masterclassBdd masterclass
Bdd masterclass
 
John Muir presentation
John Muir presentationJohn Muir presentation
John Muir presentation
 
Alex Sbardella presentation
Alex Sbardella presentationAlex Sbardella presentation
Alex Sbardella presentation
 
Craig Smith presentation
Craig Smith presentationCraig Smith presentation
Craig Smith presentation
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Zero to tested

Hinweis der Redaktion

  1. Hopefully we will look at some cool devops tools and automation techniques on the way, but first some context.
  2. Show empty EC2 account and kick off `terraform apply`
  3. Get the url of the instance and show that we have a seed job and that the seed job has created the main job. Start the main job if it hasn’t already - explain that first run will be slow as it builds docker container for the first time and gets dependencies over the internet.
  4. Demo the endpoints in the browser.
  5. Demo entire CI job.
  6. Have a look at the REPO - point out the structure and README - starting locally should just be as simple as having Vagrant and doing `vagrant up`