SlideShare a Scribd company logo
1 of 8
Download to read offline
THUNDER THURSDAY
INSIGHTS – 8
DEBUG EFFICIENTLY AND
EFFECTIVELY!
1
Even if you have fixed something, it is
done without having reproduced the
original bug and having no idea what
you have actually done. So, always find
the exact steps to reproduce the bug. If
you can’t reproduce it, find someone
who can!
Always Reproduce the Bug Before You Start
Changing Code
Never just see the description of a problem, immediately make
some random assumptions, proceed to make changes in the code
cause soon you will find it’s not fixed.
2 Understand Stack Traces
99% of time the stack trace will come
from a bad assumption in your OWN
code. Now it may not be that exact line
which has the bug, but you’ll need to
work backwards up through the code to
find where a bad argument was perhaps
passed in.
Therefore:
Always wrap exceptions thrown to you!
Not every bug will have a stack trace, but most of them
do. The key to remember is that the root cause, the
filthy culprit that broke your perfect day, is usually
wrapped up several layers deep.
So work from the bottom of the scary long stack trace upwards to find the
root cause!
3 Know Your Error Codes
404 - You might have the wrong url in your app
401 - Your credentials are likely wrong
418 - You’re talking to a teapot!
(seriously https://tools.ietf.org/html/rfc2324)
429 - You’re making too many requests
Given how fundamental HTTP is to pretty much every
app these days, knowing what the HTTP error code
means can be a huge help in diagnosing bugs!
If you get an HTTP error code, always Google it to make sure you
understand it. Again, it’ll save you a lot of time! The same goes for
Database drivers and other protocols. If you see an error code,
Google it with the name of the database and look for the official
docs.
4 Google! Bing! Duck! Duck! Go!
Whatever your search engine of choice is, you're sure to find a
helpful answer somewhere in the internet. Just gather up as
much information as possible before you hit "search" in the
search engine.
5 Pair Program Your Way Out of It
Bring in a colleague, a friend (or a
CodeMentor) and talk them through it.
Show them the bug and the code, tell
them everything that you’ve tried and
explain to them what you think the
problem is. You would be shocked to
find out how often just the simple fact
that you’re talking it through and having
If you find yourself spending more than 30 minutes
hacking away and not making any progress, stop
right there!
to explain it to someone else can suddenly help you see what the
issue really is. Other times, it might actually be a complex issue (like
a race condition) and having a second set of eyes can help pick up
edge cases and scenario’s you have not even considered.
6 Celebrate Your Fix!
Whether you turned a test
from red to green or closed
out a ticket on your queue,
give yourself a solid high-
five. You've just saved the
day and deserve all the
credit coming your way on
this one.
DEBUG IT!

More Related Content

Similar to THUNDER THURSDAY INSIGHTS - DEBUG EFFICIENTLY

10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programmingHugo Shi
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014michaelag1971
 
Software engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceSoftware engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceAlexey (Mr_Mig) Migutsky
 
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
 
30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbookGabriel Paunescu 🤖
 
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdfBdBangladesh
 
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
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdodaniil3
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programmingAndre Leal
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloonsjgrahamc
 
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 byYe Win
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsSteven Smith
 
Computer basics from the techs
Computer basics from the techsComputer basics from the techs
Computer basics from the techsKaren Brooks
 
Lessons Learned About Software Development
Lessons Learned About Software DevelopmentLessons Learned About Software Development
Lessons Learned About Software DevelopmentJeffrey Ryan Thalhammer
 

Similar to THUNDER THURSDAY INSIGHTS - DEBUG EFFICIENTLY (20)

10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014
 
Software engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceSoftware engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least once
 
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
 
Debugging
DebuggingDebugging
Debugging
 
30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook
 
Introducing XP
Introducing XPIntroducing XP
Introducing XP
 
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
 
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?
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdo
 
Introduction toprogramming
Introduction toprogrammingIntroduction toprogramming
Introduction toprogramming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloons
 
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
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
Debugging
DebuggingDebugging
Debugging
 
TxJS 2011
TxJS 2011TxJS 2011
TxJS 2011
 
Win#23 it
Win#23 itWin#23 it
Win#23 it
 
Computer basics from the techs
Computer basics from the techsComputer basics from the techs
Computer basics from the techs
 
Lessons Learned About Software Development
Lessons Learned About Software DevelopmentLessons Learned About Software Development
Lessons Learned About Software Development
 

More from Satish AG

Terrific Thursday Visualization 101
Terrific Thursday Visualization 101Terrific Thursday Visualization 101
Terrific Thursday Visualization 101Satish AG
 
EduSparkz Thunder Thursday Concentrate Better
EduSparkz Thunder Thursday Concentrate BetterEduSparkz Thunder Thursday Concentrate Better
EduSparkz Thunder Thursday Concentrate BetterSatish AG
 
Edusparkz Thunder Thursday Googlepower
Edusparkz Thunder Thursday GooglepowerEdusparkz Thunder Thursday Googlepower
Edusparkz Thunder Thursday GooglepowerSatish AG
 
EduSparkz Thunder Thursday Email Etiquette
EduSparkz Thunder Thursday Email EtiquetteEduSparkz Thunder Thursday Email Etiquette
EduSparkz Thunder Thursday Email EtiquetteSatish AG
 
EduSparkz thunder thursday linkedin
EduSparkz thunder thursday linkedinEduSparkz thunder thursday linkedin
EduSparkz thunder thursday linkedinSatish AG
 
EduSparkz Thunder Thursday: Insights on Photoshop
EduSparkz Thunder Thursday: Insights on PhotoshopEduSparkz Thunder Thursday: Insights on Photoshop
EduSparkz Thunder Thursday: Insights on PhotoshopSatish AG
 
Swayam MOOC platform - Framework & Ideas
Swayam MOOC platform - Framework & IdeasSwayam MOOC platform - Framework & Ideas
Swayam MOOC platform - Framework & IdeasSatish AG
 

More from Satish AG (7)

Terrific Thursday Visualization 101
Terrific Thursday Visualization 101Terrific Thursday Visualization 101
Terrific Thursday Visualization 101
 
EduSparkz Thunder Thursday Concentrate Better
EduSparkz Thunder Thursday Concentrate BetterEduSparkz Thunder Thursday Concentrate Better
EduSparkz Thunder Thursday Concentrate Better
 
Edusparkz Thunder Thursday Googlepower
Edusparkz Thunder Thursday GooglepowerEdusparkz Thunder Thursday Googlepower
Edusparkz Thunder Thursday Googlepower
 
EduSparkz Thunder Thursday Email Etiquette
EduSparkz Thunder Thursday Email EtiquetteEduSparkz Thunder Thursday Email Etiquette
EduSparkz Thunder Thursday Email Etiquette
 
EduSparkz thunder thursday linkedin
EduSparkz thunder thursday linkedinEduSparkz thunder thursday linkedin
EduSparkz thunder thursday linkedin
 
EduSparkz Thunder Thursday: Insights on Photoshop
EduSparkz Thunder Thursday: Insights on PhotoshopEduSparkz Thunder Thursday: Insights on Photoshop
EduSparkz Thunder Thursday: Insights on Photoshop
 
Swayam MOOC platform - Framework & Ideas
Swayam MOOC platform - Framework & IdeasSwayam MOOC platform - Framework & Ideas
Swayam MOOC platform - Framework & Ideas
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

THUNDER THURSDAY INSIGHTS - DEBUG EFFICIENTLY

  • 1. THUNDER THURSDAY INSIGHTS – 8 DEBUG EFFICIENTLY AND EFFECTIVELY!
  • 2. 1 Even if you have fixed something, it is done without having reproduced the original bug and having no idea what you have actually done. So, always find the exact steps to reproduce the bug. If you can’t reproduce it, find someone who can! Always Reproduce the Bug Before You Start Changing Code Never just see the description of a problem, immediately make some random assumptions, proceed to make changes in the code cause soon you will find it’s not fixed.
  • 3. 2 Understand Stack Traces 99% of time the stack trace will come from a bad assumption in your OWN code. Now it may not be that exact line which has the bug, but you’ll need to work backwards up through the code to find where a bad argument was perhaps passed in. Therefore: Always wrap exceptions thrown to you! Not every bug will have a stack trace, but most of them do. The key to remember is that the root cause, the filthy culprit that broke your perfect day, is usually wrapped up several layers deep. So work from the bottom of the scary long stack trace upwards to find the root cause!
  • 4. 3 Know Your Error Codes 404 - You might have the wrong url in your app 401 - Your credentials are likely wrong 418 - You’re talking to a teapot! (seriously https://tools.ietf.org/html/rfc2324) 429 - You’re making too many requests Given how fundamental HTTP is to pretty much every app these days, knowing what the HTTP error code means can be a huge help in diagnosing bugs! If you get an HTTP error code, always Google it to make sure you understand it. Again, it’ll save you a lot of time! The same goes for Database drivers and other protocols. If you see an error code, Google it with the name of the database and look for the official docs.
  • 5. 4 Google! Bing! Duck! Duck! Go! Whatever your search engine of choice is, you're sure to find a helpful answer somewhere in the internet. Just gather up as much information as possible before you hit "search" in the search engine.
  • 6. 5 Pair Program Your Way Out of It Bring in a colleague, a friend (or a CodeMentor) and talk them through it. Show them the bug and the code, tell them everything that you’ve tried and explain to them what you think the problem is. You would be shocked to find out how often just the simple fact that you’re talking it through and having If you find yourself spending more than 30 minutes hacking away and not making any progress, stop right there! to explain it to someone else can suddenly help you see what the issue really is. Other times, it might actually be a complex issue (like a race condition) and having a second set of eyes can help pick up edge cases and scenario’s you have not even considered.
  • 7. 6 Celebrate Your Fix! Whether you turned a test from red to green or closed out a ticket on your queue, give yourself a solid high- five. You've just saved the day and deserve all the credit coming your way on this one.