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
0
55
Writing testable code
Rodrigo Boniatti
November 30, 2019
Tweet
Share
More Decks by Rodrigo Boniatti
See All by Rodrigo Boniatti
The pillars of integration
boniatti
0
66
Designing and building software with Ruby on Rails
boniatti
0
47
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
550
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
230
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.8k
CSC305 Lecture 02
javiergs
PRO
1
260
複雑化したリポジトリをなんとかした話 pipenvからuvによるモノレポ構成への移行
satoshi256kbyte
1
990
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
430
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
1.8k
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
390
クラシルを支える技術と組織
rakutek
0
200
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
3.8k
CSC509 Lecture 01
javiergs
PRO
1
440
技術的負債の正体を知って向き合う / Facing Technical Debt
irof
0
130
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
A designer walks into a library…
pauljervisheath
209
24k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
9
590
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Code Review Best Practice
trishagee
72
19k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.3k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Visualization
eitanlees
148
16k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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