Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Clean and Quality Unit Tests
Search
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
プロンプトやエージェントを自動的に作る方法
shibuiwilliam
10
8.2k
Edge AI Performance on Zephyr Pico vs. Pico 2
iotengineer22
0
160
非CUDAの悲哀 〜Claude Code と挑んだ image to 3D “Hunyuan3D”を EVO-X2(Ryzen AI Max+395)で動作させるチャレンジ〜
hawkymisc
2
190
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
770
大企業でもできる!ボトムアップで拡大させるプラットフォームの作り方
findy_eventslides
1
770
生成AI活用の型ハンズオン〜顧客課題起点で設計する7つのステップ
yushin_n
0
180
意外とあった SQL Server 関連アップデート + Database Savings Plans
stknohg
PRO
0
320
Python 3.14 Overview
lycorptech_jp
PRO
1
110
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
150
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
3.1k
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
210
AWS Bedrock AgentCoreで作る 1on1支援AIエージェント 〜Memory × Evaluationsによる実践開発〜
yusukeshimizu
6
400
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
527
40k
Site-Speed That Sticks
csswizardry
13
1k
Speed Design
sergeychernyshev
33
1.4k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Thoughts on Productivity
jonyablonski
73
5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
Become a Pro
speakerdeck
PRO
31
5.7k
KATA
mclloyd
PRO
33
15k
A Tale of Four Properties
chriscoyier
162
23k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
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