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
信頼性の目標を誰も求めてない
shubox
0
480
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
110
What We Talk About When We Talk About XP
m_seki
2
290
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
2
990
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
290
typoなんかねぇよ
raspython3
0
660
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
280
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.7k
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
620
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
130
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
120
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
130
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
370
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Code Reviewing Like a Champion
maltzj
528
40k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
490
Become a Pro
speakerdeck
PRO
31
6.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
510
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
440
Are puppies a ranking factor?
jonoalderson
2
3.9k
GraphQLとの向き合い方2022年版
quramy
50
15k
The Cost Of JavaScript in 2023
addyosmani
55
10k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
500
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