Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Don't you like Integration testing as Me&
Search
Yevhen
March 12, 2018
Technology
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Don't you like Integration testing as Me&
Slides of public talk at SeleniumCamp 2018
Yevhen
March 12, 2018
Transcript
64 slides
Don’t you like Integration testing as Me?
Yevhen Rudiev • QA Automation Lead at GamePoint • ~6
years experience in IT • ~3 years experience in Automated Testing • ~2 years experience in Micro- Service architecture
INTEGRATION TESTING
INTEGRATION TESTING
INTEGRATION TESTING
INTEGRATION TESTING
None
None
HOW TO TEST IT?
#1 END TO END TESTING
System under test DB Test Provider
#1.1 PROBLEMS: • Test data
TEST DATA <PayPointSettings> <MerchantId>1234</MerchantId> <MerchantPassword>Password</MerchantPassword> <Url>https://TestPayPoint.com/Payment</Url> <ApiVersion>v2.1</ApiVersion> <SecretWord>SecretWord</SecretWord> </PayPointSettings>
TEST DATA [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)
.WithCreditCardNumber(TestData.PositiveCardPayPoint) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
TEST DATA [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)
.WithCreditCardNumber(TestData.PositiveCardPayPoint) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
TEST DATA [Test] public void VisaDeposit_Negative_PaymentRefused() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)
.WithCreditCardNumber(TestData.RefusedCardPayPoint) .WithExpectedFinalStatus(PaymentStatus.Refused) .Send(); }
TEST DATA <SkrillSettings> <Login>Name</Login> <ApiPassword>Password</ApiPassword> <PublicKey>PublicPassword</PublicKey> <PrivateKey>PrivatePassword</PrivateKey> <Url>https://TestPayPoint.com/Payment</Url> </SkrillSettings >
TEST DATA [Test] public void SkrilWithdrawal_PaymentRefused() { BuildPaymentRequest(PaymentType.Withdrawal) .WithAmount(TestData.NegativeAmountSkrill) .WithExpectedFinalStatus(PaymentStatus.Refused)
.Send(); }
#1.1 PROBLEMS: • Test data • Fail investigation
FAIL INVESTIGATION Test Failed: PaymentStatus was not updated to Captured
in 30 seconds Expected: Captured Actual: Refused
Provider System under test FAIL INVESTIGATION Test Provider Test System
under test System under test
#1.1 PROBLEMS: • Test data • Fail investigation • Speed
System under test SPEED DB Test Provider
None
SPEED DB Provider Additional services
#1.1 PROBLEMS: • Test data • Fail investigation • Speed
• Stability
• New unstable version • WebRequest.Timeout • Delayed responses •
Test Data changes • Hardware issues STABILITY
#2 TESTING WITH FAKES
#2.1 PRINCIPLE Fake of Provider Provider DB
System under test #2.1 PRINCIPLE DB Test Fake of Provider
Provider
#2.1 PRINCIPLE HOST Provider 1 Provider 2 Provider N System
under test
#2.2 E2E TESTING PROBLEMS: • Test data • Fail investigation
• Speed • Stability
TEST DATA HOST Behavior Context Provider N Test
BEHAVIOR CONTEXT GET Request http://Testing.Fakes/BehaviorContext? paymentId={0}&status={1} ConcurrentDictionary<string,string>
BEHAVIOR CONTEXT [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)
.WithCreditCardNumber(TestData.PositiveCardPayPoint) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
BEHAVIOR CONTEXT [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)
.WithBehavior(req => BehaviorHelper.Set(req.PaymentId, PaymentStatus.Captured)) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
#2.2 E2E TESTING PROBLEMS: • Test data • Fail investigation
• Speed • Stability
System under test System under test Provider FAIL INVESTIGATION Test
Test
• Test data • Fail investigation • Speed • Stability
#2.2 E2E TESTING PROBLEMS:
SPEED HOST System under test Fake of Provider localhost
• Test data • Fail investigation • Speed • Stability
#2.2 E2E TESTING PROBLEMS:
STABILITY • New unstable version • WebRequest.Timeout • Delayed responses
• Test Data changes • Hardware issues
#2.2 E2E TESTING PROBLEMS: • Test data • Fail investigation
• Speed • Stability
PRICE: • Higher tech level of QA • Increased time
of development • More code to support • Synchronize Changes
Do we still need integration testing?
Fake of Provider System under test DB Test
REQUEST VALIDATION “b50cb600-ddd4-4cea-a4ce-0f266a33e922” => “John1990” “
[email protected]
” => “John Doe” “en”
=> “English” “EUR” => “USD”
None
E2E TESTING PROBLEMS: • Test data • Fail investigation •
Speed • Stability
None
#3 SMART FAKES
System under test #3 SMART FAKES DB Test Fake of
Provider Verification of request
#3.1 ISupportLogging public void ProcessRequest(HttpContext context) { logger.Log(context.Request.PaymentId, context.Request); return
BehaviorContext.Response(context.Request.PaymentId); }
#3.1 ISupportLogging [Test] public void VisaDeposit_Positive_PaymentCaptured() { . . .
var request = FakeHelper.GetRequest(payment.Id); AssertRequest(request); } public void AssertRequest(HttpRequest request)
#3.2 ISupportValidation public void ProcessRequest(HttpContext context) { if (!IsValidRequest(context.Request)) {
return BadRequest(“Request violates the contract”); } return BehaviorContext.Response(context.Request.PaymentId); }
#3.2 ISupportValidation [Test] public void VisaDeposit_Positive_PaymentCaptured() { BuildPaymentRequest(PaymentType.Deposit) .WithProvider(TestData.PayPointProviderName) .WithPaymentMethod(TestData.Visa)
.WithBehavior(req => BehaviorHelper.Set(req.PaymentId, PaymentStatus.Captured)) .WithExpectedFinalStatus(PaymentStatus.Captured) .Send(); }
#3.3 PLUSSES: • All plusses from Fakes approach: • Fast
• Stable • Controlled • Request verification
#3.4 BLIND SPOTS: • Changes in the contracts on prod
• New integration testing • Documentation errors
#3.5 MICROSERVICES TESTING Microservice #1 Microservice #2 Microservice #3 Microservice
#4 Microservice #5
Smart Fake #5 #3.5 MICROSERVICES TESTING Microservice #1 Smart Fake
#2 Smart Fake #3 Smart Fake #4
RESULTS • Made our tests faster, more stable and controlled
• Fakes guaranteed integration compatibility • Lives became easier
ALWAYS LOOK FOR THE IMPROVEMENTS
CONTACTS: www.linkedin.com/in/yevhen-rudiev-a5609590 www.facebook.com/evgeniy.rudev.5
Q&A
Other Decks in Technology
See All in Technology
対話 AI プラットフォーム「アイブリー」で実践する自然言語処理と事業開発
ivry_presentationmaterials
0
240
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
2
370
ブース設計、 お前もプロダクトだったのか / So Booth Design Was a Product All Along
akihiro0038
0
200
本の挿絵に困ったから挿絵メーカーを自作した
yoshimura_datam
1
140
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
320
PR 生成AIガバナンスの全体像がわかる本
yoshimura_datam
0
140
Is the Website Dying?
miriamschwab
0
270
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
430
Welcome JXL!
dynamis
0
1.3k
ノードが消える前提で設計する!Karpenterで金融システムを止めないためのノウハウ大全
daitak
1
270
その修正で本当に速くなったのか? k6とOpenTelemetryで確かめる性能改善 / Performance review with k6 and OpenTelemetry
ymotongpoo
3
490
Webメール開発を大幅に変えたJMAPというゲームチェンジャー
tascript
9
6.1k
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
970
Writing Fast Ruby
sferik
630
63k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Into the Great Unknown - MozCon
thekraken
41
2.8k
The Cost Of JavaScript in 2023
addyosmani
56
10k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
580
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
490
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
690
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
340