Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
3
550
Clean and Quality Unit Tests
Talk about readability and high quality of unit tests written in PHPUnit
codecleaner
November 23, 2013
Tweet
Share
Other Decks in Technology
See All in Technology
「Managed Instances」と「durable functions」で広がるAWS Lambdaのユースケース
lamaglama39
0
310
チーリンについて
hirotomotaguchi
6
1.9k
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
110
MapKitとオープンデータで実現する地図情報の拡張と可視化
zozotech
PRO
1
140
グレートファイアウォールを自宅に建てよう
ctes091x
0
150
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
180
Kubernetes Multi-tenancy: Principles and Practices for Large Scale Internal Platforms
hhiroshell
0
120
日本Rubyの会の構造と実行とあと何か / hokurikurk01
takahashim
4
1k
文字列の並び順 / Unicode Collation
tmtms
3
570
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
350
[JAWS-UG 横浜支部 #91]DevOps Agent vs CloudWatch Investigations -比較と実践-
sh_fk2
2
250
品質のための共通認識
kakehashi
PRO
3
250
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Code Reviewing Like a Champion
maltzj
527
40k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Bash Introduction
62gerente
615
210k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
[SF Ruby Conf 2025] Rails X
palkan
0
510
How to Ace a Technical Interview
jacobian
280
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Docker and Python
trallard
47
3.7k
The Language of Interfaces
destraynor
162
25k
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