SlideShare a Scribd company logo
Debugging
 Squash The Bug!!
Source

• This presentation is adapted from this handout
  from Stanford’s CS106A course.
Don’t Panic

• Be systematic and persistent. Don’t panic. The
  bug is not moving around in your code, trying to
  trick or evade you. It is just sitting in one
  place, doing the wrong thing in the same way
  every time.
Test As You Go

• If you code was working a minute ago, but now it
  doesn’t—what was the last thing you changed?

•    This incredibly reliable rule of thumb is the reason
    you should test your code as you go rather than
    all at once.
Don’t Trust Yourself

• Be critical of your beliefs about your code. It’s
  almost impossible to see a bug in a function when
  your instinct is that the function is innocent.

• Only when the facts have proven without question
  that the function is not the source of the problem
  should you assume it to be correct.
Trust The Facts

• Intuition and hunches are great—you just have to
  test them out.

• When a hunch and a fact collide, the fact wins.
Let Your Intuition Guide You

• Although you need to be systematic, there is still
  an enormous amount of room for
  beliefs, hunches, guesses, etc.

• Use your intuition about where the bug probably is
  to direct the order that you check things in your
  systematic search. Check the functions you
  suspect the most first.

• Good instincts will come with experience.
It’s Usually The Simple
             Things
• Don’t look for complex explanations. Even the
  simplest omission or typo can lead to very weird
  behavior. Everyone is capable producing
  extremely simple and obvious errors from time to
  time.

• Look at code critically—don’t just sweep your eye
  over that series of simple statements assuming
  that they are too simple to be wrong.
Facts, Facts, Facts

• The clue to what is wrong in your code is in the
  values of your variables and the flow of control.

• Try to see what the facts are pointing to. The
  computer is not trying to mislead you. Work from
  the facts.
Change Only One Thing At A
          Time
• Do not change your code haphazardly trying to
  track down a bug. This is sort of like a scientist
  who changes more than one variable in an
  experiment at a time.

• It makes the observed behavior much more
  difficult to interpret, and you tend to introduce new
  bugs.
If You Find Something
           Wrong, Fix It
• If you find some wrong code that does not seem
  to be related to the bug you were tracking, fix the
  wrong code anyway. Many times the wrong code
  was related to or obscured the bug in a way you
  had not imagined.
Step Away From The
                Computer
•   The longer you try to track down a bug without success, the less
    perspective you tend to have. Realize when you have lost the
    perspective on your code to debug.

•   Take a break. Get some sleep. You cannot debug when you are not
    seeing things clearly.

•   Many times a programmer can spend hours late at night hunting for a
    bug only to finally give up at 4:00A.M. The next day, they find the bug
    in 10 minutes. What allowed them to find the bug the next day so
    quickly? Maybe they just needed some sleep and time for perspective.
    Or maybe their subconscious figured it out while they were asleep.

•   In any case, the ―go do something else for a while, come back, and
    find the bug immediately scenario happens too often to be an accident.

More Related Content

What's hot

Brain Sketching
Brain SketchingBrain Sketching
Brain Sketching
Rob Keefer
 
Start Learning Efficiently Now - Lean & Agile DC 2017
Start Learning Efficiently Now - Lean & Agile DC 2017Start Learning Efficiently Now - Lean & Agile DC 2017
Start Learning Efficiently Now - Lean & Agile DC 2017
Elliot Susel
 
How To Run a 5 Whys (With Humans, Not Robots)
How To Run a 5 Whys (With Humans, Not Robots)How To Run a 5 Whys (With Humans, Not Robots)
How To Run a 5 Whys (With Humans, Not Robots)
Dan Milstein
 
Jason Yee - Chaos! - Codemotion Rome 2019
Jason Yee - Chaos! - Codemotion Rome 2019Jason Yee - Chaos! - Codemotion Rome 2019
Jason Yee - Chaos! - Codemotion Rome 2019
Codemotion
 
Effectively Manage your Time
Effectively Manage your Time Effectively Manage your Time
Effectively Manage your Time
Aziah Thompson
 
