SlideShare a Scribd company logo
1 of 48
Download to read offline
ERRORS
How they live, eat and reproduce
Slides at https://bit.ly/gugu-talk-errors
ERRORS
How cognitive bias prevent you from using them
Slides at https://bit.ly/gugu-talk-errors
How I learned to program
What I wish I had been told
“Good judgement is the result of experience,
experience is the result of bad judgement.
Fred Brooks
Availability
heuristic
We expect things to work, ignoring
the usefulness of error
A biased prediction, due to the
tendency to focus on the most salient
and emotionally-charged outcome.
Gabriel, P. Richard: The Rise of Worse Is Better
Treat errors and logs the same
Assert, measure and don’t forget to learn!
Log messages have 10 parts
1. Messages
● Choose one:
○ What happened?
○ What didn’t happen?
○ What should be done?
● DDD (the shit out of) them:
○ Make usage of ubiquitous language
○ The same error should always
produce the same message (allowing
to group them)
Not easy to make them good,
impossible if you don’t start using
them
Day-to-day vocabulary
Error
Emergency, Alert, Critical or Error
A database drop, an update without
“where”, hardware failure, resource
stealing, an attack or an old lady
scraping metal to sell… shit happens.
When they happen, we usually have
contingency. But there is a limit to it,
so we act quickly on those - so they
don’t become defects.
2001. Lonvick, C.: The BSD syslog Protocol (IETF RFC 3164)
Defect
What customers should never face
We never want end-users seeing
errors.
We know them as bugs, but using a
more specific term for when end-users
are affected speeds communication
and resolution.
2008. Pryce, Nat: Throw Defect
Warning
Notice, Info and Debugs
Fixing bugs is also known as
debugging, logs aid on that.
Remember those `var_dump` calls?
Make them log messages and use the
severity based on the likelihood of
defects happening because of them.
2001. Lonvick, C.: The BSD syslog Protocol (IETF RFC 3164)
2. Contexts
● Important details:
○ When it happened?
○ Where it happened?
■ Application name
■ Environment
■ Hostname
○ Severity
○ Facility
● Details to aid debug:
○ User information
○ Stack trace
○ HTTP call being made
○ What file/line generated it?
○ Request ID
● Usually follow a filterable pattern
The devil is on the details
Is this message Good or Bad?
Database error
@augustohp not found
Missing DB_DSN environment variable
404: Page not found
Where can you find good error messages?
● Database error messages, care for how variable they are
● HTTP errors are few and precious, not a bingo
● PHP errors are very informative, care for variables as well
When to use variable messages?
Be mindful of who they are for
2002. Spolsky, Joel: The Law of Leaky Abstractions
Hardware
OS
I/O
Language
Framework
App
Abstraction level
2002. Spolsky, Joel: The Law of Leaky Abstractions
Hardware
OS
I/O
Language
Framework
App
Errors “leak” from lower
levels
If you aggregate every
message....
Cry wolf
You must never filter which error
is relevant
Anthropic bias is when evidence is
biased by “observation selection
effects”.
You don’t want to base your
assumptions over someone’s
observation.
2012. Bostrom, Nick: Anthropic Bias - Observation Selection Effects in Science and Philosophy
Alert over frequency
Monitorama EU 2013 - Lindsay Holmwood: Psychology of alert design
“Abstractions save us time working, not learning.
Joel Spolsky
The PHP cookbook for Errors
Dirty tricks for the day to day
2014. Pascutti, Augusto: Logs - O que eles comem, onde vivem e como se reproduzem
PHP Configuration
Development
You want to see every nasty error
; php.ini
display_errors = On
error_reporting = -1
log_errors = On
error_log = /var/log/php_error.log
Production
Make them sexy, and log them
; php.ini
display_errors = Off
error_reporting = -1
log_errors = On
error_log = /var/log/php_error.log
Chain exceptions
Create 2 base exceptions
2008. Pryce, Nat: Generic Throws
Exception ideas
2008. Pryce, Nat: Throw Defect
Exceptions are for
exceptional cases
C2 Wiki: Don’t use Exceptions For Flow Control
Use monolog (PSR-3)
Aggregate using Syslog
2001. Lonvick, C.: The BSD syslog Protocol (IETF RFC 3164)
“I would advise students to pay more attention to
the fundamental ideas rather than latest
technology.
The technology will be out-of-date before they
graduate.
Fundamental ideas never get out of date.
David Lorge Parnas
Conclusions
● Errors are not problems
● Treat them like logs
● Log eases debugging
Can I help you make more
mistakes?
Questions? Suggestions?! Beer time?
Credits
● Fonts in use are Ubuntu (Ubuntu) and Gentium Basic (Sil International)
● Theme is based on Solarized color-scheme by Ethan Schoonover

More Related Content

Similar to Errors

Arnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systemsArnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systemsBert Jan Schrijver
 
UX Sofia 2011 - Conrad Albrecht-Buehler
UX Sofia 2011 - Conrad Albrecht-BuehlerUX Sofia 2011 - Conrad Albrecht-Buehler
UX Sofia 2011 - Conrad Albrecht-BuehlerLucrat
 
Wikis in EFL: unrealised potential
Wikis in EFL: unrealised potentialWikis in EFL: unrealised potential
Wikis in EFL: unrealised potentialRick
 
Mastering Microservices 2022 - Debugging distributed systems
Mastering Microservices 2022 - Debugging distributed systemsMastering Microservices 2022 - Debugging distributed systems
Mastering Microservices 2022 - Debugging distributed systemsBert Jan Schrijver
 
Pragmatic programmer
Pragmatic programmerPragmatic programmer
Pragmatic programmerMaulik Shah
 
How to write bioinformatics software people will use and cite - t.seemann - ...
How to write bioinformatics software people will use and cite -  t.seemann - ...How to write bioinformatics software people will use and cite -  t.seemann - ...
How to write bioinformatics software people will use and cite - t.seemann - ...Torsten Seemann
 
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docxRyan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docxjeffsrosalyn
 
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docxRyan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docxrtodd599
 
The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012DefCamp
 
Software Entomology or Where Do Bugs Come From?
Software Entomology or Where Do Bugs Come From?Software Entomology or Where Do Bugs Come From?
Software Entomology or Where Do Bugs Come From?Noah Sussman
 
JoomlaExpo Presentation on Security by Tom Canavan
JoomlaExpo Presentation on Security by Tom CanavanJoomlaExpo Presentation on Security by Tom Canavan
JoomlaExpo Presentation on Security by Tom Canavanalledia
 
Basic information about computer
Basic information about computer Basic information about computer
Basic information about computer Mohammed39165
 
What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)Brian Brazil
 
Effective feedback design
Effective feedback designEffective feedback design
Effective feedback designHarshal Patil
 
Disaster And Business Continuity by Tom Canavan
Disaster And Business Continuity by Tom CanavanDisaster And Business Continuity by Tom Canavan
Disaster And Business Continuity by Tom CanavanJohn Coonen
 
Works For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug ReportsWorks For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug ReportsSALT Lab @ UBC
 
final presentation fake news detection.pptx
final presentation fake news detection.pptxfinal presentation fake news detection.pptx
final presentation fake news detection.pptxRudraSaraswat6
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCupbryanbibat
 
Myself Essay In German
Myself Essay In GermanMyself Essay In German
Myself Essay In GermanErin Byers
 

Similar to Errors (20)

Arnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systemsArnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systems
 
UX Sofia 2011 - Conrad Albrecht-Buehler
UX Sofia 2011 - Conrad Albrecht-BuehlerUX Sofia 2011 - Conrad Albrecht-Buehler
UX Sofia 2011 - Conrad Albrecht-Buehler
 
Wikis in EFL: unrealised potential
Wikis in EFL: unrealised potentialWikis in EFL: unrealised potential
Wikis in EFL: unrealised potential
 
Mastering Microservices 2022 - Debugging distributed systems
Mastering Microservices 2022 - Debugging distributed systemsMastering Microservices 2022 - Debugging distributed systems
Mastering Microservices 2022 - Debugging distributed systems
 
Pragmatic programmer
Pragmatic programmerPragmatic programmer
Pragmatic programmer
 
How to write bioinformatics software people will use and cite - t.seemann - ...
How to write bioinformatics software people will use and cite -  t.seemann - ...How to write bioinformatics software people will use and cite -  t.seemann - ...
How to write bioinformatics software people will use and cite - t.seemann - ...
 
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docxRyan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
 
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docxRyan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
Ryan ArcherTopic Panic AttacksSpecific Purpose To inform my.docx
 
The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012
 
Software Entomology or Where Do Bugs Come From?
Software Entomology or Where Do Bugs Come From?Software Entomology or Where Do Bugs Come From?
Software Entomology or Where Do Bugs Come From?
 
JoomlaExpo Presentation on Security by Tom Canavan
JoomlaExpo Presentation on Security by Tom CanavanJoomlaExpo Presentation on Security by Tom Canavan
JoomlaExpo Presentation on Security by Tom Canavan
 
Basic information about computer
Basic information about computer Basic information about computer
Basic information about computer
 
What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)
 
Effective feedback design
Effective feedback designEffective feedback design
Effective feedback design
 
Disaster And Business Continuity by Tom Canavan
Disaster And Business Continuity by Tom CanavanDisaster And Business Continuity by Tom Canavan
Disaster And Business Continuity by Tom Canavan
 
Scale2014
Scale2014Scale2014
Scale2014
 
Works For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug ReportsWorks For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug Reports
 
