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
64
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
20
The pillars of integration
boniatti
0
79
Designing and building software with Ruby on Rails
boniatti
0
59
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
330
Package Management Learnings from Homebrew
mikemcquaid
0
210
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Fragmented Architectures
denyspoltorak
0
150
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
4
330
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
AI巻き込み型コードレビューのススメ
nealle
0
130
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
590
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Building an army of robots
kneath
306
46k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Deep Space Network (abreviated)
tonyrice
0
46
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Building the Perfect Custom Keyboard
takai
2
680
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
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