Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
61
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
10
The pillars of integration
boniatti
0
70
Designing and building software with Ruby on Rails
boniatti
0
53
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
150
chocoZAPサービス予約システムをNuxtで内製化した話
rizap_tech
0
160
JETLS.jl ─ A New Language Server for Julia
abap34
1
410
AIコーディングエージェント(skywork)
kondai24
0
180
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
220
20 years of Symfony, what's next?
fabpot
2
370
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
850
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
これならできる!個人開発のすゝめ
tinykitten
PRO
0
110
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Automating Front-end Workflow
addyosmani
1371
200k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Unsuck your backbone
ammeep
671
58k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.3k
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