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
60
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tests
1- definitions
2- tools
3- iOS frameworks
Thibaut Coutard
February 10, 2020
More Decks by Thibaut Coutard
See All by Thibaut Coutard
iOS ecosystem
coutart
0
37
Clean Architecture
coutart
0
50
Iterate your Klingon
coutart
0
130
Workshop : CI - CD using Bitrise
coutart
0
79
Internationalisation
coutart
0
40
Other Decks in Programming
See All in Programming
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
320
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
320
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
570
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
130
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.4k
Press start. Python's next generation.
willingc
PRO
3
280
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
410
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
180
ソフトウェアラスタライザ
fadis
1
730
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
170
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
100
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
740
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
880
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
450
BBQ
matthewcrist
89
10k
Making the Leap to Tech Lead
cromwellryan
135
10k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
290
Designing for humans not robots
tammielis
254
26k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
400
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
260
How GitHub (no longer) Works
holman
316
150k
Bash Introduction
62gerente
615
220k
Deep Space Network (abreviated)
tonyrice
0
280
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
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