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
110
Alberto Lopez's Slides at NSSpain 2014
lascorbe
0
38
Erik Erice's Slides at NSSpain 2014
lascorbe
0
94
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
210
Nacho Soto's Slides at NSSpain 2013
lascorbe
4
130
Other Decks in Programming
See All in Programming
詳細の決定を遅らせつつ実装を早くする
shimabox
2
1.3k
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
300
ゼロダウンタイムでミドルウェアの バージョンアップを実現した手法と課題
wind111
0
210
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 1
philipschwarz
PRO
0
100
2025 컴포즈 마법사
jisungbin
0
150
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
460
DartASTとその活用
sotaatos
2
150
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
160
Developing Specifications - Jakarta EE: a Real World Example
ivargrimstad
0
180
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
5
2k
Duke on CRaC with Jakarta EE
ivargrimstad
0
190
AIを駆使して新しい技術を効率的に理解する方法
nogu66
1
660
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
66k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Visualization
eitanlees
150
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Thoughts on Productivity
jonyablonski
73
4.9k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
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