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
0
51
Writing testable code
Rodrigo Boniatti
November 30, 2019
Tweet
Share
More Decks by Rodrigo Boniatti
See All by Rodrigo Boniatti
The pillars of integration
boniatti
0
65
Designing and building software with Ruby on Rails
boniatti
0
45
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
ローコードサービスの進化のためのモノレポ移行
taro28
1
220
Your Architecture as a Crime Scene:Forensic Analysis @bastacon 2025 in Frankfurt
manfredsteyer
PRO
0
160
はじめてのIssueOps - GitHub Actionsで実現するコメント駆動オペレーション
tmknom
7
2k
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
150
AWS CDKにおけるL2 Constructの仕組み / aws-cdk-l2-construct
gotok365
4
850
Duke on CRaC with Jakarta EE
ivargrimstad
0
860
AI Agentを利用したAndroid開発について
yuchan2215
0
170
Compose Navigation実装の見通しを良くする
hiroaki404
0
110
保守性を高める AWS CDK のセオリー・ベストプラクティス
yamanashi_ren01
5
680
Kotlinの開発でも AIをいい感じに使いたい / Making the Most of AI in Kotlin Development
kohii00
5
2.4k
아직도 SOLID 를 '글'로만 알고 계신가요?
sh1mj1
0
310
requirements with math
moony
0
450
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Faster Mobile Websites
deanohume
306
31k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
8
680
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
420
Building Adaptive Systems
keathley
40
2.4k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Building Your Own Lightsaber
phodgson
104
6.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.1k
Six Lessons from altMBA
skipperchong
27
3.7k
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