Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tests
Search
Thibaut Coutard
February 10, 2020
Programming
0
55
Tests
1- definitions
2- tools
3- iOS frameworks
Thibaut Coutard
February 10, 2020
Tweet
Share
More Decks by Thibaut Coutard
See All by Thibaut Coutard
iOS ecosystem
coutart
0
29
Clean Architecture
coutart
0
42
Iterate your Klingon
coutart
0
110
Workshop : CI - CD using Bitrise
coutart
0
60
Internationalisation
coutart
0
35
Other Decks in Programming
See All in Programming
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
410
愛される翻訳の秘訣
kishikawakatsumi
1
320
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
5
2k
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
AIコーディングエージェント(NotebookLM)
kondai24
0
180
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
220
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
350
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
380
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
390
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
150
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
1k
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
162
23k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Side Projects
sachag
455
43k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Why Our Code Smells
bkeepers
PRO
340
57k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
For a Future-Friendly Web
brad_frost
180
10k
Music & Morning Musume
bryan
46
7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
A better future with KSS
kneath
240
18k
Transcript
Tests Thibaut Coutard iOS developer @MobiApps
Why ?
Why ? • More stable applications • Less bugs •
More confidence • Use it as documentation
-Djikstra « Testing shows the presence, not the absence of
bugs »
What kind of tests
Tests pyramid Manual UI Tests Integration Tests Unit tests
Integration Tests UI Tests Manual Cost Unit tests
Unit Test • Individual test • Unit smallest part of
the system • Simplest way to test • Lowest cost • Few seconds
Integration Test • Interaction between components • At least two
or more components • Less tests than UT • Relatively low cost • Seconds/Minutes
UI Test • Test the whole system • Still automated
• Harder to test • Still cheaper than manually • Minutes/Hours
Manual Test • Test the whole system • Hard to
test all cases • Very Expensive • Hours/Days
Feedback loop • Time between creating a bug and fixing
it
Mutation Testing
Mutation Testing
Mutation Testing • Test the tests
TDD Red Green Write failing test Develop Refactor
BDD • Gherkin : Given/When/Then • Understandable by everyone •
Speaks about the user behavior and not the technical behavior • Written with both product, development teams and customer
« What goes in production is the developers understanding »
Tools
Dependency Injection UserInteractor UserDefaults
Dependency Injection UserInteractor UserDefaults
Dependency Injection UserInteractor UserDefaults UserStoreProtocol
Dummy
None
Fake • Return static values
None
Stub • Return values • Can be set during the
test
Stub
Spy • Spy the calls
None
Mock • Return values • Can be set during the
test • Spy the calls
None
Humble Objects ViewController
Humble Objects ViewController Presenter
Humble Objects ViewController Presenter Not testable Testable
Useful libraries
XCTests • Unit test Framework native
XCTests
XCUITest • Native UI Test framework • Record from usage
XCUITest • Native UI Test framework • Record from usage
Nimble • A matcher framework for swift and objective-c •
Easier to read than XCTests
Nimble
Quick • BDD framework for swift and objective-c • Can
be written using the specifications • Easier to read and write
Quick
OHHttpStub • Stub HTTP calls for the whole app •
Helps test API wrappers • Can simulate bad/no network
OHHttpStub • Stub HTTP calls for the whole app •
Helps test API wrappers
KIF • Functional testing • Easier than XCUITests
KIF • Functional testing • Easier than XCUITests
HS : Sourcery • Meta Programming • Generate code •
Awesome AutoMockable template
HS : Sourcery • Meta Programming • Generate code •
Awesome AutoMockable template
Resources • Test Driven iOS Development with Swift 4 •
https://github.com/kif-framework/KIF • https://github.com/Quick/Nimble • https://github.com/Quick/Quick • https://github.com/AliSoftware/OHHTTPStubs