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
Snapshot Testing at CMD+U Conf
Search
Luis Ascorbe
July 08, 2016
Programming
2
130
Snapshot Testing at CMD+U Conf
Luis Ascorbe
July 08, 2016
Tweet
Share
More Decks by Luis Ascorbe
See All by Luis Ascorbe
Dave Verwer's Slides at NSSpain 2014
lascorbe
0
120
Andrew Yates' Slides at NSSpain 2014
lascorbe
0
100
Alberto Lopez's Slides at NSSpain 2014
lascorbe
0
36
Erik Erice's Slides at NSSpain 2014
lascorbe
0
86
Krzysztof Zabłocki's Slides at NSSpain 2013
lascorbe
8
440
Luis Solano's Slides at NSSpain 2013
lascorbe
3
120
Daniel Eggert's Slides at NSSpain 2013
lascorbe
8
200
Nacho Soto's Slides at NSSpain 2013
lascorbe
4
130
Other Decks in Programming
See All in Programming
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
230
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
220
SwiftUI Viewの責務分離
elmetal
PRO
0
140
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
480
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
160
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
120
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
640
Conform を推す - Advocating for Conform
mizoguchicoji
3
680
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
29
11k
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
400
CI改善もDatadogとともに
taumu
0
110
Formの複雑さに立ち向かう
bmthd
1
720
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
Embracing the Ebb and Flow
colly
84
4.6k
Optimizing for Happiness
mojombo
376
70k
We Have a Design System, Now What?
morganepeng
51
7.4k
Become a Pro
speakerdeck
PRO
26
5.1k
Designing for Performance
lara
604
68k
BBQ
matthewcrist
86
9.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Transcript
Snapshot Testing
@lascorbe
@lascorbe
What’s Testing?
What’s Snapshot Testing? Saved!
What’s Snapshot Testing? Saved! Recreate! ==
Calabash KIF UI Testing (Xcode)
Calabash KIF UI Testing (Xcode) Acceptance Tests
What’s Snapshot Testing? Unit Tests Integration Tests
What’s Snapshot Testing? Integration Tests Snapshot Tests Unit Tests
None
States
Text
Devices
Demo!
FBSnapshotTestCase
FBSnapshotTestCase CGContextRef
FBSnapshotTestCase CGContextRef CGContextRef
FBSnapshotTestCase CGContextRef CGContextRef <>
FBSnapshotTestCase CGContextRef CGContextRef <> memcmp()
Things to take into account
Arquitecture
Arquitecture Asynchronicity
Arquitecture Asynchronicity Autolayout
Arquitecture Asynchronicity Autolayout Repo space
What’s nice
See changes without running your app
Gorgeous PRs!
You’re testing a whole view at once
Gotta go fast! “0.015 to 0.080 seconds per test on
a Macbook Air” - @orta
Bonus point
Snapshots
Snapshots-Peek
Conclusion
Conclusion 1. Open your app 2. Write some snapshot tests
3. … 4. Profit!
https://github.com/facebook/ios-snapshot-test-case https://www.objc.io/issues/15-testing/snapshot-testing/ https://github.com/ashfurrow/Nimble-Snapshots https://github.com/dblock/ios-snapshot-test-case-expecta https://github.com/orta/snapshots https://github.com/orta/snapshots-peek https://github.com/Lascorbe/cmduconf-project
One more thing…
None
Sept 14-16 Logroño nsspain.com
cmduconf-rocks
@lascorbe