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
79
0
Share
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
46
The pillars of integration
boniatti
0
98
Designing and building software with Ruby on Rails
boniatti
0
75
Mobile development with React Native
boniatti
1
3.5k
Other Decks in Programming
See All in Programming
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
420
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
1
750
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
3
240
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
4
490
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
510
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
280
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
220
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
6
6.1k
GitHub Copilot CLIのいいところ
htkym
2
550
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
2
550
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
260
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2.3k
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.4k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
550
Docker and Python
trallard
47
3.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
370
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
The untapped power of vector embeddings
frankvandijk
2
1.7k
Designing Experiences People Love
moore
143
24k
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