final presentation fake news detection.pptx
final presentation fake news detection.pptxfinal presentation fake news detection.pptx
final presentation fake news detection.pptx
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
 
Myself Essay In German
Myself Essay In GermanMyself Essay In German
Myself Essay In German
 

More from Augusto Pascutti

Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLsAugusto Pascutti
 
Logs: O que comem, onde vivem e como se reproduzem.
Logs: O que comem, onde vivem e como se reproduzem.Logs: O que comem, onde vivem e como se reproduzem.
Logs: O que comem, onde vivem e como se reproduzem.Augusto Pascutti
 
TDD - Test Driven Development (em PHP)
TDD - Test Driven Development (em PHP)TDD - Test Driven Development (em PHP)
TDD - Test Driven Development (em PHP)Augusto Pascutti
 
Guia do mochileiro para escalabilidade
Guia do mochileiro para escalabilidadeGuia do mochileiro para escalabilidade
Guia do mochileiro para escalabilidadeAugusto Pascutti
 
Falhando miseralvelmente com PHP
Falhando miseralvelmente com PHPFalhando miseralvelmente com PHP
Falhando miseralvelmente com PHPAugusto Pascutti
 
SfCon: Test Driven Development
SfCon: Test Driven DevelopmentSfCon: Test Driven Development
SfCon: Test Driven DevelopmentAugusto Pascutti
 
Como escalar aplicações PHP
Como escalar aplicações PHPComo escalar aplicações PHP
Como escalar aplicações PHPAugusto Pascutti
 
PHP - O que, porquê e como
PHP - O que, porquê e comoPHP - O que, porquê e como
PHP - O que, porquê e comoAugusto Pascutti
 
Testar é bom, integrar é ainda melhor
Testar é bom, integrar é ainda melhorTestar é bom, integrar é ainda melhor
Testar é bom, integrar é ainda melhorAugusto Pascutti
 
PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!
PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!
PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!Augusto Pascutti
 
Orientação a Objetos com PHP
Orientação a Objetos com PHPOrientação a Objetos com PHP
Orientação a Objetos com PHPAugusto Pascutti
 
Boas Práticas, Práticas !
Boas Práticas, Práticas !Boas Práticas, Práticas !
Boas Práticas, Práticas !Augusto Pascutti
 

More from Augusto Pascutti (20)

Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLs
 
Porque VIM?
Porque VIM?Porque VIM?
Porque VIM?
 
Logs: O que comem, onde vivem e como se reproduzem.
Logs: O que comem, onde vivem e como se reproduzem.Logs: O que comem, onde vivem e como se reproduzem.
Logs: O que comem, onde vivem e como se reproduzem.
 
TDD - Test Driven Development (em PHP)
TDD - Test Driven Development (em PHP)TDD - Test Driven Development (em PHP)
TDD - Test Driven Development (em PHP)
 
Guia do mochileiro para escalabilidade
Guia do mochileiro para escalabilidadeGuia do mochileiro para escalabilidade
Guia do mochileiro para escalabilidade
 
Falhando miseralvelmente com PHP
Falhando miseralvelmente com PHPFalhando miseralvelmente com PHP
Falhando miseralvelmente com PHP
 
SfCon: Test Driven Development
SfCon: Test Driven DevelopmentSfCon: Test Driven Development
SfCon: Test Driven Development
 
Orientação a objetos v2
Orientação a objetos v2Orientação a objetos v2
Orientação a objetos v2
 
Under engineer
Under engineerUnder engineer
Under engineer
 
Como escalar aplicações PHP
Como escalar aplicações PHPComo escalar aplicações PHP
Como escalar aplicações PHP
 
The small things
The small thingsThe small things
The small things
 
Somos jardineiros
Somos jardineirosSomos jardineiros
Somos jardineiros
 
PHP - O que, porquê e como
PHP - O que, porquê e comoPHP - O que, porquê e como
PHP - O que, porquê e como
 
Frameworks PHP
Frameworks PHPFrameworks PHP
Frameworks PHP
 
Testar é bom, integrar é ainda melhor
Testar é bom, integrar é ainda melhorTestar é bom, integrar é ainda melhor
Testar é bom, integrar é ainda melhor
 
PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!
PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!
PHPSC Conference 2010 - Testar é bom, integrar é melhor ainda!
 
Segurança em PHP
Segurança em PHPSegurança em PHP
Segurança em PHP
 
Orientação a Objetos com PHP
Orientação a Objetos com PHPOrientação a Objetos com PHP
Orientação a Objetos com PHP
 
Boas Práticas, Práticas !
Boas Práticas, Práticas !Boas Práticas, Práticas !
Boas Práticas, Práticas !
 
Mitos do PHP
Mitos do PHPMitos do PHP
Mitos do PHP
 

Recently uploaded

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 

Recently uploaded (20)

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 

