Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Visual Testing: A Communication Problem
Bas Broek
June 15, 2018
Programming
0
63
Visual Testing: A Communication Problem
Bas Broek
June 15, 2018
Tweet
Share
More Decks by Bas Broek
See All by Bas Broek
Building a modern subscription experience on iOS
basthomas
0
59
Not an afterthought: accessibility from start to finish
basthomas
0
22
Accessibility on Apple Platforms: Beyond VoiceOver
basthomas
0
29
No Touch(screen) Required: Voice & Keyboard Accessibility
basthomas
0
42
Dancing with Dinosaurs: Objective-C and Swift Interop
basthomas
0
44
Effective Pull Request Reviews
basthomas
0
260
Accessibility in SwiftUI: Better Apps for Everyone
basthomas
0
43
An Introduction to Unit Testing Logic (in Swift)
basthomas
0
50
Swift 5's Custom String Interpolation in Practice
basthomas
0
270
Other Decks in Programming
See All in Programming
Hasura の Relationship と権限管理
karszawa
0
140
Cloudflare WorkersでGoを動かすライブラリを作っている話
syumai
1
280
AWSとCPUのムフフな関係
cmdemura
0
440
(新米)エンジニアリングマネージャーのしごと #RSGT2023
murabayashi
9
5.4k
Ruby Pattern Matching
bkuhlmann
0
600
Step Functions Distributed Map を使ってみた
codemountains
0
100
MBSD Cybersecurity Challenges 2022 最終審査会 IPFactory 発表スライド
futabato
0
830
Refactor with using `available` and `deprecated`
417_72ki
3
370
状態ってなに?🙃
taro28
0
260
TypeScript 4.9のas const satisfiesが便利
tonkotsuboy_com
9
2.2k
量子コンピュータ時代のプログラミングセミナー / 20221222_Amplify_seminar _route_optimization
fixstars
0
240
xarray-Datatree: Hierarchical Data Structures for Multi-Model Science
tomnicholas
0
200
Featured
See All Featured
Navigating Team Friction
lara
176
12k
Automating Front-end Workflow
addyosmani
1351
200k
What's in a price? How to price your products and services
michaelherold
233
9.7k
KATA
mclloyd
12
9.7k
Making the Leap to Tech Lead
cromwellryan
116
7.6k
Typedesign – Prime Four
hannesfritz
34
1.5k
Robots, Beer and Maslow
schacon
154
7.3k
The Invisible Customer
myddelton
113
12k
Designing with Data
zakiwarfel
91
4.2k
A designer walks into a library…
pauljervisheath
198
16k
Pencils Down: Stop Designing & Start Developing
hursman
114
10k
Writing Fast Ruby
sferik
613
58k
Transcript
VISUAL TESTING A COMMUNICATION PROBLEM 1 — @basthomas
COMMUNICATION IS HARD 2 — @basthomas
SNAPSHOT TESTING 3 — @basthomas
func testViewWithSecondaryInteraction() { let viewUnderTest = InteractionBarView() let primaryInteractions: [Interaction]
= [.recommend, .comment, .like] let secondaryInteractions: [Interaction] = [.report] viewUnderTest.setup( withInteractions: primaryInteractions, secondaryInteractions: secondaryInteractions ) validateSnapshots(forView: viewUnderTest) } 4 — @basthomas
func testViewWithSecondaryInteraction() { let viewUnderTest = InteractionBarView() let primaryInteractions: [Interaction]
= [.recommend, .comment, .like] let secondaryInteractions: [Interaction] = [.report] viewUnderTest.setup( withInteractions: primaryInteractions, secondaryInteractions: secondaryInteractions ) validateSnapshots(forView: viewUnderTest) } 5 — @basthomas
func testViewWithSecondaryInteraction() { let viewUnderTest = InteractionBarView() let primaryInteractions: [Interaction]
= [.recommend, .comment, .like] let secondaryInteractions: [Interaction] = [.report] viewUnderTest.setup( withInteractions: primaryInteractions, secondaryInteractions: secondaryInteractions ) validateSnapshots(forView: viewUnderTest) } 6 — @basthomas
func testViewWithSecondaryInteraction() { let viewUnderTest = InteractionBarView() let primaryInteractions: [Interaction]
= [.recommend, .comment, .like] let secondaryInteractions: [Interaction] = [.report] viewUnderTest.setup( withInteractions: primaryInteractions, secondaryInteractions: secondaryInteractions ) validateSnapshots(forView: viewUnderTest) } 7 — @basthomas
func testViewWithSecondaryInteraction() { let viewUnderTest = InteractionBarView() let primaryInteractions: [Interaction]
= [.recommend, .comment, .like] let secondaryInteractions: [Interaction] = [.report] viewUnderTest.setup( withInteractions: primaryInteractions, secondaryInteractions: secondaryInteractions ) validateSnapshots(forView: viewUnderTest) } 8 — @basthomas
func testViewWithSecondaryInteraction() { let viewUnderTest = InteractionBarView() let primaryInteractions: [Interaction]
= [.recommend, .comment, .like] let secondaryInteractions: [Interaction] = [.report] viewUnderTest.setup( withInteractions: primaryInteractions, secondaryInteractions: secondaryInteractions ) validateSnapshots(forView: viewUnderTest) } 9 — @basthomas
10 — @basthomas
WHAT IF THE DESIGN CHANGES? 11 — @basthomas
WHAT IF ONE OF THE PRIMARY INTERACTIONS CHANGES? 12 —
@basthomas
! 13 — @basthomas
IT IS EASY TO MAKE A MISTAKE 14 — @basthomas
NAMING IS HARD 15 — @basthomas
NAMING IS HARD > testCellWithPageControlOnPage2of3 > testCellWithLongNameAndJob > testWithShortContent >
testTwoBirthdaysUnseenElement > testStateLoadMoreFailedInsertedOnTop > testSlideupViewWithNoIconNoButton 16 — @basthomas
DO YOU HAVE ANY IDEA WHAT IT IS WE'RE TESTING
HERE? 17 — @basthomas
... MAYBE? 18 — @basthomas
DO YOU HAVE ANY IDEA WHEN THESE TESTS ARE EXPECTEDLY
FAILING? 19 — @basthomas
ME NEITHER 20 — @basthomas
A FAILING SNAPSHOT TEST 21 — @basthomas
22 — @basthomas
testCellWithPageControlOnPage2of3 SO, IT SHOULDN'T BE 23 — @basthomas
! 24 — @basthomas
REPLACEABLE BY UNIT TESTS 25 — @basthomas
SNAPSHOTS AT SCALE 26 — @basthomas
WE MADE IT HARDER ON OURSELVES FORK, WRAPPER, WRAPPER, WRAPPER
27 — @basthomas
DOCUMENT DECISIONS 28 — @basthomas
MULTIPLE SIMULATORS 29 — @basthomas
SPACE 30 — @basthomas
IDE UPDATES 31 — @basthomas
! 32 — @basthomas
!"!"!"!"! !"!"!"!"! !"!"!"!"! !"!"!"!"! !"!"!"!"! 33 — @basthomas
SNAPSHOTS ARE SUBJECTIVE 34 — @basthomas
IT IS NOT ALL BAD 35 — @basthomas
QUESTION THINGS > "but I just copied it" > "but
others are doing it" > "but I can't write a unit test here" > "but ..." 36 — @basthomas
HOW TO PREVENT THIS 37 — @basthomas
DOCUMENT 38 — @basthomas
DOCUMENT COMMUNICATE 39 — @basthomas
DOCUMENT COMMUNICATE QUESTION THINGS 40 — @basthomas
DOCUMENT COMMUNICATE QUESTION THINGS ITERATE 41 — @basthomas
THANKS! 42 — @basthomas