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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rodrigo Boniatti
November 30, 2019
Programming
0
68
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
29
The pillars of integration
boniatti
0
88
Designing and building software with Ruby on Rails
boniatti
0
61
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
安いハードウェアでVulkan
fadis
0
470
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
160
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
570
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
610
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
470
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
230
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1k
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
200
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
210
Windows on Ryzen and I
seosoft
0
320
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
0
140
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Documentation Writing (for coders)
carmenintech
77
5.3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
Six Lessons from altMBA
skipperchong
29
4.2k
How GitHub (no longer) Works
holman
316
150k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
74
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
The SEO Collaboration Effect
kristinabergwall1
0
400
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