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
Lessons Learned From 10 Years Of Testing
Search
Chris Hartjes
October 27, 2017
Programming
4
120
Lessons Learned From 10 Years Of Testing
Slides of a talk I gave at Symfony Live Berlin on October 27, 2017
Chris Hartjes
October 27, 2017
Tweet
Share
More Decks by Chris Hartjes
See All by Chris Hartjes
Confessions of a not-so-accidental leader
grumpycanuck
0
160
Learn To Test Like A Grumpy Programmer
grumpycanuck
0
220
Time Management For Grumpy Programmers
grumpycanuck
0
190
Learn To Test Like A Grumpy Programmer
grumpycanuck
1
220
Learn To Test Like A Grumpy Programmer
grumpycanuck
2
180
Grumpy Testing Patterns
grumpycanuck
1
910
Embrace Your Inner Grumpy: Metatesting in 2016
grumpycanuck
0
120
Smelly Tests
grumpycanuck
0
80
Why You Can't Test
grumpycanuck
1
270
Other Decks in Programming
See All in Programming
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
CSC509 Lecture 09
javiergs
PRO
0
140
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
C++でシェーダを書く
fadis
6
4.1k
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
How STYLIGHT went responsive
nonsquared
95
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Code Reviewing Like a Champion
maltzj
520
39k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Side Projects
sachag
452
42k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Speed Design
sergeychernyshev
24
610
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Typedesign – Prime Four
hannesfritz
40
2.4k
Transcript
Lessons Learned From Ten Years Of Testing © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 1
TL;DR -- Tests are made of people! © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 2
This talk contains no code or tests (Sorry, not sorry)
© Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 3
December 2002 I am six months into working on a
poorly-constructed dating web application where he made most of the mistakes himself with the help of other people who didn't know any better © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 4
Formula for burnout — super-long commute — "mandatory" overtime ©
Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 5
The Launch Crashed Hard — so many assumptions were wrong
© Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 6
"Hey Chris, I think you should read this!" © Chris
Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 7
It was the moment that changed everything for me ©
Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 8
It was the moment that changed everything for me Not
even remotely kidding © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 9
So what were the tools? — SimpleTest — Lots of
swearing © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 10
PHPUnit hadn't even been released yet! © Chris Hartjes @grmpyprogrammer
- Symfony Live Berlin (Oktober 27, 2017) 11
So li!le PHP-specific testing info was available Caused much sadness
© Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 12
Lesson Number One Having one person enthusiastic about writing tests
simply isn't enough © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 13
Cowboy Testing For Anger And Sadness You can start off
being the only one writing tests... © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 14
Cowboy Testing For Anger And Sadness ...but company culture might
make you regret it © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 15
Tests will continue until bugs no longer happen Much complaining
ensued (a common theme continuing to present-day) © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 16
Tests will continue until bugs no longer happen — Tests
got written — I started getting more interested in the process — Lost a political struggle to get the job I wanted so I left © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 17
Early 2006... My gateway into OSS... and tests... and how
to be a difficult person... and how to deal with difficult people... was via the CakePHP project © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 18
Lesson Number Two Tests for a project mean that at
least somebody used to care at some point about what they were doing © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 19
— tests provide windows into bugs — tests are still
written by people — people are willing to argue about everything and anything © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 20
Tests driven by bug fixes help find all the weird
decisions you made but don't remember why © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 21
They also show you how to actually use the code
© Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 22
Think of them as stealth documentation © Chris Hartjes @grmpyprogrammer
- Symfony Live Berlin (Oktober 27, 2017) 23
But tests are written by people, and bad tests happen.
© Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 24
Critics like to use this as evidence that tests don't
work. © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 25
They are wrong. © Chris Hartjes @grmpyprogrammer - Symfony Live
Berlin (Oktober 27, 2017) 26
I spent some years in the wilderness © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 27
I started to really learn about testing © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 28
Lesson Number 3 People struggle to learn about testing without
help © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 29
— TDD examples are way too simple — People seek
shortcuts to solutions — Repeating theme - people want to argue about tools and techniques © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 30
TDD isn't simple because testing isn't simple © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 31
And your code isn't simple © Chris Hartjes @grmpyprogrammer -
Symfony Live Berlin (Oktober 27, 2017) 32
It's way more important to teach people about tools and
techniques © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 33
Then they can apply them to their own code ©
Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 34
So you might snort at yet-another- FizzBuzz example © Chris
Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 35
But if you're not paying a!ention to the PROCESS you
will miss out © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 36
Testing is something that cannot be learned in isolation ©
Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 37
Testing IS code wri!en for a SPECIFIC PURPOSE © Chris
Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 38
I am changing what I teach © Chris Hartjes @grmpyprogrammer
- Symfony Live Berlin (Oktober 27, 2017) 39
It's no longer enough to just show people how to
use the tools © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 40
You have to show them where, and when, and why
to use them © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 41
Desperately Seeking Shortcuts — "I'd be finished with this task
if I didn't have to write the tests!!!" © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 42
There are no shortcuts © Chris Hartjes @grmpyprogrammer - Symfony
Live Berlin (Oktober 27, 2017) 43
Just lots and lots of work to try and create
things with the fewest bugs possible © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 44
I started writing books and giving lots of talks ©
Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 45
Lesson Number 4 All these testing problems and techniques were
solved back in the 1970's © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 46
GO BUY THIS BOOK © Chris Hartjes @grmpyprogrammer - Symfony
Live Berlin (Oktober 27, 2017) 47
All the techniques we argue about today were invented in
the 1970's and 1980's © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 48
Programmer hubris led many to think they were the first
to figure it out © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 49
Lesson Number 5 The problem is people © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 50
Programming-related discussions turn toxic very easily... © Chris Hartjes @grmpyprogrammer
- Symfony Live Berlin (Oktober 27, 2017) 51
...just like every other discussion online © Chris Hartjes @grmpyprogrammer
- Symfony Live Berlin (Oktober 27, 2017) 52
Your best weapon against toxicity is EMPATHY © Chris Hartjes
@grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 53
Testing your code requires you to change how you write
your code © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 54
People do not like this © Chris Hartjes @grmpyprogrammer -
Symfony Live Berlin (Oktober 27, 2017) 55
People like to change WHAT THEY USE but NOT HOW
THEY USE IT © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 56
Funny how the quest for the new and shiny never
seems to include tools help them make things bug free © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 57
Shameless Plugs My name is Chris Hartjes — Staff Test
Engineer at Mozilla (focussed on services) — Twitter performance artist -> @grmpyprogrammer — Buy my stuff at https://grumpy-learning.com © Chris Hartjes @grmpyprogrammer - Symfony Live Berlin (Oktober 27, 2017) 58