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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
16
The pillars of integration
boniatti
0
76
Designing and building software with Ruby on Rails
boniatti
0
58
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
700
Grafana:建立系統全知視角的捷徑
blueswen
0
310
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
520
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
380
Architectural Extensions
denyspoltorak
0
240
Data-Centric Kaggle
isax1015
2
710
CSC307 Lecture 04
javiergs
PRO
0
650
CSC307 Lecture 06
javiergs
PRO
0
660
ゆくKotlin くるRust
exoego
1
210
Python札幌 LT資料
t3tra
7
1.1k
CSC307 Lecture 02
javiergs
PRO
1
770
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
130
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
260
GraphQLとの向き合い方2022年版
quramy
50
14k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
84
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
So, you think you're a good person
axbom
PRO
2
1.9k
Producing Creativity
orderedlist
PRO
348
40k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
200
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
The Spectacular Lies of Maps
axbom
PRO
1
450
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Making Projects Easy
brettharned
120
6.6k
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