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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
トークン最適化のためのユーザーストーリー分析 / User Story Analysis for Token Optimization
oomatomo
0
170
ZOZOTOWNの進化と信頼性を両立する負荷試験
zozotech
PRO
0
120
AI Agent SaaS を支える自社仮想化基盤への挑戦と実運用 / ai-agent-saas-virtualization
flatt_security
2
1.5k
SRE Lounge Hiroshimaへの招待
grimoh
0
250
CVE-2026-20833_脆弱性対応とAES 化について
jukishiya
0
370
勉強会企画をアプリで構造化してみた 〜そこで見えた、AIとの付き合い方〜 / I've structured a study group plan using an app.
pauli
0
320
アカウントが増えてからでは遅い? ~ マルチアカウント統制の勘所 ~
kenichinakamura
0
140
プライバシー保護の理論と実践
lycorptech_jp
PRO
1
240
美しいコードを書くためにF#を学んでみた話
yud0uhu
1
210
プロダクトだけじゃない、社内プロセスにおける自動化・省力化ノススメ
kakehashi
PRO
1
250
FinOps X 2026 Recap from Engineer Side #JapanFinOps
chacco38
0
260
Mastraエージェント、どのクラウドにデプロイする?
minorun365
PRO
2
170
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Discover your Explorer Soul
emna__ayadi
2
1.2k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
New Earth Scene 8
popppiees
3
2.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
370
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.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