5 Essential Tips For Improving Your Website Mockups & Prototypes!
5 Essential Tips For Improving Your Website Mockups & Prototypes!5 Essential Tips For Improving Your Website Mockups & Prototypes!
5 Essential Tips For Improving Your Website Mockups & Prototypes!
Usersnap
 
Agile mindset
Agile mindsetAgile mindset
Agile mindset
Dhanuka Senaratne
 
Creative louisiana
Creative louisianaCreative louisiana
Creative louisianaBrian Dixon
 
Alexa, what's next?
Alexa, what's next?Alexa, what's next?
Alexa, what's next?
Ralf Eggert
 
Production is a bitch
Production is a bitchProduction is a bitch
Production is a bitch
John Barton
 
On The Herding of Cats
On The Herding of CatsOn The Herding of Cats
On The Herding of Cats
eby
 
Code4Lib 2007: Hurry up please, it's time
Code4Lib 2007: Hurry up please, it's timeCode4Lib 2007: Hurry up please, it's time
Code4Lib 2007: Hurry up please, it's time
eby
 
7 ways you are doing your A/B testing wrong by Côme Courteault
7 ways you are doing your A/B testing wrong by Côme Courteault7 ways you are doing your A/B testing wrong by Côme Courteault
7 ways you are doing your A/B testing wrong by Côme Courteault
TheFamily
 
Applying SRE techniques to micro service design
Applying SRE techniques to micro service designApplying SRE techniques to micro service design
Applying SRE techniques to micro service design
Theo Schlossnagle
 
Testing Lessons Learned from Monty Python
Testing Lessons Learned from Monty PythonTesting Lessons Learned from Monty Python
Testing Lessons Learned from Monty Python
TechWell
 
Ellie
Ellie Ellie
Ellie
Marq2014
 
SANS OUCH Newsletter April 2016
SANS OUCH Newsletter April 2016SANS OUCH Newsletter April 2016
SANS OUCH Newsletter April 2016
Gene Ferro
 
Tips & Tricks: Working from Home and Staying Productive
Tips & Tricks: Working from Home and Staying ProductiveTips & Tricks: Working from Home and Staying Productive
Tips & Tricks: Working from Home and Staying Productive
Will Strohl
 
Crisis Communications - How to Manage a Crisis with Proper PR and Social Media
Crisis Communications - How to Manage a Crisis with Proper PR and Social MediaCrisis Communications - How to Manage a Crisis with Proper PR and Social Media
Crisis Communications - How to Manage a Crisis with Proper PR and Social Media
Integrate
 

What's hot (20)

Brain Sketching
Brain SketchingBrain Sketching
Brain Sketching
 
Ticket101
Ticket101Ticket101
Ticket101
 
Start Learning Efficiently Now - Lean & Agile DC 2017
Start Learning Efficiently Now - Lean & Agile DC 2017Start Learning Efficiently Now - Lean & Agile DC 2017
Start Learning Efficiently Now - Lean & Agile DC 2017
 
How To Run a 5 Whys (With Humans, Not Robots)
How To Run a 5 Whys (With Humans, Not Robots)How To Run a 5 Whys (With Humans, Not Robots)
How To Run a 5 Whys (With Humans, Not Robots)
 
Jason Yee - Chaos! - Codemotion Rome 2019
Jason Yee - Chaos! - Codemotion Rome 2019Jason Yee - Chaos! - Codemotion Rome 2019
Jason Yee - Chaos! - Codemotion Rome 2019
 
Effectively Manage your Time
Effectively Manage your Time Effectively Manage your Time
Effectively Manage your Time
 
5 Essential Tips For Improving Your Website Mockups & Prototypes!
5 Essential Tips For Improving Your Website Mockups & Prototypes!5 Essential Tips For Improving Your Website Mockups & Prototypes!
5 Essential Tips For Improving Your Website Mockups & Prototypes!
 
Agile mindset
Agile mindsetAgile mindset
Agile mindset
 
Creative louisiana
Creative louisianaCreative louisiana
Creative louisiana
 
Alexa, what's next?
Alexa, what's next?Alexa, what's next?
Alexa, what's next?
 
Production is a bitch
Production is a bitchProduction is a bitch
Production is a bitch
 
