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
86
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
57
The pillars of integration
boniatti
0
110
Designing and building software with Ruby on Rails
boniatti
0
83
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
330
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
820
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
180
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.8k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.6k
act1-costs.pdf
sumedhbala
0
140
1B+ /day規模のログを管理する技術
broadleaf
0
120
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
250
dRuby over BLE
makicamel
2
400
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
380
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.4k
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Code Reviewing Like a Champion
maltzj
528
40k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
220
エンジニアに許された特別な時間の終わり
watany
107
250k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
380
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
From π to Pie charts
rasagy
0
220
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Prompt Engineering for Job Search
mfonobong
0
360
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