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
97
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
70
The pillars of integration
boniatti
0
110
Designing and building software with Ruby on Rails
boniatti
0
86
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
240
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
240
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1k
VibeCodingからAgenticWorkflowへ
starfish719
0
550
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
610
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
150
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
260
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
5
1.8k
源内ハンズオン概要編
hideg
0
190
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
500
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
120
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
740
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Product Roadmaps are Hard
iamctodd
55
12k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
How to Talk to Developers About Accessibility
jct
2
520
Making the Leap to Tech Lead
cromwellryan
135
10k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
430
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
650
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