SlideShare una empresa de Scribd logo
1 de 54
0Flake
Reaching reliable non-flaky tests
DevOpsDays TLV 2018
Itai Friendinger <itai@forter.com>
Flaky tests can fail or pass for the same
configuration
Image from Huck Nets
patch the test …
Image from Huck Nets
patch the test … and test the patch
Image from Huck Nets
5
Confidence is not binary, it’s a spectrum
• Tests should provide confidence
• During development
• In new deployments
• Also... continuously in production (monitoring)
• Flaky tests usually assert a binary result
• 0Flake is about the tools to create a spectrum of results.
0Flake Agenda
• Problem Description
• Precision and Accuracy ⇒ Flaky Unit Tests
• Non-Deterministic Results ⇒ Flaky Integration Tests
• Data Pipeline Hiccups ⇒ Flaky System Tests
Fraud Prevention Decision as a Service
25% fraud
probability declineFeatures
bill_ship_dist =
1200 miles
Fraud
Prediction
Real time
Decision
> 20%
db
billing,
shipping
details
decline
Precision and Accuracy ⇒ Flaky Unit Tests
Unit Tests
Features
bill_ship_dist =
1200 miles
billing,
shipping
details
Unit Testing: Floats
assert 0.1 + 0.2 == 0.3
E assert
0.30000000000000004 == 0.3
Unit Tests
Unit Testing: Geo Distance Precision
def test_distance_miles():
newport_ri = (41.49008, -71.312796)
cleveland_oh = (41.499498, -81.695391)
result = distance_miles(newport_ri, cleveland_oh)
assert result == 538.39044536
E assert 538.3904453622719 == 538.39044536
Unit Tests
Quick patch: ±0.01
def test_distance_miles():
newport_ri = (41.49008, -71.312796)
cleveland_oh = (41.499498, -81.695391)
result = distance_miles(newport_ri, cleveland_oh)
assert result == approx(538.39044536, abs=0.01)
Unit Tests
Geo Distance Accuracy
Unit Tests
±1 mile is negligible in terms of Fraud Analysis
def test_distance_miles():
newport_ri = (41.49008, -71.312796)
cleveland_oh = (41.499498, -81.695391)
result = distance_miles(newport_ri, cleveland_oh)
assert result == approx(538.39, abs=1, rel=0.01)
Unit Tests
requires fraud analysis understanding
⇒ test DSL for analysts
Expected results is a range, not a single value
Unit Tests
input = {
"bill_addr": "Newport, Rhode Island",
"ship_addr": "Cleveland, Ohio"
}
output = {
"bill_ship_dist": approx(538, abs=1, rel=0.01)
}
Non-Deterministic Results ⇒ Flaky Integration Tests
Integration Tests
25% fraud
probability declineFeatures
bill_ship_dist =
1200 miles
Fraud
Prediction
Real time
Decision
> 20%
db
billing,
shipping
details
25% fraud
probability decline
Features report exceptions but use fallback logic
Features
bill_ship_dist =
1200 miles
Fraud
Prediction
Real time
Decision
> 20%
db
geocoding
service
service service
Integration Tests
billing,
shipping
details
25% fraud
probability decline
Features report exceptions but use fallback logic
Features
bill_ship_dist =
1200 miles
>100 miles
Fraud
Prediction
Real time
Decision
> 20%
geocoding
service
service service
Exception Monitoring
Integration Tests
billing,
shipping
details
db
25%
19% fraud
probability
decline
Features report exceptions but use fallback logic
Features
bill_ship_dist =
1200 miles
>100 miles
Fraud
Prediction
Real time
Decision
> 20%
geocoding
service
service service
Exception Monitoring
Integration Tests
billing,
shipping
details
db
25%
19% fraud
probability
decline
approve
Features report exceptions but use fallback logic
Features
bill_ship_dist =
1200 miles
>100 miles
Fraud
Prediction
Real time
Decision
> 20%
Exception Monitoring
Integration Tests
billing,
shipping
details
db
geocoding
service
service service
Integration Testing: Stability vs Coverage
Integration Tests
stability
Integration
coverage
stubs
connect to
other
services
Retries
Integration Tests
stability
Integration
coverage
stubs
connect to
other
services
(retry)
connect to
other
services
Docker sidecars
Integration Tests
stability
Integration
coverage
docker
sidecar
(localhost)
stubs
connect to
other
services
"Monitor" exceptions raised during each test
Integration Tests
stability
Integration
coverage
ignore
(some)
exceptions
stubs
connect to
other
services
docker
sidecar
(localhost)
Don't assert a non-deterministic service
stability
Integration
coverage
relax
asserts
Integration Tests
stubs
connect to
other
services
ignore
(some)
exceptions
docker
sidecar
(localhost)
Expected result is a spectrum, not a single value
decline
decline
Integration Tests
25% fraud
probabilityFeatures
bill_ship_dist =
1200 miles
Fraud
Prediction
Real time
Decision
> 20%
billing,
shipping
details
Let's monitor in production !
Production Tests
Canary Release (ala Netflix)
Production Tests
Production (v1)
real
traffic
ELB
db
Canary Release (ala Netflix)
real
traffic
ELB
Canary (v2)
compare
Baseline
with
Canary
Production Tests
Production (v1)
Baseline (v1) db
spinnaker.io
Kayenta - automated canary analysis
2
Production Tests
Why canary is not the right choice for us
T1 = time to detect problem
T2 = time to resolve problem
engineering_loss = avg_loss_per_tx * tx_throughput * (T1+T2)
minimum TXs
needed
Production Tests
Why canary is not the right choice for us
T1 = time to detect problem
T2 = time to resolve problem
engineering_loss = avg_loss_per_tx * tx_throughput * (T1+T2)
Netflix:
Movie/Ad Recommendation, Video Streaming
Forter:
~0.015 x (Flight tickets ,Jewelry, Shoes, Food)
Production Tests
C.D. deploys a new version (effectless toggled on)
Production Tests
Green env (v1)
(production)real
traffic
ELB
db
Blue env (v2)
(effectless)
C.D. runs warm-up tests
synthetic
traffic
Production Tests
Blue env (v2)
(effectless)
Green env (v1)
(production)real
traffic
ELB
db
C.D. streams (copy of) real traffic for 15 minutes
real
traffic
Production Tests
Green env (v1)
(production)real
traffic
ELB
db
Blue env (v2)
(effectless)
Machines
“some of my answers you will
understand, and some of
them you will not“
Image from The Matrix
Production Tests
Fraud Analysts
“You've already made your
choice.
You're here to try to
understand *why* you made
it.“
Image from The Matrix
Production Tests
#effectless slack channel
Decisions diverged from existing
production
API Latency
Number / Percent of exceptions below
threshold
Image from The Matrix
Production Tests
Developers can force ELB switch
Blue env is actually better
Call an analyst to explain *why*
Image from The Matrix
Production Tests
C.D. toggles effectless off and diverts ELB traffic
real
traffic
draining
Production Tests
Green env (v1)
(fallback)
ELB
db
Blue env (v2)
(production)
Continuous BI monitoring and alerts
Production Tests
real
traffic
Green env (v1)
(fallback)
ELB
db
Blue env (v2)
(production)
After 4 quiet hours, safley terminates green env
Production Tests
real
traffic
ELB
db
Blue env (v2)
(production)
Effectless Caveats
● 15 minutes may not be enough
○ Small problems slip through and accumulate
■ Covered by BI monitoring
○ Stats per ..
■ per tenant / sub-service / host
● API Latencies
○ 99th percentile is noisy (start with 50ile, 95ile)
○ caching effects
● Exception thresholds must be gradually tightened
○ 0 exceptions not realistic for new features
Production Tests
Data Pipeline Hiccups ⇒ Flaky System tests
System Tests
Decision Analytics Billing
DB isolation (MicroServices isolation)
System Tests
Decision Analytics Billing
db db db
Now we need an async data pipeline
System Tests
Decision Analytics Billing
db db db
Async data pipeline
But each service has a different data freshness req.
System Tests
Decision
(<1 sec)
Analytics
(15 secs)
Billing
(days)
db db db
Async data pipeline
Naive system tests (sleep 60)
Decision
(<1 sec)
Analytics
(15 secs)
Billing
(days)
db db db
Async data pipeline
Send TX Query for TX Query for TX
System Tests
Continuous Data Reconciliation
db db db
Continuous Data Reconciliation
Reconciliation
Continuous Data Reconciliation
● Compares DB with Source-Of-Truth DB
○ missing data (by timestamp , by id)
○ referential integrity problems ("broken links")
● Continuous Testing
○ Green ⇒ data in sync
○ Red ⇒ data sync problem
Reconciliation
Decision Analytics Billing
Continuous Data Reconciliation
db db db
Continuous Data Reconciliation
Async data pipeline
Reconciliation
Continuous Data Reconciliation
● Triggers MicroService/Pipeline APIs to reprocess data
● Continuous Testing
○ Green ⇒ data in sync
○ Yellow ⇒ data is being synced
○ Red ⇒ data sync problem
Reconciliation
Reconciliation Prerequisites
● Schema Repository
● Source of Truth
● Justification (e.g. customer facing data)
○ Billing
○ Analytics
Reconciliation
53
Reconciliation Caveats
● Violates Micro-Service isolation
● Prevent Positive Feedback Avalanche:
○ Filtering
○ Limiting
○ Damping
○ Negative Feedback
Reconciliation
Image from Wikipedia
Questions ?
Itai Friendinger <itai@forter.com>
0Flake - Reaching reliable non-flaky tests
https://tech.forter.com

