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
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
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
インフラと開発の垣根を超えていき!〜元AWSインフラエンジニアがAWS開発で奮闘している話〜
hatahata021
3
340
OpenTelemetryにおけるGoのゼロコード・コンパイル時計装について #fukuokago
quiver
0
160
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
1.1k
人とエージェントが高め合う協業設計
kintotechdev
0
430
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
220
生成 AI 時代にいま一度「問い合わせ」について考えてみる
kazzpapa3
1
100
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
0
440
ボーイスカウトルールでメモリやスキルを改善しよう
azukiazusa1
4
1.5k
そのドキュメント、自動化しませんか?
yuksew
1
360
設計レビューとAIハーネスで向き合う AIが生み出した新しいボトルネックの対処法 / Design Reviews and AI Harnesses Against New Bottlenecks Created by AI
nstock
1
180
Webアプリ認証の全体像 / The Big Picture of Web App Authentication
kitano_yuichi
1
350
Featured
See All Featured
Building an army of robots
kneath
306
46k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
BBQ
matthewcrist
89
10k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
260
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.6k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
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