On The Herding of Cats
On The Herding of CatsOn The Herding of Cats
On The Herding of Cats
 
Code4Lib 2007: Hurry up please, it's time
Code4Lib 2007: Hurry up please, it's timeCode4Lib 2007: Hurry up please, it's time
Code4Lib 2007: Hurry up please, it's time
 
7 ways you are doing your A/B testing wrong by Côme Courteault
7 ways you are doing your A/B testing wrong by Côme Courteault7 ways you are doing your A/B testing wrong by Côme Courteault
7 ways you are doing your A/B testing wrong by Côme Courteault
 
Applying SRE techniques to micro service design
Applying SRE techniques to micro service designApplying SRE techniques to micro service design
Applying SRE techniques to micro service design
 
Testing Lessons Learned from Monty Python
Testing Lessons Learned from Monty PythonTesting Lessons Learned from Monty Python
Testing Lessons Learned from Monty Python
 
Ellie
Ellie Ellie
Ellie
 
SANS OUCH Newsletter April 2016
SANS OUCH Newsletter April 2016SANS OUCH Newsletter April 2016
SANS OUCH Newsletter April 2016
 
Tips & Tricks: Working from Home and Staying Productive
Tips & Tricks: Working from Home and Staying ProductiveTips & Tricks: Working from Home and Staying Productive
Tips & Tricks: Working from Home and Staying Productive
 
Crisis Communications - How to Manage a Crisis with Proper PR and Social Media
Crisis Communications - How to Manage a Crisis with Proper PR and Social MediaCrisis Communications - How to Manage a Crisis with Proper PR and Social Media
Crisis Communications - How to Manage a Crisis with Proper PR and Social Media
 

Viewers also liked

Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
Natasha Murashev
 
Amali memasang enjin
Amali memasang enjinAmali memasang enjin
Amali memasang enjin
Kizizikachi Izzat
 
Rmcl Business Plan
Rmcl Business PlanRmcl Business Plan
Rmcl Business Plan
yosho1
 
15 05-2012 - apresentação ceo conference - itau (em inglês)
15 05-2012 - apresentação ceo conference - itau (em inglês)15 05-2012 - apresentação ceo conference - itau (em inglês)
15 05-2012 - apresentação ceo conference - itau (em inglês)Arezzori
 
Hipertensi¢n arterial
Hipertensi¢n arterialHipertensi¢n arterial
Hipertensi¢n arterial
Rikardo Rojas
 
Getting Started with Open Source
Getting Started with Open SourceGetting Started with Open Source
Getting Started with Open Source
Natasha Murashev
 
Physician ratings sites & doctors reputations
Physician ratings sites & doctors reputationsPhysician ratings sites & doctors reputations
Physician ratings sites & doctors reputations
Healthcare Marketing Center of Excellence
 
MarketFX Overivew
MarketFX OverivewMarketFX Overivew
MarketFX Overivew
Jose Lazares
 
Guia cuatro luz
Guia cuatro luzGuia cuatro luz
Guia cuatro luzLuzParraP
 
Traditional chinese clothing
Traditional chinese clothingTraditional chinese clothing
Traditional chinese clothing
omaricollins167
 
Posonous plants
Posonous plantsPosonous plants
Posonous plants
Mika Agcaoili
 
5 tips for negotiating your offer of admission
5 tips for negotiating your offer of admission5 tips for negotiating your offer of admission
5 tips for negotiating your offer of admission
Amerasia Consulting Group
 
новомученики
новомученикиновомученики
новомученикиAlina Levchenko
 
Proyect magazine
Proyect magazineProyect magazine
Proyect magazine
Karin Rojas
 
Let them eat McCake
Let them eat McCakeLet them eat McCake
Let them eat McCake
Ben Esget
 
Way To Use Autel Maxiscan JP701 Scanner | VtoolShop
Way To Use Autel Maxiscan JP701 Scanner | VtoolShopWay To Use Autel Maxiscan JP701 Scanner | VtoolShop
Way To Use Autel Maxiscan JP701 Scanner | VtoolShop
Amy joe
 