Más contenido relacionado

La actualidad más candente

Optimizing TAS Usage at Ford Motor Company
Optimizing TAS Usage at Ford Motor CompanyOptimizing TAS Usage at Ford Motor Company
Optimizing TAS Usage at Ford Motor CompanyVMware Tanzu
 
Driving TAS Enterprise Fitness
Driving TAS Enterprise FitnessDriving TAS Enterprise Fitness
Driving TAS Enterprise FitnessVMware Tanzu
 
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
CloudBees Continuous Integration and Test with Appvance PerformanceCloudCloudBees Continuous Integration and Test with Appvance PerformanceCloud
CloudBees Continuous Integration and Test with Appvance PerformanceCloudClever Moe
 
CA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeter
CA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeterCA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeter
CA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeterCA Technologies
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationClever Moe
 
Reduce Test Automation Execution Time by 80%
Reduce Test Automation Execution Time by 80%Reduce Test Automation Execution Time by 80%
Reduce Test Automation Execution Time by 80%TechWell
 
Webinar: Skytap & Jenkins
Webinar: Skytap & JenkinsWebinar: Skytap & Jenkins
Webinar: Skytap & JenkinsSkytap Cloud
 
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...RightScale
 
Creating the Borderless Workplace
Creating the Borderless WorkplaceCreating the Borderless Workplace
Creating the Borderless WorkplaceCA Technologies
 
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...VMware Tanzu
 
