SlideShare a Scribd company logo
Test Double Pattern
Fake it 'til you make it
Ivan Pashko
● Project Manager  Scrum
Master
● QA Automation Engineer
● 10+ years in IT
● 1+ years happy father
"Fake it 'til you make it" is a common
English idiom, which suggests that by
imitating confidence, competence, and
an optimistic mindset, a person can
realize those qualities in real life (c)
Wiki.
Idea, not a solution
Live Software Problems
• Complex
• Slow
• Unavailable
• Brocken
• Unstable
E2E Tests Problem
• Complex
• Slow
• Fragile
What problems we solve
● Imitate simple 3rd Party services
○ FBGoogle authentication
○ 404 / 500 / 401 service responses
● Simple API Methods
○ Hardly-configured data responses
○ Test flowscenario edge-cases
○ Stub ajax-calls on frontend
● Replace Data Services, DBs
Test Double Pattern
Idea of pattern, is to replace a component on which
the SUT depends with a “test-specific equivalent”
Test Stub
Mock Object
Static Fake
Scenario: Visa deposit positive flow
Given Visa deposit payment method with customer defaultCustomerForDeposit
When Fill payment information
And Process fake deposit with 155.5, status Captured and Code 30000
Then Receipt page should be displayed with correct information
Scenario: Visa withdraw positive flow
Given Visa withdraw payment method with customer
defaultCustomerForWithdrawal
...
When Process fake withdraw with 10.1 and status Created
Then Receipt page should be displayed with correct information
Fake?
Fake? Why?
● Flexible
● Understandable
● Applicable
● Usable
N+1 or Math induction
● A is depend on B
and C
● So, to test A we
do ABC testing
N+1 or Math induction
Step N+1 - testing B, C as it
an A
Request:
● Test A→B
● Test A→C
Response:
● Test B→A
● Test C→A
N+1 or Math induction
Step N - test A without B &
C, replacing with the
Doubles
● Now we have only A
(and controlled double
B’ and C’)
Static Fake
HardСoded behavior of dependent component.
Static Fake
Scenario: Visa deposit positive flow
Given Visa deposit payment method with customer defaultCustomerForDeposit
When Fill payment information
And Process fake deposit with 155.5, status Captured and Code 30000
Then Receipt page should be displayed with correct information
Scenario: Visa withdraw positive flow
Given Visa withdraw payment method with customer
defaultCustomerForWithdrawal
...
When Process fake withdraw with 10.1 and status Created
Then Receipt page should be displayed with correct information
Static Fake
{
case "default_Customer_With_Accounts":
return FB_.CreateDefaultCustomerWithAccounts(cGuid,
siteName)
.Build();
case "default_Customer_for_Withdrawal":
return FB_.CreateDefaultCustomerForWithdrawal(cGuid, siteName)
.Build();
case "default_Customer_with_all_Payment_methods":
return FB_.CreateDefaultCustomerWithAccounts(cGuid, siteName)
.Build();
case "default_Customer_with_Pending_Withdrawals_Deny_cancellation":
return FB_.CreateDefaultcustomerWithPWDDenyCancellation(cGuid)
.Build();
…….
Pros & Cons
+
● Contains all specific
behaviors
● Any language for
implementation
● Use for prototyping & local
testing
● Speedup tests
-
● Test scenarios are not
clear (logic hidden in
implementation)
● Need to be supported all
the time (for all new logic)
Dynamic Fake
Reusable Test Double with the configurable values to
be returned or verified during the fixture setup phase
of a test.
Dynamic Fake
Scenario: Single currency limits on withdrawal method page
Given Customer has payment methods
| PaymentMethodName | MethodAction | IsAvailable |
| Visa | Withdrawal | true |
And Customer has Visa Withdrawal saved accounts
| MaskedCardNumber | CardHolderName | ExpiryMonth | ExpiryYear |
| 498765******9236 | Test Name | 07 | 2019
|
And Customer balance 2000 EUR
And Customer has Visa withdrawal payment method limits
| Currency | Min | Max |
| EUR | 21 | 1200 |
And Push customer to fake
When Customer opens Withdraw Visa page
Then MinLimit is 21 and MaxLimit is 1200
Dynamic Fake
Scenario: Single currency limits on withdrawal method page
Given Customer has payment methods
| PaymentMethodName | MethodAction | IsAvailable |
| Visa | Withdrawal | true |
And Customer has Visa Withdrawal saved accounts
| MaskedCardNumber | CardHolderName | ExpiryMonth | ExpiryYear |
| 498765******9236 | Test Name | 07 | 2019 |
And Customer balance 2000 EUR
And Customer has Visa withdrawal payment method limits
| Currency | Min | Max |
| EUR | 21 | 1200 |
And Push customer to fake
When Customer opens Withdraw Visa page
Then MinLimit is 21 and MaxLimit is 1200
Pros & Cons
+
● Have all specific
behaviors
● Configured from test
● Scenarios are clear &
readable
-
● Hard for development
● Can’t/hard to used for
prototyping or local
testing
Double problem - No thruthworsy
Test with Double Vs Consumer Tests
Test with Double (N)
Given Customer exists on Facebook
And Allowed to authenticate to MySite
When Open MySite
#Send requests to FB Auth service
And Authenticate via Facebook
#FB returns “Success” response
Then “Success login” message appears
Consumer test (N-1)
Given Customer exists on Facebook
And Allowed to authenticate to MySite
When Send requests to FB Authservice
Then FB returns “Success” response
And so
● Using of Test Doubles -
○ could make your life easier
○ your tests: faster, stable, possible
● Doubles Pattern – not a silver bullet
● Additional test layer:
○ Contract tests
○ Depended component tests
Thank you! Questions?

More Related Content

Similar to 2 ivan pashko - fake it 'til you make it

CRC SECTOR 140 A NOIDA
CRC SECTOR 140 A NOIDACRC SECTOR 140 A NOIDA
CRC SECTOR 140 A NOIDA
Pavansharma519273
 
Introduction to BDD
Introduction to BDD Introduction to BDD
Introduction to BDD
Ranjith Tharayil
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
Skills Matter
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
Bernd Ruecker
 
Cqrs, Event Sourcing
Cqrs, Event SourcingCqrs, Event Sourcing
Cqrs, Event Sourcing
Ashic Mahtab
 
Engage! Bringing teams together to deliver software that makes a difference
Engage! Bringing teams together to deliver software that makes a differenceEngage! Bringing teams together to deliver software that makes a difference
Engage! Bringing teams together to deliver software that makes a difference
John Ferguson Smart Limited
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 
BDD
BDDBDD
Chap020
Chap020Chap020
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
Ho Chi Minh City Software Testing Club
 
IAP auto renewable in practice
IAP auto renewable  in practiceIAP auto renewable  in practice
IAP auto renewable in practice
Hokila Jan
 
Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...
Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...
Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...
Blackbaud
 
Get Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project Management
Get Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project ManagementGet Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project Management
Get Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project Management
Peter Walker
 
Online payments and Security Gateways
Online payments and Security Gateways Online payments and Security Gateways
Online payments and Security Gateways
Sarujan Chandrakumaran
 
How to Send a Receipt, Topics in Concurrency and Distributed Systems
How to Send a Receipt, Topics in Concurrency and Distributed SystemsHow to Send a Receipt, Topics in Concurrency and Distributed Systems
How to Send a Receipt, Topics in Concurrency and Distributed Systems
Pascal-Louis Perez
 
Payments Integration at Uber: a (Short) Case Study
Payments Integration at Uber: a (Short) Case StudyPayments Integration at Uber: a (Short) Case Study
Payments Integration at Uber: a (Short) Case Study
Gergely Orosz
 
java and javascript api dev guide
java and javascript api dev guidejava and javascript api dev guide
java and javascript api dev guide
Zenita Smythe
 
Satchmo
SatchmoSatchmo
Satchmo
DjangoCon2008
 
Nosqloakland 20091102.1
Nosqloakland 20091102.1Nosqloakland 20091102.1
Nosqloakland 20091102.1
NorthScale
 
Shorten the O2C cycle with digital invoicing and payments
Shorten the O2C cycle with digital invoicing and paymentsShorten the O2C cycle with digital invoicing and payments
Shorten the O2C cycle with digital invoicing and payments
Emagia
 

Similar to 2 ivan pashko - fake it 'til you make it (20)

CRC SECTOR 140 A NOIDA
CRC SECTOR 140 A NOIDACRC SECTOR 140 A NOIDA
CRC SECTOR 140 A NOIDA
 
Introduction to BDD
Introduction to BDD Introduction to BDD
Introduction to BDD
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
 
Cqrs, Event Sourcing
Cqrs, Event SourcingCqrs, Event Sourcing
Cqrs, Event Sourcing
 
Engage! Bringing teams together to deliver software that makes a difference
Engage! Bringing teams together to deliver software that makes a differenceEngage! Bringing teams together to deliver software that makes a difference
Engage! Bringing teams together to deliver software that makes a difference
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
 
BDD
BDDBDD
BDD
 
Chap020
Chap020Chap020
Chap020
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
 
IAP auto renewable in practice
IAP auto renewable  in practiceIAP auto renewable  in practice
IAP auto renewable in practice
 
Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...
Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...
Payment Processing Made Easy for K-12 Schools - Sandra Leturgez and Janet Wit...
 
Get Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project Management
Get Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project ManagementGet Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project Management
Get Paid! Plugins, Gateways, BitCoin: WordPress Ecommerce Project Management
 
Online payments and Security Gateways
Online payments and Security Gateways Online payments and Security Gateways
Online payments and Security Gateways
 
How to Send a Receipt, Topics in Concurrency and Distributed Systems
How to Send a Receipt, Topics in Concurrency and Distributed SystemsHow to Send a Receipt, Topics in Concurrency and Distributed Systems
How to Send a Receipt, Topics in Concurrency and Distributed Systems
 
Payments Integration at Uber: a (Short) Case Study
Payments Integration at Uber: a (Short) Case StudyPayments Integration at Uber: a (Short) Case Study
Payments Integration at Uber: a (Short) Case Study
 
java and javascript api dev guide
java and javascript api dev guidejava and javascript api dev guide
java and javascript api dev guide
 
Satchmo
SatchmoSatchmo
Satchmo
 
Nosqloakland 20091102.1
Nosqloakland 20091102.1Nosqloakland 20091102.1
Nosqloakland 20091102.1
 
Shorten the O2C cycle with digital invoicing and payments
Shorten the O2C cycle with digital invoicing and paymentsShorten the O2C cycle with digital invoicing and payments
Shorten the O2C cycle with digital invoicing and payments
 

More from Ievgenii Katsan

8 andrew kalyuzhin - 30 ux-advices, that will make users love you
8   andrew kalyuzhin - 30 ux-advices, that will make users love you8   andrew kalyuzhin - 30 ux-advices, that will make users love you
8 andrew kalyuzhin - 30 ux-advices, that will make users love you
Ievgenii Katsan
 
5 hans van loenhoud - master-class the 7 skills of highly successful teams
5   hans van loenhoud - master-class the 7 skills of highly successful teams5   hans van loenhoud - master-class the 7 skills of highly successful teams
5 hans van loenhoud - master-class the 7 skills of highly successful teams
Ievgenii Katsan
 
4 alexey orlov - life of product in startup and enterprise
4   alexey orlov - life of product in startup and enterprise4   alexey orlov - life of product in startup and enterprise
4 alexey orlov - life of product in startup and enterprise
Ievgenii Katsan
 
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
3   dmitry gomeniuk - how to make data-driven decisions in saa s products3   dmitry gomeniuk - how to make data-driven decisions in saa s products
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
Ievgenii Katsan
 
7 hans van loenhoud - the problem-goal-solution trinity
7   hans van loenhoud - the problem-goal-solution trinity7   hans van loenhoud - the problem-goal-solution trinity
7 hans van loenhoud - the problem-goal-solution trinity
Ievgenii Katsan
 
1 hans van loenhoud -
1   hans van loenhoud - 1   hans van loenhoud -
1 hans van loenhoud -
Ievgenii Katsan
 
3 denys gobov - change request specification the knowledge base or the task...
3   denys gobov - change request specification the knowledge base or the task...3   denys gobov - change request specification the knowledge base or the task...
3 denys gobov - change request specification the knowledge base or the task...
Ievgenii Katsan
 
5 victoria cupet - learn to play business analysis
5   victoria cupet - learn to play business analysis5   victoria cupet - learn to play business analysis
5 victoria cupet - learn to play business analysis
Ievgenii Katsan
 
5 alina petrenko - key requirements elicitation during the first contact wi...
5   alina petrenko - key requirements elicitation during the first contact wi...5   alina petrenko - key requirements elicitation during the first contact wi...
5 alina petrenko - key requirements elicitation during the first contact wi...
Ievgenii Katsan
 
3 karabak kuyavets transformation of business analyst to product owner
3   karabak kuyavets transformation of business analyst to product owner3   karabak kuyavets transformation of business analyst to product owner
3 karabak kuyavets transformation of business analyst to product owner
Ievgenii Katsan
 
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
Ievgenii Katsan
 
3 zornitsa nikolova - the product manager between decision making and facil...
3   zornitsa nikolova - the product manager between decision making and facil...3   zornitsa nikolova - the product manager between decision making and facil...
3 zornitsa nikolova - the product manager between decision making and facil...
Ievgenii Katsan
 
4 viktoriya gudym - how to effectively manage remote employees
4   viktoriya gudym - how to effectively manage remote employees4   viktoriya gudym - how to effectively manage remote employees
4 viktoriya gudym - how to effectively manage remote employees
Ievgenii Katsan
 
9 natali renska - product and outsource development, how to cook 2 meals in...
9   natali renska - product and outsource development, how to cook 2 meals in...9   natali renska - product and outsource development, how to cook 2 meals in...
9 natali renska - product and outsource development, how to cook 2 meals in...
Ievgenii Katsan
 
7 denis parkhomenko - from idea to execution how to make a product that cus...
7   denis parkhomenko - from idea to execution how to make a product that cus...7   denis parkhomenko - from idea to execution how to make a product that cus...
7 denis parkhomenko - from idea to execution how to make a product that cus...
Ievgenii Katsan
 
6 anton vitiaz - inside the mvp in 3 days
6   anton vitiaz - inside the mvp in 3 days6   anton vitiaz - inside the mvp in 3 days
6 anton vitiaz - inside the mvp in 3 days
Ievgenii Katsan
 
5 mariya popova - ideal product management. unicorns in our reality
5   mariya popova - ideal product management. unicorns in our reality5   mariya popova - ideal product management. unicorns in our reality
5 mariya popova - ideal product management. unicorns in our reality
Ievgenii Katsan
 
2 victor podzubanov - design thinking game
2   victor podzubanov - design thinking game2   victor podzubanov - design thinking game
2 victor podzubanov - design thinking game
Ievgenii Katsan
 
3 sergiy potapov - analyst to product owner
3   sergiy potapov - analyst to product owner3   sergiy potapov - analyst to product owner
3 sergiy potapov - analyst to product owner
Ievgenii Katsan
 
4 anton parkhomenko - how to make effective user research with no budget at...
4   anton parkhomenko - how to make effective user research with no budget at...4   anton parkhomenko - how to make effective user research with no budget at...
4 anton parkhomenko - how to make effective user research with no budget at...
Ievgenii Katsan
 

More from Ievgenii Katsan (20)

8 andrew kalyuzhin - 30 ux-advices, that will make users love you
8   andrew kalyuzhin - 30 ux-advices, that will make users love you8   andrew kalyuzhin - 30 ux-advices, that will make users love you
8 andrew kalyuzhin - 30 ux-advices, that will make users love you
 
5 hans van loenhoud - master-class the 7 skills of highly successful teams
5   hans van loenhoud - master-class the 7 skills of highly successful teams5   hans van loenhoud - master-class the 7 skills of highly successful teams
5 hans van loenhoud - master-class the 7 skills of highly successful teams
 
4 alexey orlov - life of product in startup and enterprise
4   alexey orlov - life of product in startup and enterprise4   alexey orlov - life of product in startup and enterprise
4 alexey orlov - life of product in startup and enterprise
 
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
3   dmitry gomeniuk - how to make data-driven decisions in saa s products3   dmitry gomeniuk - how to make data-driven decisions in saa s products
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
 
7 hans van loenhoud - the problem-goal-solution trinity
7   hans van loenhoud - the problem-goal-solution trinity7   hans van loenhoud - the problem-goal-solution trinity
7 hans van loenhoud - the problem-goal-solution trinity
 
1 hans van loenhoud -
1   hans van loenhoud - 1   hans van loenhoud -
1 hans van loenhoud -
 
3 denys gobov - change request specification the knowledge base or the task...
3   denys gobov - change request specification the knowledge base or the task...3   denys gobov - change request specification the knowledge base or the task...
3 denys gobov - change request specification the knowledge base or the task...
 
5 victoria cupet - learn to play business analysis
5   victoria cupet - learn to play business analysis5   victoria cupet - learn to play business analysis
5 victoria cupet - learn to play business analysis
 
5 alina petrenko - key requirements elicitation during the first contact wi...
5   alina petrenko - key requirements elicitation during the first contact wi...5   alina petrenko - key requirements elicitation during the first contact wi...
5 alina petrenko - key requirements elicitation during the first contact wi...
 
3 karabak kuyavets transformation of business analyst to product owner
3   karabak kuyavets transformation of business analyst to product owner3   karabak kuyavets transformation of business analyst to product owner
3 karabak kuyavets transformation of business analyst to product owner
 
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
 
3 zornitsa nikolova - the product manager between decision making and facil...
3   zornitsa nikolova - the product manager between decision making and facil...3   zornitsa nikolova - the product manager between decision making and facil...
3 zornitsa nikolova - the product manager between decision making and facil...
 
4 viktoriya gudym - how to effectively manage remote employees
4   viktoriya gudym - how to effectively manage remote employees4   viktoriya gudym - how to effectively manage remote employees
4 viktoriya gudym - how to effectively manage remote employees
 
9 natali renska - product and outsource development, how to cook 2 meals in...
9   natali renska - product and outsource development, how to cook 2 meals in...9   natali renska - product and outsource development, how to cook 2 meals in...
9 natali renska - product and outsource development, how to cook 2 meals in...
 
7 denis parkhomenko - from idea to execution how to make a product that cus...
7   denis parkhomenko - from idea to execution how to make a product that cus...7   denis parkhomenko - from idea to execution how to make a product that cus...
7 denis parkhomenko - from idea to execution how to make a product that cus...
 
6 anton vitiaz - inside the mvp in 3 days
6   anton vitiaz - inside the mvp in 3 days6   anton vitiaz - inside the mvp in 3 days
6 anton vitiaz - inside the mvp in 3 days
 
5 mariya popova - ideal product management. unicorns in our reality
5   mariya popova - ideal product management. unicorns in our reality5   mariya popova - ideal product management. unicorns in our reality
5 mariya popova - ideal product management. unicorns in our reality
 
2 victor podzubanov - design thinking game
2   victor podzubanov - design thinking game2   victor podzubanov - design thinking game
2 victor podzubanov - design thinking game
 
3 sergiy potapov - analyst to product owner
3   sergiy potapov - analyst to product owner3   sergiy potapov - analyst to product owner
3 sergiy potapov - analyst to product owner
 
4 anton parkhomenko - how to make effective user research with no budget at...
4   anton parkhomenko - how to make effective user research with no budget at...4   anton parkhomenko - how to make effective user research with no budget at...
4 anton parkhomenko - how to make effective user research with no budget at...
 

Recently uploaded

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
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
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
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
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 

Recently uploaded (20)

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
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
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 

2 ivan pashko - fake it 'til you make it

  • 1. Test Double Pattern Fake it 'til you make it
  • 2. Ivan Pashko ● Project Manager Scrum Master ● QA Automation Engineer ● 10+ years in IT ● 1+ years happy father
  • 3. "Fake it 'til you make it" is a common English idiom, which suggests that by imitating confidence, competence, and an optimistic mindset, a person can realize those qualities in real life (c) Wiki.
  • 4. Idea, not a solution
  • 5. Live Software Problems • Complex • Slow • Unavailable • Brocken • Unstable
  • 6. E2E Tests Problem • Complex • Slow • Fragile
  • 7. What problems we solve ● Imitate simple 3rd Party services ○ FBGoogle authentication ○ 404 / 500 / 401 service responses ● Simple API Methods ○ Hardly-configured data responses ○ Test flowscenario edge-cases ○ Stub ajax-calls on frontend ● Replace Data Services, DBs
  • 8. Test Double Pattern Idea of pattern, is to replace a component on which the SUT depends with a “test-specific equivalent”
  • 11. Static Fake Scenario: Visa deposit positive flow Given Visa deposit payment method with customer defaultCustomerForDeposit When Fill payment information And Process fake deposit with 155.5, status Captured and Code 30000 Then Receipt page should be displayed with correct information Scenario: Visa withdraw positive flow Given Visa withdraw payment method with customer defaultCustomerForWithdrawal ... When Process fake withdraw with 10.1 and status Created Then Receipt page should be displayed with correct information
  • 12. Fake?
  • 13. Fake? Why? ● Flexible ● Understandable ● Applicable ● Usable
  • 14. N+1 or Math induction ● A is depend on B and C ● So, to test A we do ABC testing
  • 15. N+1 or Math induction Step N+1 - testing B, C as it an A Request: ● Test A→B ● Test A→C Response: ● Test B→A ● Test C→A
  • 16. N+1 or Math induction Step N - test A without B & C, replacing with the Doubles ● Now we have only A (and controlled double B’ and C’)
  • 17. Static Fake HardСoded behavior of dependent component.
  • 18. Static Fake Scenario: Visa deposit positive flow Given Visa deposit payment method with customer defaultCustomerForDeposit When Fill payment information And Process fake deposit with 155.5, status Captured and Code 30000 Then Receipt page should be displayed with correct information Scenario: Visa withdraw positive flow Given Visa withdraw payment method with customer defaultCustomerForWithdrawal ... When Process fake withdraw with 10.1 and status Created Then Receipt page should be displayed with correct information
  • 19. Static Fake { case "default_Customer_With_Accounts": return FB_.CreateDefaultCustomerWithAccounts(cGuid, siteName) .Build(); case "default_Customer_for_Withdrawal": return FB_.CreateDefaultCustomerForWithdrawal(cGuid, siteName) .Build(); case "default_Customer_with_all_Payment_methods": return FB_.CreateDefaultCustomerWithAccounts(cGuid, siteName) .Build(); case "default_Customer_with_Pending_Withdrawals_Deny_cancellation": return FB_.CreateDefaultcustomerWithPWDDenyCancellation(cGuid) .Build(); …….
  • 20. Pros & Cons + ● Contains all specific behaviors ● Any language for implementation ● Use for prototyping & local testing ● Speedup tests - ● Test scenarios are not clear (logic hidden in implementation) ● Need to be supported all the time (for all new logic)
  • 21. Dynamic Fake Reusable Test Double with the configurable values to be returned or verified during the fixture setup phase of a test.
  • 22. Dynamic Fake Scenario: Single currency limits on withdrawal method page Given Customer has payment methods | PaymentMethodName | MethodAction | IsAvailable | | Visa | Withdrawal | true | And Customer has Visa Withdrawal saved accounts | MaskedCardNumber | CardHolderName | ExpiryMonth | ExpiryYear | | 498765******9236 | Test Name | 07 | 2019 | And Customer balance 2000 EUR And Customer has Visa withdrawal payment method limits | Currency | Min | Max | | EUR | 21 | 1200 | And Push customer to fake When Customer opens Withdraw Visa page Then MinLimit is 21 and MaxLimit is 1200
  • 23. Dynamic Fake Scenario: Single currency limits on withdrawal method page Given Customer has payment methods | PaymentMethodName | MethodAction | IsAvailable | | Visa | Withdrawal | true | And Customer has Visa Withdrawal saved accounts | MaskedCardNumber | CardHolderName | ExpiryMonth | ExpiryYear | | 498765******9236 | Test Name | 07 | 2019 | And Customer balance 2000 EUR And Customer has Visa withdrawal payment method limits | Currency | Min | Max | | EUR | 21 | 1200 | And Push customer to fake When Customer opens Withdraw Visa page Then MinLimit is 21 and MaxLimit is 1200
  • 24. Pros & Cons + ● Have all specific behaviors ● Configured from test ● Scenarios are clear & readable - ● Hard for development ● Can’t/hard to used for prototyping or local testing
  • 25. Double problem - No thruthworsy
  • 26. Test with Double Vs Consumer Tests Test with Double (N) Given Customer exists on Facebook And Allowed to authenticate to MySite When Open MySite #Send requests to FB Auth service And Authenticate via Facebook #FB returns “Success” response Then “Success login” message appears Consumer test (N-1) Given Customer exists on Facebook And Allowed to authenticate to MySite When Send requests to FB Authservice Then FB returns “Success” response
  • 27. And so ● Using of Test Doubles - ○ could make your life easier ○ your tests: faster, stable, possible ● Doubles Pattern – not a silver bullet ● Additional test layer: ○ Contract tests ○ Depended component tests