Viewers also liked (19)

Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 
Amali memasang enjin
Amali memasang enjinAmali memasang enjin
Amali memasang enjin
 
Sistem enjin
Sistem enjinSistem enjin
Sistem enjin
 
Rmcl Business Plan
Rmcl Business PlanRmcl Business Plan
Rmcl Business Plan
 
15 05-2012 - apresentação ceo conference - itau (em inglês)
15 05-2012 - apresentação ceo conference - itau (em inglês)15 05-2012 - apresentação ceo conference - itau (em inglês)
15 05-2012 - apresentação ceo conference - itau (em inglês)
 
Hippa privacy
Hippa privacyHippa privacy
Hippa privacy
 
Hipertensi¢n arterial
Hipertensi¢n arterialHipertensi¢n arterial
Hipertensi¢n arterial
 
Getting Started with Open Source
Getting Started with Open SourceGetting Started with Open Source
Getting Started with Open Source
 
Physician ratings sites & doctors reputations
Physician ratings sites & doctors reputationsPhysician ratings sites & doctors reputations
Physician ratings sites & doctors reputations
 
MarketFX Overivew
MarketFX OverivewMarketFX Overivew
MarketFX Overivew
 
Guia cuatro luz
Guia cuatro luzGuia cuatro luz
Guia cuatro luz
 
Traditional chinese clothing
Traditional chinese clothingTraditional chinese clothing
Traditional chinese clothing
 
Posonous plants
Posonous plantsPosonous plants
Posonous plants
 
5 tips for negotiating your offer of admission
5 tips for negotiating your offer of admission5 tips for negotiating your offer of admission
5 tips for negotiating your offer of admission
 
новомученики
новомученикиновомученики
новомученики
 
Proyect magazine
Proyect magazineProyect magazine
Proyect magazine
 
Let them eat McCake
Let them eat McCakeLet them eat McCake
Let them eat McCake
 
Bbb
BbbBbb
Bbb
 
Way To Use Autel Maxiscan JP701 Scanner | VtoolShop
Way To Use Autel Maxiscan JP701 Scanner | VtoolShopWay To Use Autel Maxiscan JP701 Scanner | VtoolShop
Way To Use Autel Maxiscan JP701 Scanner | VtoolShop
 

Similar to Debugging

11 rules for programmer should live by
11 rules for programmer should live by11 rules for programmer should live by
11 rules for programmer should live by
Ye Win
 
Notes on Debugging
Notes on DebuggingNotes on Debugging
Notes on Debugging
Cotap Engineering
 
Visual Testing: It's Not What You Look At, It's What You See
Visual Testing: It's Not What You Look At, It's What You SeeVisual Testing: It's Not What You Look At, It's What You See
Visual Testing: It's Not What You Look At, It's What You See
Mike Lyles
 
Performance testing mistakes newbies make
Performance testing mistakes newbies makePerformance testing mistakes newbies make
Performance testing mistakes newbies make
Confiz Limited
 
2011 Feb25 Lewis Ieee Time Mgt
2011 Feb25 Lewis Ieee Time Mgt2011 Feb25 Lewis Ieee Time Mgt
2011 Feb25 Lewis Ieee Time Mgt
awadelewis
 
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
COMAQA.BY
 
Supercharging your bug reports
Supercharging your bug reportsSupercharging your bug reports
Supercharging your bug reports
Neil Studd
 
10 Reasons Why You Fix Bugs As Soon As You Find Them
10 Reasons Why You Fix Bugs As Soon As You Find Them10 Reasons Why You Fix Bugs As Soon As You Find Them
10 Reasons Why You Fix Bugs As Soon As You Find ThemRosie Sherry
 
Michael Bolton - Heuristics: Solving Problems Rapidly
Michael Bolton - Heuristics: Solving Problems RapidlyMichael Bolton - Heuristics: Solving Problems Rapidly
Michael Bolton - Heuristics: Solving Problems Rapidly
TEST Huddle
 
DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...
DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...
DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...
DevOpsDays Tel Aviv
 
Surviving a Crisis of Confidence
Surviving a Crisis of ConfidenceSurviving a Crisis of Confidence
Surviving a Crisis of Confidence
Nathan Ingram
 
