28
The Anatomy of a Bug

Anatomy of a bug

Embed Size (px)

Citation preview

Page 1: Anatomy of a bug

TheAnatomy

ofa

Bug

Page 2: Anatomy of a bug

Four Parts:- Triage

- Reproduction

- Finding the Root Cause

- The Fix

Page 3: Anatomy of a bug

But first...

Page 4: Anatomy of a bug

Part 1: TriageIdentification & Priority

Page 5: Anatomy of a bug

Is itreally

abug?

Page 6: Anatomy of a bug

It isa

bug!It can be

“reproduced”, or at least clearly seen to

be affecting users.

Page 7: Anatomy of a bug

Let’s ask some questions to help us assess the priority with which we should fix this bug.

Page 8: Anatomy of a bug

Who reported it?

me

otherdevelopers

payingcustomers

myboss

CEO

QA people

productowner

Page 9: Anatomy of a bug

Which environment?

development

staging

test

production

Page 10: Anatomy of a bug

Who is affected?

that one user who uses Konqueror

a small percentage of users

only non-paying users

all users will experience the bug when using the app

a large percentage of users

Page 11: Anatomy of a bug

What happens?

deletesuser data

warning in log; user experience not affected

menu misaligned in Safari

users cannot give you money

Page 12: Anatomy of a bug

When did it start happening?

immediately after a new feature was released.

several days/weeks after the last release

during a vendor outage (payment gateway etc)

Page 13: Anatomy of a bug

So, how urgent?

Page 14: Anatomy of a bug

Part 2: Reproduction

Page 15: Anatomy of a bug

Step 1:

Experience the bug in the environment it appears in.

Page 16: Anatomy of a bug

Step 2:

Set up your local environment so that you can (manually) reproduce it there.

Page 17: Anatomy of a bug

Step 3:

Write a test that captures the bug. It should fail.

Page 18: Anatomy of a bug

Part 3: Finding the Root Cause

Time to break out the debugging tools!

Page 19: Anatomy of a bug

puts / logging

Page 20: Anatomy of a bug

better_errors

Page 21: Anatomy of a bug

Airbrake

Page 22: Anatomy of a bug

rails console

Page 23: Anatomy of a bug

pry

Page 24: Anatomy of a bug

byebug

Page 25: Anatomy of a bug

pry on steroids- pry-byebug

- pry-remote

Page 26: Anatomy of a bug

Part 4: The Fix- Two aspects: the spec

addition and the actualfix.

- Don’t rush the fix, thinkabout the most correctway to adjust the code.

Page 27: Anatomy of a bug

Thanks :-)

Page 28: Anatomy of a bug

We are hiring!

rrsoft.co/jobs