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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
codecleaner
November 23, 2013
Technology
3
550
Clean and Quality Unit Tests
Talk about readability and high quality of unit tests written in PHPUnit
codecleaner
November 23, 2013
Tweet
Share
Other Decks in Technology
See All in Technology
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.1k
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
120
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.6k
Mosaic AI Gatewayでコーディングエージェントを配るための運用Tips / JEDAI 2026 新春 Meetup! AIコーディング特集
genda
0
150
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
200
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
2人で作ったAIダッシュボードが、開発組織の次の一手を照らした話― Cursor × SpecKit × 可視化の実践 ― Qiita AI Summit
noalisaai
1
370
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
410
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
42k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
530
What happened to RubyGems and what can we learn?
mikemcquaid
0
240
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
3
1.2k
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.3k
sira's awesome portfolio website redesign presentation
elsirapls
0
140
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
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