Shipping - Principles Worth Pondering
Shipping - Principles Worth PonderingShipping - Principles Worth Pondering
Shipping - Principles Worth Pondering
Howie Chang
 
Think epic be epic
Think epic be epicThink epic be epic
Think epic be epic
Human Capital Media
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
Amir Assad
 
Technology-Based Reference Interview Workshop
Technology-Based Reference Interview WorkshopTechnology-Based Reference Interview Workshop
Technology-Based Reference Interview Workshopbibliotecaria
 
How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013
How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013
How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013
Dan Milstein
 
Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?
Danny van Kasteel
 
Research Traps: 7 ways of thinking that keep you from doing great customer re...
Research Traps: 7 ways of thinking that keep you from doing great customer re...Research Traps: 7 ways of thinking that keep you from doing great customer re...
Research Traps: 7 ways of thinking that keep you from doing great customer re...
Wendy Castleman
 
All you need know about testing
All you need know about testingAll you need know about testing
All you need know about testing
Jorge Barroso
 

Similar to Debugging (20)

11 rules for programmer should live by
11 rules for programmer should live by11 rules for programmer should live by
11 rules for programmer should live by
 
Notes on Debugging
Notes on DebuggingNotes on Debugging
Notes on Debugging
 
Visual Testing: It's Not What You Look At, It's What You See
Visual Testing: It's Not What You Look At, It's What You SeeVisual Testing: It's Not What You Look At, It's What You See
Visual Testing: It's Not What You Look At, It's What You See
 
Performance testing mistakes newbies make
Performance testing mistakes newbies makePerformance testing mistakes newbies make
Performance testing mistakes newbies make
 
2011 Feb25 Lewis Ieee Time Mgt
2011 Feb25 Lewis Ieee Time Mgt2011 Feb25 Lewis Ieee Time Mgt
2011 Feb25 Lewis Ieee Time Mgt
 
Improved ch05 remember this nicole alunan
Improved ch05 remember this   nicole alunanImproved ch05 remember this   nicole alunan
Improved ch05 remember this nicole alunan
 
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
 
Supercharging your bug reports
Supercharging your bug reportsSupercharging your bug reports
Supercharging your bug reports
 
10 Reasons Why You Fix Bugs As Soon As You Find Them
10 Reasons Why You Fix Bugs As Soon As You Find Them10 Reasons Why You Fix Bugs As Soon As You Find Them
10 Reasons Why You Fix Bugs As Soon As You Find Them
 
Michael Bolton - Heuristics: Solving Problems Rapidly
Michael Bolton - Heuristics: Solving Problems RapidlyMichael Bolton - Heuristics: Solving Problems Rapidly
Michael Bolton - Heuristics: Solving Problems Rapidly
 
DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...
DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...
DevOps Days Tel Aviv 2013: The DevOps field guide to cognitive biases - Linds...
 
Surviving a Crisis of Confidence
Surviving a Crisis of ConfidenceSurviving a Crisis of Confidence
Surviving a Crisis of Confidence
 
Shipping - Principles Worth Pondering
Shipping - Principles Worth PonderingShipping - Principles Worth Pondering
Shipping - Principles Worth Pondering
 
Think epic be epic
Think epic be epicThink epic be epic
Think epic be epic
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
 
Technology-Based Reference Interview Workshop
Technology-Based Reference Interview WorkshopTechnology-Based Reference Interview Workshop
Technology-Based Reference Interview Workshop
 
How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013
How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013
How to Run a Post-Mortem (With Humans, Not Robots), Velocity 2013
 
Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?
 
Research Traps: 7 ways of thinking that keep you from doing great customer re...
Research Traps: 7 ways of thinking that keep you from doing great customer re...Research Traps: 7 ways of thinking that keep you from doing great customer re...
Research Traps: 7 ways of thinking that keep you from doing great customer re...
 
All you need know about testing
All you need know about testingAll you need know about testing
All you need know about testing
 

More from Natasha Murashev

Digital Nomad: The New Normal
Digital Nomad: The New NormalDigital Nomad: The New Normal
Digital Nomad: The New Normal
Natasha Murashev
 
