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
110
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
93
Alberto Lopez's Slides at NSSpain 2014
lascorbe
0
33
Erik Erice's Slides at NSSpain 2014
lascorbe
0
73
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
190
Nacho Soto's Slides at NSSpain 2013
lascorbe
4
130
Other Decks in Programming
See All in Programming
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
930
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
650
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
1
1k
Goのエラースタックトレースの歴史と今後
sonatard
9
1.5k
Ruby Pattern Matching
bkuhlmann
0
930
Elm 0.19.0 Changes
bkuhlmann
0
490
ゆるい個人開発のススメ
kuroppe1819
10
990
2 週間で Twitter Bot を作ってみた
contour_gara
0
460
What We Can Learn From OSS
inouehi
0
420
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
92
4.8k
A Modern Web Designer's Workflow
chriscoyier
689
190k
For a Future-Friendly Web
brad_frost
172
9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Music & Morning Musume
bryan
41
5.6k
Visualization
eitanlees
136
14k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Debugging Ruby Performance
tmm1
70
11k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Clear Off the Table
cherdarchuk
84
310k
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