Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
150
eBPF 簡介 2026 版
shunghsiyu
0
140
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
6
2.9k
Adversary Infrastructure Hunting101
disconinja
0
190
AI時代の開発はウォーターフォールに回帰する? / development-with-ai-back-to-wf
okamototakuyasr2
0
170
推論基盤と Scale-Up Interconnect の現状と制約から俯瞰する技術動向
markunet
2
740
Vue で書く 空間コンピューティング、TresJS と WebXR を使ったXR デバイスのフロントエンド開発
hiranuma
0
150
SLOを阻む不安
sraku2159
0
200
ひとりで始めた AI駆動開発、チームに広げて何が変わったのか
kenichiodo
1
210
AIで選択肢が広がった組織設計の理想と現実
konifar
16
7.5k
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
250
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
500
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
600
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
420
Speed Design
sergeychernyshev
33
2.2k
Visualization
eitanlees
153
17k
Automating Front-end Workflow
addyosmani
1370
210k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Odyssey Design
rkendrick25
PRO
2
910
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
440
We Have a Design System, Now What?
morganepeng
55
8.4k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
570
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.6k
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