Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
How to write good tests?
Alexander Beletsky
April 12, 2013
Programming
2
210
How to write good tests?
Small talk that I gave to @debitoor guys about practices of writing tests.
Alexander Beletsky
April 12, 2013
Tweet
Share
More Decks by Alexander Beletsky
See All by Alexander Beletsky
alexbeletsky
1
270
alexbeletsky
0
69
alexbeletsky
4
800
alexbeletsky
10
330
alexbeletsky
3
110
alexbeletsky
8
2k
alexbeletsky
9
4.9k
alexbeletsky
1
2.5k
alexbeletsky
1
520
Other Decks in Programming
See All in Programming
cocoatomo
0
170
manfredsteyer
PRO
1
140
dqneo
0
150
sh_akira
3
130
karosuwindam
0
110
palkan
2
460
hamakou108
4
540
y__mattu
0
230
kaonash
2
1.9k
bkuhlmann
2
330
clusterinc
0
310
horie1024
2
230
Featured
See All Featured
pedronauck
652
110k
robhawkes
53
2.9k
wjessup
340
16k
rocio
155
11k
nonsquared
81
3.4k
dougneiner
119
8k
cromwellryan
104
6.3k
shpigford
166
19k
brianwarren
82
4.8k
keavy
108
14k
geeforr
333
29k
deanohume
294
28k
Transcript
How to write good tests?
Honestly, I don’t know
But, there are properties of good tests…
… are written before code
… are running very fast
… are helping to find regressions
Writing unit tests is not about code verification
… it’s about code quality and design
Think different Think TDD
Could TDD be applied to everything?
In short, yes code, requirements, ui
Should TDD be applied to everything?
Probably, no simple tasks, prototypes
There are few techniques of writing tests
Classic school Kent Beck, 90’s Inside-Out design Focusing on logic
(algorithms)
London school Jason Gorman, 00’s Outside-In design Focusing on collaboration
Mocks
What about integration tests?
They are slow, hard to write, hard to setup… but
… they usually caught most nasty bugs.
None
Maintaining test driven cycle
None
Acceptance test (PO communication) API (integration) tests Utils (units) tests
Thanks, @alexbeletsky