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
Writing testable code
Search
Rodrigo Boniatti
November 30, 2019
Programming
0
54
Writing testable code
Rodrigo Boniatti
November 30, 2019
Tweet
Share
More Decks by Rodrigo Boniatti
See All by Rodrigo Boniatti
The pillars of integration
boniatti
0
66
Designing and building software with Ruby on Rails
boniatti
0
47
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
2
1.1k
PHPカンファレンス関西2025 基調講演
sugimotokei
5
1k
中級グラフィックス入門~効率的なメッシュレット描画~
projectasura
3
1.7k
コーディングエージェント概観(2025/07)
itsuki_t88
0
440
PHPUnitの限界をPlaywrightで補完するテストアプローチ
yuzneri
0
350
AI Ramen Fight
yusukebe
0
120
React 使いじゃなくても知っておきたい教養としての React
oukayuka
13
1.7k
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
300
Reactの歴史を振り返る
tutinoko
1
140
20250708_JAWS_opscdk
takuyay0ne
2
150
階層化自動テストで開発に機動力を
ickx
1
440
Bedrock AgentCore ObservabilityによるAIエージェントの運用
licux
8
360
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
850
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Balancing Empowerment & Direction
lara
1
510
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Building Applications with DynamoDB
mza
95
6.5k
Faster Mobile Websites
deanohume
308
31k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
390
Transcript
Writing testable code
Rodrigo Boniatti Developer at Codeminer 42 @boniattirodrigo rodrigoboniatti.com
Conditionals
None
Smell
None
None
Refactored
None
None
Conditionals • Smell: • High cyclomatic complexity score; • How
to solve? • Replace Conditional with Polymorphism;
Global state
Smell
None
Refactored
None
Global state • Smell: • Coupling; • How to solve?
• Dependency injection;
Life cycle events
Smell
None
Refactored
None
Life cycle events • Smell: • Hide code behavior; •
No execution order; • How to solve? • Single flow;
Principles of testing
Principles of testing • Test in isolation; • A lot
of setup == smell; • Hard to test == smell;
Questions?
Thank you Code examples: https://github.com/boniattirodrigo/writing-testable-code