Errors

  • 1. ERRORS How they live, eat and reproduce Slides at https://bit.ly/gugu-talk-errors
  • 2. ERRORS How cognitive bias prevent you from using them Slides at https://bit.ly/gugu-talk-errors
  • 3. How I learned to program
  • 4. What I wish I had been told
  • 5. “Good judgement is the result of experience, experience is the result of bad judgement. Fred Brooks
  • 6. Availability heuristic We expect things to work, ignoring the usefulness of error A biased prediction, due to the tendency to focus on the most salient and emotionally-charged outcome. Gabriel, P. Richard: The Rise of Worse Is Better
  • 7. Treat errors and logs the same Assert, measure and don’t forget to learn!
  • 8. Log messages have 10 parts
  • 9. 1. Messages ● Choose one: ○ What happened? ○ What didn’t happen? ○ What should be done? ● DDD (the shit out of) them: ○ Make usage of ubiquitous language ○ The same error should always produce the same message (allowing to group them) Not easy to make them good, impossible if you don’t start using them
  • 10.
  • 11.
  • 13. Error Emergency, Alert, Critical or Error A database drop, an update without “where”, hardware failure, resource stealing, an attack or an old lady scraping metal to sell… shit happens. When they happen, we usually have contingency. But there is a limit to it, so we act quickly on those - so they don’t become defects. 2001. Lonvick, C.: The BSD syslog Protocol (IETF RFC 3164)
  • 14. Defect What customers should never face We never want end-users seeing errors. We know them as bugs, but using a more specific term for when end-users are affected speeds communication and resolution. 2008. Pryce, Nat: Throw Defect
  • 15. Warning Notice, Info and Debugs Fixing bugs is also known as debugging, logs aid on that. Remember those `var_dump` calls? Make them log messages and use the severity based on the likelihood of defects happening because of them. 2001. Lonvick, C.: The BSD syslog Protocol (IETF RFC 3164)
  • 16. 2. Contexts ● Important details: ○ When it happened? ○ Where it happened? ■ Application name ■ Environment ■ Hostname ○ Severity ○ Facility ● Details to aid debug: ○ User information ○ Stack trace ○ HTTP call being made ○ What file/line generated it? ○ Request ID ● Usually follow a filterable pattern The devil is on the details
  • 17. Is this message Good or Bad?
  • 21. 404: Page not found
  • 22. Where can you find good error messages? ● Database error messages, care for how variable they are ● HTTP errors are few and precious, not a bingo ● PHP errors are very informative, care for variables as well
  • 23. When to use variable messages? Be mindful of who they are for
  • 24. 2002. Spolsky, Joel: The Law of Leaky Abstractions Hardware OS I/O Language Framework App Abstraction level
  • 25. 2002. Spolsky, Joel: The Law of Leaky Abstractions Hardware OS I/O Language Framework App Errors “leak” from lower levels
  • 26. If you aggregate every message....
  • 27. Cry wolf You must never filter which error is relevant Anthropic bias is when evidence is biased by “observation selection effects”. You don’t want to base your assumptions over someone’s observation. 2012. Bostrom, Nick: Anthropic Bias - Observation Selection Effects in Science and Philosophy
  • 28. Alert over frequency Monitorama EU 2013 - Lindsay Holmwood: Psychology of alert design
  • 29. “Abstractions save us time working, not learning. Joel Spolsky
  • 30. The PHP cookbook for Errors Dirty tricks for the day to day 2014. Pascutti, Augusto: Logs - O que eles comem, onde vivem e como se reproduzem
  • 32. Development You want to see every nasty error ; php.ini display_errors = On error_reporting = -1 log_errors = On error_log = /var/log/php_error.log
  • 33. Production Make them sexy, and log them ; php.ini display_errors = Off error_reporting = -1 log_errors = On error_log = /var/log/php_error.log
  • 35.
  • 36. Create 2 base exceptions
  • 37. 2008. Pryce, Nat: Generic Throws
  • 39. 2008. Pryce, Nat: Throw Defect
  • 40.
  • 41. Exceptions are for exceptional cases C2 Wiki: Don’t use Exceptions For Flow Control
  • 43. Aggregate using Syslog 2001. Lonvick, C.: The BSD syslog Protocol (IETF RFC 3164)
  • 44.
  • 45. “I would advise students to pay more attention to the fundamental ideas rather than latest technology. The technology will be out-of-date before they graduate. Fundamental ideas never get out of date. David Lorge Parnas
  • 46. Conclusions ● Errors are not problems ● Treat them like logs ● Log eases debugging
  • 47. Can I help you make more mistakes? Questions? Suggestions?! Beer time?
  • 48. Credits ● Fonts in use are Ubuntu (Ubuntu) and Gentium Basic (Sil International) ● Theme is based on Solarized color-scheme by Ethan Schoonover