Creating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
Creating Complete Test Environments in the Cloud: Skytap & Parasoft WebinarCreating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
Creating Complete Test Environments in the Cloud: Skytap & Parasoft WebinarSkytap Cloud
 
Running JMeter Tests In Appvance PerformanceCloud
Running JMeter Tests In Appvance PerformanceCloudRunning JMeter Tests In Appvance PerformanceCloud
Running JMeter Tests In Appvance PerformanceCloudClever Moe
 
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...Clever Moe
 
How Spring Cloud Gateway Orchestrated Our App Modernization
How Spring Cloud Gateway Orchestrated Our App ModernizationHow Spring Cloud Gateway Orchestrated Our App Modernization
How Spring Cloud Gateway Orchestrated Our App ModernizationVMware Tanzu
 
Platform Agility, Reliability, and Security: Can You Really Have it All in th...
Platform Agility, Reliability, and Security: Can You Really Have it All in th...Platform Agility, Reliability, and Security: Can You Really Have it All in th...
Platform Agility, Reliability, and Security: Can You Really Have it All in th...VMware Tanzu
 
A Guide to Event-Driven SRE-inspired DevOps
A Guide to Event-Driven SRE-inspired DevOpsA Guide to Event-Driven SRE-inspired DevOps
A Guide to Event-Driven SRE-inspired DevOpsAndreas Grabner
 
DevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft AzureDevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft Azuregjuljo
 
Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...
Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...
Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...CA Technologies
 

La actualidad más candente (20)

Optimizing TAS Usage at Ford Motor Company
Optimizing TAS Usage at Ford Motor CompanyOptimizing TAS Usage at Ford Motor Company
Optimizing TAS Usage at Ford Motor Company
 
