際際滷

際際滷Share a Scribd company logo
Testing Sync Engine
Testing (iOS) Sync Engine
Agenda
 Overall tests stats
 Our test strategies
 MockTransportSession
 Workflow
 Problems
 Future plans
Overall tests stats
 3356 tests on OSX
Overall tests stats
 3356 tests on OSX
 3415 tests on iOS (+ apns tests)
Overall tests stats
 3356 tests on OSX
 3415 tests on iOS (+ apns tests)
 ~ 7.5 minutes to build and run all the tests on
one platform (build ~ 40s, tests ~ 7 min)
Overall tests stats
 3356 tests on OSX
 3415 tests on iOS (+ apns tests)
 ~ 7.5 minutes to build and run all the tests on
one platform (build ~ 40s, tests ~ 7 min)
Overall tests stats
 Unit tests ~ 80%
Overall tests stats
 Unit tests ~ 80%
 Integration tests ~ 20%
Overall tests stats
 Unit tests ~ 80%
 Integration tests ~ 20%
 Performance tests - 18
Overall tests stats
 Unit tests ~ 80%
 Integration tests ~ 20%
 Performance tests - 18
 Tests of tests
Overall tests stats
 Unit tests ~ 80%
 Integration tests ~ 20%
 Performance tests - 18
 Tests of tests
 Sorry, no UI tests
Overall tests stats
Our test strategies
What we DONT do:
Our test strategies
What we DONT do:
 test against http:// (real backend)
 test using http requests stubs (like
OHHTTPStubs)
Our test strategies
What we DONT do:
 test against http:// (real backend)
 test using http requests stubs (like
OHHTTPStubs)
Why?
 Stubs are not that flexible.
Our test strategies
What we DONT do:
 test against http:// (real backend)
 test using http requests stubs (like
OHHTTPStubs)
Why?
 Stubs are not that flexible.
 Its still slow.
Our test strategies
What we really do:
 Test against fake backend
Our test strategies
What we really do:
 Test against fake backend
Advantages
 Fast
 Flexible
 Independent
 Testable
Our test strategies
What we really do:
 Test against fake backend
Advantages
 Fast
 Flexible
 Independent
 Testable
Disadvantages
 Need to write (and
test!) code
 Need to be in sync
with real backend
(can be improved)
Our test strategies
MockTransportSession
WTF is THAT?
MockTransportSession
WTF is THAT?
ZMTransportSession
ZMTransportSessi
onErrorCode
ZMBackgroundAc
tivity
ZMURLSessionCa
ncelTimer
ZMURLSessionSw
itch
ZMURLSession
ZMTransportCodec
ZMAccessToken
ZMUserAgent
ZMReachability
ZMTransportData
ZMTransportResp
onse
ZMTaskIdenti鍖erM
ap
ZMExponentialBa
ckoff
ZMAccessTokenH
andler
ZMTransportRequ
estScheduler
ZMNetworkSocket
ZMDataBuffer
ZMWebSocketFra
me
ZMWebSocketHan
dshake
ZMWebSocket
ZMPushChannelC
onnection
ZMTransportPush
Channel
ZMStreamPairThre
ad
MockTransportSession
WTF is THAT?
ZMTransportSession
MockTransportSession
WTF is THAT?
ZMTransportSession - is a delegate of a delegate
of NSURLSession
MockTransportSession
WTF is THAT?
ZMTransportSession - is a delegate of a delegate
of NSURLSession
 Sends http requests to scheduler
MockTransportSession
WTF is THAT?
ZMTransportSession - is a delegate of a delegate
of NSURLSession
 Sends http requests to scheduler
 Handles authentication
MockTransportSession
WTF is THAT?
ZMTransportSession - is a delegate of a delegate
of NSURLSession
 Sends http requests to scheduler
 Handles authentication
 Opens/closes web socket connection
MockTransportSession
WTF is THAT?
MockTransportSession - is a mock of
ZMTransportSession
MockTransportSession
WTF is THAT?
MockTransportSession - is a mock of
ZMTransportSession
MockTransportSession - acts as a fake backend
MockTransportSession
WTF is THAT?
 Make fake requests
