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
68
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
29
The pillars of integration
boniatti
0
88
Designing and building software with Ruby on Rails
boniatti
0
62
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.1k
Understanding Apache Lucene - More than just full-text search
spinscale
0
140
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
160
存在論的プログラミング: 時間と存在を記述する
koriym
4
460
Ruby and LLM Ecosystem 2nd
koic
1
1.3k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
300
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
360
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
310
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
150
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
200
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
510
Featured
See All Featured
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.5k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
430
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The browser strikes back
jonoalderson
0
830
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
200
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
690
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
330
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
160
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The SEO identity crisis: Don't let AI make you average
varn
0
420
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
260
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