Driving TAS Enterprise Fitness
Driving TAS Enterprise FitnessDriving TAS Enterprise Fitness
Driving TAS Enterprise Fitness
 
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
CloudBees Continuous Integration and Test with Appvance PerformanceCloudCloudBees Continuous Integration and Test with Appvance PerformanceCloud
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
CA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeter
CA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeterCA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeter
CA Security Communities Webcast - CA SSO Performance Testing with CA BlazeMeter
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
 
Reduce Test Automation Execution Time by 80%
Reduce Test Automation Execution Time by 80%Reduce Test Automation Execution Time by 80%
Reduce Test Automation Execution Time by 80%
 
Webinar: Skytap & Jenkins
Webinar: Skytap & JenkinsWebinar: Skytap & Jenkins
Webinar: Skytap & Jenkins
 
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
 
Creating the Borderless Workplace
Creating the Borderless WorkplaceCreating the Borderless Workplace
Creating the Borderless Workplace
 
Cloud based Performance Testing
Cloud based Performance TestingCloud based Performance Testing
Cloud based Performance Testing
 
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
 
Creating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
Creating Complete Test Environments in the Cloud: Skytap & Parasoft WebinarCreating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
Creating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
 
Running JMeter Tests In Appvance PerformanceCloud
Running JMeter Tests In Appvance PerformanceCloudRunning JMeter Tests In Appvance PerformanceCloud
Running JMeter Tests In Appvance PerformanceCloud
 
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
 
How Spring Cloud Gateway Orchestrated Our App Modernization
How Spring Cloud Gateway Orchestrated Our App ModernizationHow Spring Cloud Gateway Orchestrated Our App Modernization
How Spring Cloud Gateway Orchestrated Our App Modernization
 
Platform Agility, Reliability, and Security: Can You Really Have it All in th...
Platform Agility, Reliability, and Security: Can You Really Have it All in th...Platform Agility, Reliability, and Security: Can You Really Have it All in th...
Platform Agility, Reliability, and Security: Can You Really Have it All in th...
 
A Guide to Event-Driven SRE-inspired DevOps
A Guide to Event-Driven SRE-inspired DevOpsA Guide to Event-Driven SRE-inspired DevOps
A Guide to Event-Driven SRE-inspired DevOps
 
DevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft AzureDevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft Azure
 
Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...
Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...
Hands-On Lab: Integrate Your Monitoring Tools into an Automated Service Impac...
 

Similar a 0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Tel Aviv 2018

0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...DevOpsDays Tel Aviv
 
Conway Case Study - Optimizing Application Integration SDLC
Conway Case Study -  Optimizing Application Integration SDLCConway Case Study -  Optimizing Application Integration SDLC
Conway Case Study - Optimizing Application Integration SDLCRam Vittal
 
Con-way Case Study: Optimizing Application Integration Software Development L...
Con-way Case Study: Optimizing Application Integration Software Development L...Con-way Case Study: Optimizing Application Integration Software Development L...
Con-way Case Study: Optimizing Application Integration Software Development L...CA Technologies
 
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s WorkloadsUsing SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s WorkloadsScyllaDB
 
Testing Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the CloudTesting Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the CloudTechWell
 
Test Automation NYC 2014
Test Automation NYC 2014Test Automation NYC 2014
Test Automation NYC 2014Kishore Bhatia
 
Service Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to KnowService Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to KnowTechWell
 
DevOps at TestausOSY 20june2017
DevOps at TestausOSY 20june2017DevOps at TestausOSY 20june2017
DevOps at TestausOSY 20june2017Jouni Jätyri
 
Continuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsContinuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsDaniel Löffelholz
 
Using ai and automation to build resiliency into azure dev ops
Using ai and automation to build resiliency into azure dev opsUsing ai and automation to build resiliency into azure dev ops
Using ai and automation to build resiliency into azure dev opsRob Jahn
 
Legacy On Premise Apps Got You Down? No Problem - DevOps for All
Legacy On Premise Apps Got You Down? No Problem - DevOps for AllLegacy On Premise Apps Got You Down? No Problem - DevOps for All
Legacy On Premise Apps Got You Down? No Problem - DevOps for AllMuly Gottlieb
 
Auto sre with keptn
Auto sre with keptnAuto sre with keptn
Auto sre with keptnLibbySchulze
 
