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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Rodrigo Boniatti
November 30, 2019
Programming
0
65
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
25
The pillars of integration
boniatti
0
84
Designing and building software with Ruby on Rails
boniatti
0
60
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
460
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
440
Raku Raku Notion 20260128
hareyakayuruyaka
0
420
Event Storming
hschwentner
3
1.3k
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
200
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
180
CSC307 Lecture 08
javiergs
PRO
0
690
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
630
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
190
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
320
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
3
330
Featured
See All Featured
Paper Plane
katiecoart
PRO
0
47k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
95
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
110
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
Statistics for Hackers
jakevdp
799
230k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
180
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
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