MockTransportSession
WTF is THAT?
 Make fake requests
 Records requests and responds to them
MockTransportSession
WTF is THAT?
 Make fake requests
 Records requests and responds to them
 Manages internal database
MockTransportSession
WTF is THAT?
 Make fake requests
 Records requests and responds to them
 Manages internal database
 Can simulate remote changes.
MockTransportSession
WTF is THAT?
 Make fake requests
 Records requests and responds to them
 Manages internal database
 Can simulate remote changes.
 Can send push channel (web socket) events
MockTransportSession
 Before each test we insert objects in internal
database (in memory)
MockTransportSession
 Before each test we insert objects in internal
database (in memory)
 Test code make request using MockTransportSession
MockTransportSession
 Before each test we insert objects in internal
database (in memory)
 Test code make request using MockTransportSession
 It records and process incoming request (filtering by
path and lots of ifs)
MockTransportSession
 Before each test we insert objects in internal
database (in memory)
 Test code make request using MockTransportSession
 It records and process incoming request (filtering by
path and lots of ifs)
 Performs some CRUD action on database
depending on request (add message, create
conversation, fetch conversation)
MockTransportSession
 Before each test we insert objects in internal
database (in memory)
 Test code make request using MockTransportSession
 It records and process incoming request (filtering by
path and lots of ifs)
 Performs some CRUD action on database
depending on request (add message, create
conversation, fetch conversation)
 Creates and sends response. Optionally can
delegate it to other object (i.e. test case).
MockTransportSession
Workflow
 Finished feature - run all the tests
Workflow
 Finished feature - run all the tests
 Create pull request
Workflow
 Finished feature - run all the tests
 Create pull request
 Review, merge
Workflow
 Finished feature - run all the tests
 Create pull request
 Review, merge
 Release script runs all tests locally
Workflow
 Finished feature - run all the tests
 Create pull request
 Review, merge
 Release script runs all tests locally
 Pushes to remote branches (master/develop)
Workflow
 Finished feature - run all the tests
 Create pull request
 Review, merge
 Release script runs all tests locally
 Pushes to remote branches (master/develop)
 Xcode bots make integration on each push to master/
develop
Workflow
 Finished feature - run all the tests
 Create pull request
 Review, merge
 Release script runs all tests locally
 Pushes to remote branches (master/develop)
 Xcode bots make integration on each push to master/
develop
 Each bot for each platform runs all the tests
Workflow
 Finished feature - run all the tests
 Create pull request
 Review, merge
 Release script runs all tests locally
 Pushes to remote branches (master/develop)
 Xcode bots make integration on each push to master/
develop
 Each bot for each platform runs all the tests
 Bots archive and upload binary to the cloud
Workflow
Problems
Solved:
 Tests isolation (mostly database state)
Problems
Solved:
 Tests isolation (mostly database state)
 Handling asynchronous code
Problems
Solved:
 Tests isolation (mostly database state)
 Handling asynchronous code
Not yet solved:
Problems
Solved:
 Tests isolation (mostly database state)
 Handling asynchronous code
Not yet solved:
 Reduce tests running time
