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
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
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
240
Data + AI Summit 2026 イベントレポート: 「AIがビジネスで意思決定するデータ基盤」へ
nek0128
0
290
Gen3R: 3D Scene Generation Meets Feed-Forward Reconstruction
spatial_ai_network
0
140
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
150
実践!既存 Project への AI-Driven Development 適用〜 一ヶ月で Project 唯一のフロントエンドエンジニアを作り出せ〜
lycorptech_jp
PRO
0
340
AI時代の開発生産性は、個人技からチーム設計へ
moongift
PRO
4
2.4k
インシデント事例と パッケージの全量解析に学ぶ ソフトウェアサプライチェーンの守り方 / supply-chain-attack-defense
flatt_security
0
520
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
160
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
440
キャリアLT会#3
beli68
0
160
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
640
マルチアカウント環境でSecurity Hubの運用、その後どうなった? / SRE NEXT 2026 miniLT会
genda
0
110
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Leo the Paperboy
mayatellez
8
1.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
220
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Side Projects
sachag
455
43k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
220
Docker and Python
trallard
47
4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
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