Accelerate Agile Development with Service Virtualization - Czech Test
Accelerate Agile Development with Service Virtualization - Czech TestAccelerate Agile Development with Service Virtualization - Czech Test
Accelerate Agile Development with Service Virtualization - Czech TestParasoft
 
Personalized Defect Prediction
Personalized Defect PredictionPersonalized Defect Prediction
Personalized Defect PredictionSung Kim
 
12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jrubyJoe Kutner
 
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Andreas Grabner
 
#Virtualdreamin Meera_Nar_Salesforce_performance_considerations
#Virtualdreamin Meera_Nar_Salesforce_performance_considerations#Virtualdreamin Meera_Nar_Salesforce_performance_considerations
#Virtualdreamin Meera_Nar_Salesforce_performance_considerationsMeera R Nair
 
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...Bernd Zuther
 
Dive into H2O: NYC
Dive into H2O: NYCDive into H2O: NYC
Dive into H2O: NYCSri Ambati
 

Similar a 0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Tel Aviv 2018 (20)

0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
 
Conway Case Study - Optimizing Application Integration SDLC
Conway Case Study -  Optimizing Application Integration SDLCConway Case Study -  Optimizing Application Integration SDLC
Conway Case Study - Optimizing Application Integration SDLC
 
Con-way Case Study: Optimizing Application Integration Software Development L...
Con-way Case Study: Optimizing Application Integration Software Development L...Con-way Case Study: Optimizing Application Integration Software Development L...
Con-way Case Study: Optimizing Application Integration Software Development L...
 
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s WorkloadsUsing SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
 
Testing Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the CloudTesting Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the Cloud
 
Test Automation NYC 2014
Test Automation NYC 2014Test Automation NYC 2014
Test Automation NYC 2014
 
Service Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to KnowService Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to Know
 
DevOps at TestausOSY 20june2017
DevOps at TestausOSY 20june2017DevOps at TestausOSY 20june2017
DevOps at TestausOSY 20june2017
 
Continuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsContinuously Delivering Distributed Systems
Continuously Delivering Distributed Systems
 
Using ai and automation to build resiliency into azure dev ops
Using ai and automation to build resiliency into azure dev opsUsing ai and automation to build resiliency into azure dev ops
Using ai and automation to build resiliency into azure dev ops
 
Legacy On Premise Apps Got You Down? No Problem - DevOps for All
Legacy On Premise Apps Got You Down? No Problem - DevOps for AllLegacy On Premise Apps Got You Down? No Problem - DevOps for All
Legacy On Premise Apps Got You Down? No Problem - DevOps for All
 
Auto sre with keptn
Auto sre with keptnAuto sre with keptn
Auto sre with keptn
 
Accelerate Agile Development with Service Virtualization - Czech Test
Accelerate Agile Development with Service Virtualization - Czech TestAccelerate Agile Development with Service Virtualization - Czech Test
Accelerate Agile Development with Service Virtualization - Czech Test
 
Personalized Defect Prediction
Personalized Defect PredictionPersonalized Defect Prediction
Personalized Defect Prediction
 
12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jruby
 
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
 
#Virtualdreamin Meera_Nar_Salesforce_performance_considerations
#Virtualdreamin Meera_Nar_Salesforce_performance_considerations#Virtualdreamin Meera_Nar_Salesforce_performance_considerations
#Virtualdreamin Meera_Nar_Salesforce_performance_considerations
 
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
 
Dive into H2O: NYC
Dive into H2O: NYCDive into H2O: NYC
Dive into H2O: NYC
 
Hello istio
Hello istioHello istio
Hello istio
 

Último

Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 

Último (20)

Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 