U dont like
me? =(
Problems
Solved:
 Tests isolation (mostly database state)
 Handling asynchronous code
Not yet solved:
 Reduce tests running time
 Sync with real backend
Problems
Solved:
 Tests isolation (mostly database state)
 Handling asynchronous code
Not yet solved:
 Reduce tests running time
 Sync with real backend
 Flaky tests
Problems
Future plans
 Split to smaller frameworks - to improve run time
Future plans
 Split to smaller frameworks - to improve run time
 Setup Buildasaur - to run tests on Github pull
requests
Future plans
 Split to smaller frameworks - to improve run time
 Setup Buildasaur - to run tests on Github pull
requests
 Record/replay tests for MockTransportSession -
to keep it in sync
Future plans
Thats it!

More Related Content

What's hot (20)

Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscript
Bill Buchan
Scripting robot
Scripting robotScripting robot
Scripting robot
Chonlasith Jucksriporn
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
Rob Scaduto
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
Attila Balazs
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
Tamas Rev
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
krishantha_samaraweera
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
nohuhu
GraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsGraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'ts
V叩clav 鱈r
Oscp - Journey
Oscp - JourneyOscp - Journey
Oscp - Journey
Vandana Verma
Functional Tests. PHP Unconf 2016
Functional Tests. PHP Unconf 2016Functional Tests. PHP Unconf 2016
Functional Tests. PHP Unconf 2016
Vladislav Fedorischev
Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)
Ford Prior
Test driving-qml
Test driving-qmlTest driving-qml
Test driving-qml
Artem Marchenko
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
Somkiat Puisungnoen
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
All Things Open
Leandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightLeandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & Right
Neotys_Partner
Azphp phpunit-jenkins
Azphp phpunit-jenkinsAzphp phpunit-jenkins
Azphp phpunit-jenkins
Eric Cope
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
Christian Nagel
Robot framework
Robot frameworkRobot framework
Robot framework
Rochak Bhalla
Spring Boot
Spring BootSpring Boot
Spring Boot
gedoplan
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
Tuenti
Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscript
Bill Buchan
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
Rob Scaduto
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
Attila Balazs
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
Tamas Rev
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
krishantha_samaraweera
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
nohuhu
GraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsGraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'ts
V叩clav 鱈r
Functional Tests. PHP Unconf 2016
Functional Tests. PHP Unconf 2016Functional Tests. PHP Unconf 2016
Functional Tests. PHP Unconf 2016
Vladislav Fedorischev
Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)
Ford Prior
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
Somkiat Puisungnoen
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
All Things Open
Leandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightLeandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & Right
Neotys_Partner
Azphp phpunit-jenkins
Azphp phpunit-jenkinsAzphp phpunit-jenkins
Azphp phpunit-jenkins
Eric Cope
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
Christian Nagel
Spring Boot
Spring BootSpring Boot
Spring Boot
gedoplan
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
Tuenti

Similar to Testing sync engine (20)

The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
All Things Open
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
Niels Frydenholm
Working Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams ProductiveWorking Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams Productive
Perforce
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to use
Uma Ghotikar
Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023
Scott Keck-Warren
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
Tuenti
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
Ineke Scheffers
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
Ortus Solutions, Corp
My Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is MagicMy Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is Magic
Apollo Clark
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
Michael Roufa
33rd degree
33rd degree33rd degree
33rd degree
Dariusz Kordonski
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
Stuart (Pid) Williams
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014
Wojciech Seliga
we45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Pythonwe45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Python
Abhay Bhargav
Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automa...
Oleksandr Khotemskyi  - Serverless architecture and how to apply it in Automa...Oleksandr Khotemskyi  - Serverless architecture and how to apply it in Automa...
Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automa...
Web Tech Fun
仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒 亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...
仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒  亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒  亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...
仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒 亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...
Dakiry
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to IntegrateDeveloper testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
LB Denker
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - Workshop
Anjana Somathilake
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
All Things Open
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
Niels Frydenholm
Working Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams ProductiveWorking Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams Productive
Perforce
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to use
Uma Ghotikar
Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023
Scott Keck-Warren
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
Tuenti
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
Ineke Scheffers
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
Ortus Solutions, Corp
My Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is MagicMy Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is Magic
Apollo Clark
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
Michael Roufa
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014
Wojciech Seliga
we45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Pythonwe45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Python
Abhay Bhargav
Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automa...
Oleksandr Khotemskyi  - Serverless architecture and how to apply it in Automa...Oleksandr Khotemskyi  - Serverless architecture and how to apply it in Automa...
Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automa...
Web Tech Fun
仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒 亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...
仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒  亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒  亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...
仍亠从舒仆亟 丱仂亠仄从亳亶:Serverless 舒亠从舒 舒 亰舒仂于舒仆仆 于 舒于仂仄舒亳亰舒...
Dakiry
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to IntegrateDeveloper testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
LB Denker
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - Workshop
Anjana Somathilake
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan

Testing sync engine