Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
61
Writing testable code
Rodrigo Boniatti
November 30, 2019
Tweet
Share
More Decks by Rodrigo Boniatti
See All by Rodrigo Boniatti
Challenges of the modern web
boniatti
0
10
The pillars of integration
boniatti
0
70
Designing and building software with Ruby on Rails
boniatti
0
54
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
170
Cell-Based Architecture
larchanjo
0
140
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
Navigating Dependency Injection with Metro
l2hyunwoo
1
170
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
Deno Tunnel を使ってみた話
kamekyame
0
230
ゲームの物理 剛体編
fadis
0
370
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3k
Graviton と Nitro と私
maroon1st
0
130
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
150
俺流レスポンシブコーディング 2025
tak_dcxi
14
9.5k
Featured
See All Featured
Designing for Performance
lara
610
69k
Building Adaptive Systems
keathley
44
2.9k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
65
35k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
0
160
My Coaching Mixtape
mlcsv
0
13
Building an army of robots
kneath
306
46k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
980
The #1 spot is gone: here's how to win anyway
tamaranovitovic
1
860
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
300
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
30
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
210
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