0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Tel Aviv 2018

  • 1. 0Flake Reaching reliable non-flaky tests DevOpsDays TLV 2018 Itai Friendinger <itai@forter.com>
  • 2. Flaky tests can fail or pass for the same configuration Image from Huck Nets
  • 3. patch the test … Image from Huck Nets
  • 4. patch the test … and test the patch Image from Huck Nets
  • 5. 5 Confidence is not binary, it’s a spectrum • Tests should provide confidence • During development • In new deployments • Also... continuously in production (monitoring) • Flaky tests usually assert a binary result • 0Flake is about the tools to create a spectrum of results.
  • 6. 0Flake Agenda • Problem Description • Precision and Accuracy ⇒ Flaky Unit Tests • Non-Deterministic Results ⇒ Flaky Integration Tests • Data Pipeline Hiccups ⇒ Flaky System Tests
  • 7. Fraud Prevention Decision as a Service 25% fraud probability declineFeatures bill_ship_dist = 1200 miles Fraud Prediction Real time Decision > 20% db billing, shipping details decline
  • 8. Precision and Accuracy ⇒ Flaky Unit Tests Unit Tests Features bill_ship_dist = 1200 miles billing, shipping details
  • 9. Unit Testing: Floats assert 0.1 + 0.2 == 0.3 E assert 0.30000000000000004 == 0.3 Unit Tests
  • 10. Unit Testing: Geo Distance Precision def test_distance_miles(): newport_ri = (41.49008, -71.312796) cleveland_oh = (41.499498, -81.695391) result = distance_miles(newport_ri, cleveland_oh) assert result == 538.39044536 E assert 538.3904453622719 == 538.39044536 Unit Tests
  • 11. Quick patch: ±0.01 def test_distance_miles(): newport_ri = (41.49008, -71.312796) cleveland_oh = (41.499498, -81.695391) result = distance_miles(newport_ri, cleveland_oh) assert result == approx(538.39044536, abs=0.01) Unit Tests
  • 13. ±1 mile is negligible in terms of Fraud Analysis def test_distance_miles(): newport_ri = (41.49008, -71.312796) cleveland_oh = (41.499498, -81.695391) result = distance_miles(newport_ri, cleveland_oh) assert result == approx(538.39, abs=1, rel=0.01) Unit Tests
  • 14. requires fraud analysis understanding ⇒ test DSL for analysts Expected results is a range, not a single value Unit Tests input = { "bill_addr": "Newport, Rhode Island", "ship_addr": "Cleveland, Ohio" } output = { "bill_ship_dist": approx(538, abs=1, rel=0.01) }
  • 15. Non-Deterministic Results ⇒ Flaky Integration Tests Integration Tests 25% fraud probability declineFeatures bill_ship_dist = 1200 miles Fraud Prediction Real time Decision > 20% db billing, shipping details
  • 16. 25% fraud probability decline Features report exceptions but use fallback logic Features bill_ship_dist = 1200 miles Fraud Prediction Real time Decision > 20% db geocoding service service service Integration Tests billing, shipping details
  • 17. 25% fraud probability decline Features report exceptions but use fallback logic Features bill_ship_dist = 1200 miles >100 miles Fraud Prediction Real time Decision > 20% geocoding service service service Exception Monitoring Integration Tests billing, shipping details db
  • 18. 25% 19% fraud probability decline Features report exceptions but use fallback logic Features bill_ship_dist = 1200 miles >100 miles Fraud Prediction Real time Decision > 20% geocoding service service service Exception Monitoring Integration Tests billing, shipping details db
  • 19. 25% 19% fraud probability decline approve Features report exceptions but use fallback logic Features bill_ship_dist = 1200 miles >100 miles Fraud Prediction Real time Decision > 20% Exception Monitoring Integration Tests billing, shipping details db geocoding service service service
  • 20. Integration Testing: Stability vs Coverage Integration Tests stability Integration coverage stubs connect to other services
  • 23. "Monitor" exceptions raised during each test Integration Tests stability Integration coverage ignore (some) exceptions stubs connect to other services docker sidecar (localhost)
  • 24. Don't assert a non-deterministic service stability Integration coverage relax asserts Integration Tests stubs connect to other services ignore (some) exceptions docker sidecar (localhost)
  • 25. Expected result is a spectrum, not a single value decline decline Integration Tests 25% fraud probabilityFeatures bill_ship_dist = 1200 miles Fraud Prediction Real time Decision > 20% billing, shipping details
  • 26. Let's monitor in production ! Production Tests
  • 27. Canary Release (ala Netflix) Production Tests Production (v1) real traffic ELB db
  • 28. Canary Release (ala Netflix) real traffic ELB Canary (v2) compare Baseline with Canary Production Tests Production (v1) Baseline (v1) db
  • 29. spinnaker.io Kayenta - automated canary analysis 2 Production Tests
  • 30. Why canary is not the right choice for us T1 = time to detect problem T2 = time to resolve problem engineering_loss = avg_loss_per_tx * tx_throughput * (T1+T2) minimum TXs needed Production Tests
  • 31. Why canary is not the right choice for us T1 = time to detect problem T2 = time to resolve problem engineering_loss = avg_loss_per_tx * tx_throughput * (T1+T2) Netflix: Movie/Ad Recommendation, Video Streaming Forter: ~0.015 x (Flight tickets ,Jewelry, Shoes, Food) Production Tests
  • 32. C.D. deploys a new version (effectless toggled on) Production Tests Green env (v1) (production)real traffic ELB db Blue env (v2) (effectless)
  • 33. C.D. runs warm-up tests synthetic traffic Production Tests Blue env (v2) (effectless) Green env (v1) (production)real traffic ELB db
  • 34. C.D. streams (copy of) real traffic for 15 minutes real traffic Production Tests Green env (v1) (production)real traffic ELB db Blue env (v2) (effectless)
  • 35. Machines “some of my answers you will understand, and some of them you will not“ Image from The Matrix Production Tests
  • 36. Fraud Analysts “You've already made your choice. You're here to try to understand *why* you made it.“ Image from The Matrix Production Tests
  • 37. #effectless slack channel Decisions diverged from existing production API Latency Number / Percent of exceptions below threshold Image from The Matrix Production Tests
  • 38. Developers can force ELB switch Blue env is actually better Call an analyst to explain *why* Image from The Matrix Production Tests
  • 39. C.D. toggles effectless off and diverts ELB traffic real traffic draining Production Tests Green env (v1) (fallback) ELB db Blue env (v2) (production)
  • 40. Continuous BI monitoring and alerts Production Tests real traffic Green env (v1) (fallback) ELB db Blue env (v2) (production)
  • 41. After 4 quiet hours, safley terminates green env Production Tests real traffic ELB db Blue env (v2) (production)
  • 42. Effectless Caveats ● 15 minutes may not be enough ○ Small problems slip through and accumulate ■ Covered by BI monitoring ○ Stats per .. ■ per tenant / sub-service / host ● API Latencies ○ 99th percentile is noisy (start with 50ile, 95ile) ○ caching effects ● Exception thresholds must be gradually tightened ○ 0 exceptions not realistic for new features Production Tests
  • 43. Data Pipeline Hiccups ⇒ Flaky System tests System Tests Decision Analytics Billing
  • 44. DB isolation (MicroServices isolation) System Tests Decision Analytics Billing db db db
  • 45. Now we need an async data pipeline System Tests Decision Analytics Billing db db db Async data pipeline
  • 46. But each service has a different data freshness req. System Tests Decision (<1 sec) Analytics (15 secs) Billing (days) db db db Async data pipeline
  • 47. Naive system tests (sleep 60) Decision (<1 sec) Analytics (15 secs) Billing (days) db db db Async data pipeline Send TX Query for TX Query for TX System Tests
  • 48. Continuous Data Reconciliation db db db Continuous Data Reconciliation Reconciliation
  • 49. Continuous Data Reconciliation ● Compares DB with Source-Of-Truth DB ○ missing data (by timestamp , by id) ○ referential integrity problems ("broken links") ● Continuous Testing ○ Green ⇒ data in sync ○ Red ⇒ data sync problem Reconciliation
  • 50. Decision Analytics Billing Continuous Data Reconciliation db db db Continuous Data Reconciliation Async data pipeline Reconciliation
  • 51. Continuous Data Reconciliation ● Triggers MicroService/Pipeline APIs to reprocess data ● Continuous Testing ○ Green ⇒ data in sync ○ Yellow ⇒ data is being synced ○ Red ⇒ data sync problem Reconciliation
  • 52. Reconciliation Prerequisites ● Schema Repository ● Source of Truth ● Justification (e.g. customer facing data) ○ Billing ○ Analytics Reconciliation
  • 53. 53 Reconciliation Caveats ● Violates Micro-Service isolation ● Prevent Positive Feedback Avalanche: ○ Filtering ○ Limiting ○ Damping ○ Negative Feedback Reconciliation Image from Wikipedia
  • 54. Questions ? Itai Friendinger <itai@forter.com> 0Flake - Reaching reliable non-flaky tests https://tech.forter.com