Swift Delhi: Practical POP
Swift Delhi: Practical POPSwift Delhi: Practical POP
Swift Delhi: Practical POP
Natasha Murashev
 
Build Features Not Apps
Build Features Not AppsBuild Features Not Apps
Build Features Not Apps
Natasha Murashev
 
Build Features Not Apps
Build Features Not AppsBuild Features Not Apps
Build Features Not Apps
Natasha Murashev
 
Practical Protocols with Associated Types
Practical Protocols with Associated TypesPractical Protocols with Associated Types
Practical Protocols with Associated Types
Natasha Murashev
 
The Secret Life of a Digital Nomad
The Secret Life of a Digital NomadThe Secret Life of a Digital Nomad
The Secret Life of a Digital Nomad
Natasha Murashev
 
How to Win on the Apple Watch
How to Win on the Apple WatchHow to Win on the Apple Watch
How to Win on the Apple Watch
Natasha Murashev
 
Hello watchOS2
Hello watchOS2 Hello watchOS2
Hello watchOS2
Natasha Murashev
 
Practical Protocol-Oriented-Programming
Practical Protocol-Oriented-ProgrammingPractical Protocol-Oriented-Programming
Practical Protocol-Oriented-Programming
Natasha Murashev
 
Protocol Oriented MVVM - Auckland iOS Meetup
Protocol Oriented MVVM - Auckland iOS MeetupProtocol Oriented MVVM - Auckland iOS Meetup
Protocol Oriented MVVM - Auckland iOS Meetup
Natasha Murashev
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
Natasha Murashev
 
Protocol-Oriented MVVM
Protocol-Oriented MVVMProtocol-Oriented MVVM
Protocol-Oriented MVVM
Natasha Murashev
 
The Swift Architect
The Swift ArchitectThe Swift Architect
The Swift Architect
Natasha Murashev
 
The Zen Guide to WatchOS 2
The Zen Guide to WatchOS 2The Zen Guide to WatchOS 2
The Zen Guide to WatchOS 2
Natasha Murashev
 
HealthKit Deep Dive
HealthKit Deep DiveHealthKit Deep Dive
HealthKit Deep Dive
Natasha Murashev
 
Using Parse in Hackathons
Using Parse in HackathonsUsing Parse in Hackathons
Using Parse in Hackathons
Natasha Murashev
 
Hello, WatchKit
Hello, WatchKitHello, WatchKit
Hello, WatchKit
Natasha Murashev
 
Hello, WatchKit
Hello, WatchKitHello, WatchKit
Hello, WatchKit
Natasha Murashev
 
Unleash the Power of Playgrounds
Unleash the Power of PlaygroundsUnleash the Power of Playgrounds
Unleash the Power of Playgrounds
Natasha Murashev
 
Hello, WatchKit
Hello, WatchKitHello, WatchKit
Hello, WatchKit
Natasha Murashev
 

More from Natasha Murashev (20)

Digital Nomad: The New Normal
Digital Nomad: The New NormalDigital Nomad: The New Normal
Digital Nomad: The New Normal
 
Swift Delhi: Practical POP
Swift Delhi: Practical POPSwift Delhi: Practical POP
Swift Delhi: Practical POP
 
Build Features Not Apps
Build Features Not AppsBuild Features Not Apps
Build Features Not Apps
 
Build Features Not Apps
Build Features Not AppsBuild Features Not Apps
Build Features Not Apps
 
Practical Protocols with Associated Types
Practical Protocols with Associated TypesPractical Protocols with Associated Types
Practical Protocols with Associated Types
 
The Secret Life of a Digital Nomad
The Secret Life of a Digital NomadThe Secret Life of a Digital Nomad
The Secret Life of a Digital Nomad
 
How to Win on the Apple Watch
How to Win on the Apple WatchHow to Win on the Apple Watch
How to Win on the Apple Watch
 
Hello watchOS2
Hello watchOS2 Hello watchOS2
Hello watchOS2
 
Practical Protocol-Oriented-Programming
Practical Protocol-Oriented-ProgrammingPractical Protocol-Oriented-Programming
Practical Protocol-Oriented-Programming
 
