SlideShare una empresa de Scribd logo
1 de 62
Descargar para leer sin conexión
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 DON’T do:
Our test strategies
What we DON’T do:
• test against http:// (real backend)
• test using http requests stubs (like
OHHTTPStubs)
Our test strategies
What we DON’T do:
• test against http:// (real backend)
• test using http requests stubs (like
OHHTTPStubs)
Why?
• Stubs are not that flexible.
Our test strategies
What we DON’T do:
• test against http:// (real backend)
• test using http requests stubs (like
OHHTTPStubs)
Why?
• Stubs are not that flexible.
• It’s 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
ZMTaskIdentifierM
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 don’t 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
That’s it!

Más contenido relacionado

La actualidad más candente

Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscriptBill Buchan
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScriptRob Scaduto
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java codeAttila Balazs
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmersTamas Rev
 
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 Perlnohuhu
 
GraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsGraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsVáclav Šír
 
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
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with SeleniumAll Things Open
 
Leandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightLeandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightNeotys_Partner
 
Azphp phpunit-jenkins
Azphp phpunit-jenkinsAzphp phpunit-jenkins
Azphp phpunit-jenkinsEric 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 2020Christian Nagel
 
Spring Boot
Spring BootSpring Boot
Spring Bootgedoplan
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti
 

La actualidad más candente (20)

Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscript
 
Scripting robot
Scripting robotScripting robot
Scripting robot
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
 
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
 
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
 
GraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsGraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'ts
 
Oscp - Journey
Oscp - JourneyOscp - Journey
Oscp - Journey
 
Functional Tests. PHP Unconf 2016
Functional Tests. PHP Unconf 2016Functional Tests. PHP Unconf 2016
Functional Tests. PHP Unconf 2016
 
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!)
 
Test driving-qml
Test driving-qmlTest driving-qml
Test driving-qml
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
 
Leandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightLeandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & Right
 
Azphp phpunit-jenkins
Azphp phpunit-jenkinsAzphp phpunit-jenkins
Azphp phpunit-jenkins
 
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
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 

Similar a Testing sync engine

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 AppAll 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 ProductivePerforce
 
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 2011Vincent 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 useUma Ghotikar
 
Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Scott Keck-Warren
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release WorkflowTuenti
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonIneke 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 MagicApollo Clark
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping QualityMichael Roufa
 
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014Wojciech 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 PythonAbhay 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 IntegrateLB Denker
 
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - WorkshopAnjana Somathilake
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 

Similar a 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
 
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...
 
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
 
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
 
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
 
Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
 
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!
 
My Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is MagicMy Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is Magic
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
 
33rd degree
33rd degree33rd degree
33rd degree
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014
 
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
 
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...
 
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
 
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
 
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - Workshop
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 

Testing sync engine