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
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Writing testable code
Rodrigo Boniatti
November 30, 2019
More Decks by Rodrigo Boniatti
See All by Rodrigo Boniatti
Challenges of the modern web
boniatti
0
73
The pillars of integration
boniatti
0
120
Designing and building software with Ruby on Rails
boniatti
0
93
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
Deep dive into the select statement (GopherCon UK)
jespino
0
170
Press start. Python's next generation.
willingc
PRO
3
300
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
550
リアルな遅延を測る仕様
kota_yata
1
140
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
2
1k
新卒PdEのリアル
ryu1013
1
290
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
160
My Marp Sample
sinoue0108
0
140
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
0
310
AIエージェント時代のコードレビューを設計する
nogu66
5
2.4k
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
390
自分的「カンファレンスの楽しみ方」
syumai
0
180
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
470
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.6k
Google's AI Overviews - The New Search
badams
0
1.6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
230
Fireside Chat
paigeccino
42
4k
BBQ
matthewcrist
89
10k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
260
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
490
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
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