Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Writing testable code
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rodrigo Boniatti
November 30, 2019
Programming
120
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
74
The pillars of integration
boniatti
0
120
Designing and building software with Ruby on Rails
boniatti
0
95
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
新卒PdEのリアル
ryu1013
1
510
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
SREの越境 / SRE Collaboration
y0hgi
2
260
App Intentsのビルドプロセスを支える技術
kntkymt
0
400
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
260
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.8k
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
180
Intent as Code
shoppingjaws
6
1k
What We Talk About When We Talk About XP
m_seki
2
660
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
180
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
540
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
2.1k
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.6k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
The Pragmatic Product Professional
lauravandoore
37
7.4k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
Statistics for Hackers
jakevdp
799
230k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
A designer walks into a library…
pauljervisheath
211
25k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
A Tale of Four Properties
chriscoyier
163
24k
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