Protocol Oriented MVVM - Auckland iOS Meetup
Protocol Oriented MVVM - Auckland iOS MeetupProtocol Oriented MVVM - Auckland iOS Meetup
Protocol Oriented MVVM - Auckland iOS Meetup
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
 
Protocol-Oriented MVVM
Protocol-Oriented MVVMProtocol-Oriented MVVM
Protocol-Oriented MVVM
 
The Swift Architect
The Swift ArchitectThe Swift Architect
The Swift Architect
 
The Zen Guide to WatchOS 2
The Zen Guide to WatchOS 2The Zen Guide to WatchOS 2
The Zen Guide to WatchOS 2
 
HealthKit Deep Dive
HealthKit Deep DiveHealthKit Deep Dive
HealthKit Deep Dive
 
Using Parse in Hackathons
Using Parse in HackathonsUsing Parse in Hackathons
Using Parse in Hackathons
 
Hello, WatchKit
Hello, WatchKitHello, WatchKit
Hello, WatchKit
 
Hello, WatchKit
Hello, WatchKitHello, WatchKit
Hello, WatchKit
 
Unleash the Power of Playgrounds
Unleash the Power of PlaygroundsUnleash the Power of Playgrounds
Unleash the Power of Playgrounds
 
Hello, WatchKit
Hello, WatchKitHello, WatchKit
Hello, WatchKit
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

Debugging

  • 2. Source • This presentation is adapted from this handout from Stanford’s CS106A course.
  • 3. Don’t Panic • Be systematic and persistent. Don’t panic. The bug is not moving around in your code, trying to trick or evade you. It is just sitting in one place, doing the wrong thing in the same way every time.
  • 4. Test As You Go • If you code was working a minute ago, but now it doesn’t—what was the last thing you changed? • This incredibly reliable rule of thumb is the reason you should test your code as you go rather than all at once.
  • 5. Don’t Trust Yourself • Be critical of your beliefs about your code. It’s almost impossible to see a bug in a function when your instinct is that the function is innocent. • Only when the facts have proven without question that the function is not the source of the problem should you assume it to be correct.
  • 6. Trust The Facts • Intuition and hunches are great—you just have to test them out. • When a hunch and a fact collide, the fact wins.
  • 7. Let Your Intuition Guide You • Although you need to be systematic, there is still an enormous amount of room for beliefs, hunches, guesses, etc. • Use your intuition about where the bug probably is to direct the order that you check things in your systematic search. Check the functions you suspect the most first. • Good instincts will come with experience.
  • 8. It’s Usually The Simple Things • Don’t look for complex explanations. Even the simplest omission or typo can lead to very weird behavior. Everyone is capable producing extremely simple and obvious errors from time to time. • Look at code critically—don’t just sweep your eye over that series of simple statements assuming that they are too simple to be wrong.
  • 9. Facts, Facts, Facts • The clue to what is wrong in your code is in the values of your variables and the flow of control. • Try to see what the facts are pointing to. The computer is not trying to mislead you. Work from the facts.
  • 10. Change Only One Thing At A Time • Do not change your code haphazardly trying to track down a bug. This is sort of like a scientist who changes more than one variable in an experiment at a time. • It makes the observed behavior much more difficult to interpret, and you tend to introduce new bugs.
  • 11. If You Find Something Wrong, Fix It • If you find some wrong code that does not seem to be related to the bug you were tracking, fix the wrong code anyway. Many times the wrong code was related to or obscured the bug in a way you had not imagined.
  • 12. Step Away From The Computer • The longer you try to track down a bug without success, the less perspective you tend to have. Realize when you have lost the perspective on your code to debug. • Take a break. Get some sleep. You cannot debug when you are not seeing things clearly. • Many times a programmer can spend hours late at night hunting for a bug only to finally give up at 4:00A.M. The next day, they find the bug in 10 minutes. What allowed them to find the bug the next day so quickly? Maybe they just needed some sleep and time for perspective. Or maybe their subconscious figured it out while they were asleep. • In any case, the ―go do something else for a while, come back, and find the bug immediately scenario happens too often to be an accident.