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
570
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
Microsoft MVP プログラムを紹介するから目指す人増えてくれ
tsubakimoto_s
0
160
魔法少女がClaude Codeを監視する / ccportal-deck
noriyukitakei
3
110
[2026-08-25]AIによる自動化と人の介入、その狭間で揺れる信頼性についての俺の思いを、波よ聞いてくれ
tosite
0
120
最新技術に積極チャレンジ!EKS共通基盤のこれまでとこれから
daitak
0
290
When Token Pruning is Worse than Random: Understanding Visual Token Information in VLLMs
sansantech
PRO
0
220
AI駆動開発を組織で促すために
lycorptech_jp
PRO
7
9.1k
bet_ai_day_2026_session02
agenticsec
1
380
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.3k
KAEN Company Deck
kaen
PRO
0
220
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
130
ClaudeCodeでセキュリティ監視業務を半自動化_1年の運用でわかったAIに任せる設計の5つのポイント
kintotechdev
4
1k
どんな手を使っても絶対間に合わせるスケジューラ
asari194617
0
1.5k
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
460
The Curious Case for Waylosing
cassininazir
1
490
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.6k
Skip the Path - Find Your Career Trail
mkilby
1
210
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
810
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
220
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Mind Mapping
helmedeiros
PRO
1
340
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