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
2026年春のAgentCoreアプデ 細かいやつ全部まとめ
minorun365
4
240
エンタープライズの厳格な制約を開発者に意識させない:クラウドネイティブ開発基盤設計/cloudnative-kaigi-golden-path
mhrtech
0
430
Purview 勉強会報告 Microsoft Purview 入門しようとしてみた
masakichixo
1
430
AI-Assisted Contributions and Maintainer Load - PyCon US 2026
pauloxnet
1
150
GCASアップデート(202603-202605)
techniczna
0
190
Databricks 月刊サービスアップデートまとめ 2026年04月号
tyosi1212
0
130
既存プロダクトQAから新規プロダクトQAへ
ryotakahashi
0
140
SpeechTranscriber + AIによる文字起こし機能
kazuki1220
0
100
CARTA HOLDINGS エンジニア向け 採用ピッチ資料 / CARTA-GUIDE-for-Engineers
carta_engineering
0
47k
20260515 OpenIDファウンデーション・ジャパンご紹介
oidfj
0
120
なぜ、私がCommunity Builderに?〜活動期間1か月半でも選出されたワケ〜
yama3133
0
130
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
750
Featured
See All Featured
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
Leo the Paperboy
mayatellez
7
1.8k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
210
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
500
Abbi's Birthday
coloredviolet
2
7.6k
Making Projects Easy
brettharned
120
6.6k
The Cult of Friendly URLs
andyhume
79
6.9k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
170
WCS-LA-2024
lcolladotor
0
590
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
280
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