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
Clean and Quality Unit Tests
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
codecleaner
November 23, 2013
Technology
560
3
Share
Clean and Quality Unit Tests
Talk about readability and high quality of unit tests written in PHPUnit
codecleaner
November 23, 2013
Other Decks in Technology
See All in Technology
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
390
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
660
プロンプトエンジニアリングを超えて:自由と統制のあいだでつくる Platform × Context Engineering
yuriemori
0
240
CDK Insightsで見る、AIによるCDKコード静的解析(+AI解析)
k_adachi_01
2
180
Snowflake Intelligence導入で 分かった活用のコツ
wonohe
0
110
NOSTR, réseau social et espace de liberté décentralisé
rlifchitz
0
200
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
310
Do Ruby::Box dream of Modular Monolith?
joker1007
1
290
JOAI2026講評会資料(近藤佐介)
element138
1
160
幾億の壁を超えて/Beyond Countless Walls(JP)
ikuodanaka
0
140
EBS暗号化に失敗してEC2が動かなくなった話
hamaguchimmm
2
170
LLM時代の検索アーキテクチャと技術的意思決定
shibuiwilliam
2
790
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
98
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Building AI with AI
inesmontani
PRO
1
900
A designer walks into a library…
pauljervisheath
211
24k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Navigating Team Friction
lara
192
16k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
100
Believing is Seeing
oripsolob
1
110
How to Ace a Technical Interview
jacobian
281
24k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
Clean & Quality unit tests
Wojtek Zieliński @codecleaner
• Names matters • Exceptions • Test Doubles • Stubbing
Collections • Arrange Act Assert What’s it all about?
Names matters
None
None
None
None
None
None
None
None
Test a single concept in each test function Robert C.
Martin
None
None
None
None
None
None
None
None
None
None
Exceptions
None
None
None
None
None
None
None
None
None
None
None
None
Test Doubles
None
None
None
How does getMock() really work? • Does Configuration class exist?
• Create Mock_Configuration_123abc class extends Configuration class • Create instance of that class • Return instance
How does getMock() really work? • Does Configuration class exist?
• Create Mock_Configuration_123abc class extends Configuration class • Create instance of that class • Return instance • Create Configuration class
None
None
None
None
None
None
None
None
None
None
None
None
Stubs provide canned answers to calls made during the test
"Mocks Aren’t Stubs" Martin Fowler
Mocks are objects pre-programmed with expectations which form a specification
of the calls they are expected to receive "Mocks Aren’t Stubs" Martin Fowler
None
None
None
None
None
None
None
None
None
None
None
None
Stubbing collections
None
None
Arrange Act Assert
None
None
None
It’s all about readability
None
None
What’s next?
None
None
Questions? Wojtek Zieliński @codecleaner