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
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
78
The pillars of integration
boniatti
0
130
Designing and building software with Ruby on Rails
boniatti
0
98
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
contenteditable と日本語入力に向き合う
colorful12
0
180
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
100
気持ちぃ〜角丸 Squircle
ryu1013
0
150
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
280
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
350
すこし踏み込む CancellationToken
htkym
2
1.7k
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
200
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
360
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
390
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
170
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
570
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
390
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
310
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
940
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Rails Girls Zürich Keynote
gr2m
96
14k
Code Review Best Practice
trishagee
74
20k
The Curious Case for Waylosing
cassininazir
1
560
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
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