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
73
0
Share
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
38
The pillars of integration
boniatti
0
92
Designing and building software with Ruby on Rails
boniatti
0
66
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
280
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
1
460
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
160
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.7k
How Swift's Type System Guides AI Agents
koher
0
310
From Formal Specification to Property Based Test
ohbarye
0
400
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
210
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
360
tRPCの概要と少しだけパフォーマンス
misoton665
2
240
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.5k
Programming with a DJ Controller — not vibe coding
m_seki
3
310
Featured
See All Featured
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
530
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
130
sira's awesome portfolio website redesign presentation
elsirapls
0
220
Making Projects Easy
brettharned
120
6.6k
The Curious Case for Waylosing
cassininazir
0
320
BBQ
matthewcrist
89
10k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Are puppies a ranking factor?
jonoalderson
1
3.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.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