Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Bugs - What are they good for
Search
Leif Gensert
December 05, 2019
Technology
0
24
Bugs - What are they good for
Leif Gensert
December 05, 2019
Tweet
Share
More Decks by Leif Gensert
See All by Leif Gensert
Sorbet - Is it really that tasty?
leifg
0
50
state_of_functional_programming.pdf
leifg
0
44
Parsers in JavaScript
leifg
0
49
Building Event Sourced Apps
leifg
1
830
Unicode Spaß
leifg
0
43
Event Sourcing - The Story Telling of Processes
leifg
1
74
Elixir Releases
leifg
0
140
Introduction to Rails
leifg
0
52
JRuby - The enterprise view
leifg
1
110
Other Decks in Technology
See All in Technology
エンジニアリングをやめたくないので問い続ける
estie
2
1.2k
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
480
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
4
1.4k
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
2
280
Edge AI Performance on Zephyr Pico vs. Pico 2
iotengineer22
0
140
大企業でもできる!ボトムアップで拡大させるプラットフォームの作り方
findy_eventslides
1
760
乗りこなせAI駆動開発の波
eltociear
1
1.1k
エンジニアとPMのドメイン知識の溝をなくす、 AIネイティブな開発プロセス
applism118
4
1.2k
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
180
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
180
ガバメントクラウド利用システムのライフサイクルについて
techniczna
0
190
MapKitとオープンデータで実現する地図情報の拡張と可視化
zozotech
PRO
1
140
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
A Modern Web Designer's Workflow
chriscoyier
698
190k
How to Ace a Technical Interview
jacobian
280
24k
The Language of Interfaces
destraynor
162
25k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
GitHub's CSS Performance
jonrohan
1032
470k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Writing Fast Ruby
sferik
630
62k
Transcript
1 Bugs What are they good for?
None
What is a bug?
“First actual case of bug being found” Grace Hopper -
1947
“I did find a bug in my apparatus” Thomas Edison
- 1878
The Crash <> Request Scale Crash Change Request ⚠
Let’s ship some products
Numbers only?
Nope
“You didn’t say you wanted to ship stuff to the
Queen”
“Well you should know how addresses work”
The Crash <> Request Scale Crash Change Request ⚠
Record Investigate Fix
None
Reproduce It Fix It Ship It
Find a reproducible scenario
Speeds up fixing process
accepted Closed Won
paid Closed Lost
context 'accepted order' do let(:order) { build(:order, status: 'accepted') }
it 'returns "closed won"' do expect(deal_stage(order)).to eq('closed won') end end context 'paid order' do let(:order) { build(:order, status: 'paid') } it 'returns "closed won"' do expect(deal_stage(order)).to eq('closed won') end end
def deal_stage(order) return 'enquired' if order.nil? return 'quoted' if order.open?
return 'closed won' if order.accepted? 'closed lost' end
Lets you try out different solutions
Makes it clear what to fix
NoMethodError: undefined method `date’ for nil:NilClass
def render(order) { id: order.id, delivery_date: order.delivery.date } end
def render(order) { id: order.id, delivery_date: order.delivery&.date } end
GET /api/v1/orders?status=delivered • Order 01 • Order 02 • Order
03
Confidence that bug has been fixed
Continuous Integration Heroku Review Apps Create App Precompile Assets Create/Migrate
Database Launch App Code
But what about actually fixing the bugs?
def deal_stage(order) puts "What's happening?: #{order.inspect}" return 'enquired' if order.nil?
puts "What's happening?: #{order.inspect}" return 'quoted' if order.open? puts "What's happening?: #{order.inspect}" return 'closed won' if order.accepted? puts "What's happening?: #{order.inspect}" 'closed lost' end Puts Debugging
github.com/pry/pry def deal_stage(order) binding.pry return 'enquired' if order.nil? return 'quoted'
if order.open? return 'closed won' if order.accepted? 'closed lost' end
Is it really the culprit? Caching Third Party Libraries Recent
Changes User
Push Continuous Integration Deploy Revert Continuous Integration
Record Investigate Fix Now Depends on Urgency/Impact
My Latest Bug
None
None
None
None
Reproduce It Don’t jump to conclusions