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
260
alexbeletsky
0
68
alexbeletsky
4
790
alexbeletsky
10
330
alexbeletsky
3
110
alexbeletsky
8
2k
alexbeletsky
9
4.9k
alexbeletsky
1
2.4k
alexbeletsky
1
510
Other Decks in Programming
See All in Programming
hr01
0
1.6k
trajchevska
2
350
daiki1020
0
1.1k
kyonmm
2
2.1k
mu2in
0
140
manfredsteyer
PRO
0
270
zsmb
1
130
line_developers_tw
1
460
supikiti
3
1.3k
takahi5
0
220
line_developers_tw2
0
680
thatjeffsmith
0
420
Featured
See All Featured
searls
204
35k
colly
186
14k
dotmariusz
94
5.1k
reverentgeek
27
1.9k
myddelton
109
11k
addyosmani
494
110k
pedronauck
652
110k
hatefulcrawdad
257
17k
lauravandoore
437
28k
afnizarnur
176
14k
sachag
267
17k
ammeep
656
54k
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