Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tests
Search
Thibaut Coutard
February 10, 2020
Programming
0
53
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
27
Clean Architecture
coutart
0
40
Iterate your Klingon
coutart
0
62
Workshop : CI - CD using Bitrise
coutart
0
54
Internationalisation
coutart
0
33
Other Decks in Programming
See All in Programming
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
110
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
320
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
130
ニーリーにおけるプロダクトエンジニア
nealle
0
490
NPOでのDevinの活用
codeforeveryone
0
240
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
890
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
320
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
160
A2A プロトコルを試してみる
azukiazusa1
2
1.1k
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
220
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
450
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
850
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Fireside Chat
paigeccino
37
3.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Thoughts on Productivity
jonyablonski
69
4.7k
Typedesign – Prime Four
hannesfritz
42
2.7k
Designing for Performance
lara
609
69k
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