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
87
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
64
The pillars of integration
boniatti
0
110
Designing and building software with Ruby on Rails
boniatti
0
84
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.7k
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
540
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
370
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
200
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
120
えっ!!コードを読まずに開発を!?
hananouchi
0
270
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
160
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
550
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
240
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
150
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
450
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
140
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Documentation Writing (for coders)
carmenintech
77
5.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
350
HDC tutorial
michielstock
2
750
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
740
Skip the Path - Find Your Career Trail
mkilby
1
170
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
Git: the NoSQL Database
bkeepers
PRO
432
67k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
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