SlideShare a Scribd company logo
Code
Forensics
Diego Pacheco
@diego_pacheco
❏ Cat's Father
❏ Head of Software Architecture
❏ Agile Coach
❏ SOA/Microservices Expert
❏ DevOps Practitioner
❏ Speaker
❏ Author
diegopacheco
http://diego-pacheco.blogspot.com.br/
About me...
https://diegopacheco.github.io/tinyurl.com/diegopacheco
Things we will
talk about...
Things you should avoid.
DON'TS01
Science 101
How to run a investigation02
Observability, Debug Tricks,
Linux Tools...
Tools & Tricks03
Post Mortems, RCAs and
Retrospectives
Closing the Case04
Don'ts
Don't: FREAK OUT
❏ Avoid extra pressure on yourself
❏ Avoid worry about time.
❏ Avoid making comparisons like this
should be done in 1h or so.
❏ As time pass is easy to Freak Out
❏ Making progress is your friend, don't
nail it down only about solving the
mystery.
❏ Your eyes can trick you, use tools.
❏ Make sure you do things properly.
❏ Comparing Strings
❏ Read Errors Carefully.
❏ Don't forget to Breath
Don't: Do two many things at time.
❏ Don't change 2 things at the time.
❏ Code
❏ Vars / Config
❏ Trys
❏ One Hypotesy at the time
❏ Otherwise how do you know what
did what?
❏ You need to be:
❏ Methodical
❏ Boring
❏ Slow
How to Run a investigation
Science 101
Have Theories
Write Down Facts
Have a
Partner
(Pair Programing)
Minimize Investigation
Efforts
Science 101
Science 101: Do we have a smoking gun?
Minimize Investigation Efforts
4% of code == 72% of defects (Code as Crime Scene)
Have Theories
❏ It's a like a guessing game, how the murder happen?
❏ Think on most likely thing it could be.
❏ There are classical Offenders like:
❏ NPE Lack of validation/test
❏ Code Change
❏ Config Change
❏ Credentials Change
❏ Typo somewhere
❏ Lack of Security groups
❏ Not enough Resources (memory, space)
❏ OOM Killer
Write down Facts
❏ Write down (paper, txt file, evernote, google docs)
❏ Write Important fact like:
❏ Class Names, Methods, Variables
❏ Make sure you don't get lots.
❏ It's easy to forget important pieces of information
when you are worried and want to fix the issue fast.
Have a Partner (Pair Programing)
Have a Partner (Pair Programing)
Have a Partner (Pair Programing)
Tools & Tricks
❏ Observability
❏ Debug tricky's
❏ Linux Tools
❏ Write your own tools
Observability
—Filipe Fortes
"Debugging is like being the detective in a
crime movie where you are also the
murderer." -
Debug tricks
❏ Know your IDE.
❏ Remote Debugging.
❏ Debug tricks like:
❏ Conditionals
❏ Log Expressions
❏ Runtime eval
❏ Exception
Breakpoints
❏ Field Break points
Linux Tools
Write your own tools
❏ Help to nail down problems faster.
❏ Simple Utilitary.
❏ Program or scripts (Groovy, Python , Rust, Go).
❏ Quick diagnostics.
Could you compare with something else?
❏ It's very likely the issue is a code change, so maybe was working
before. Some digging is needed.
❏ Not always possible (i.g new feature)
❏ Use diff tools.
❏ Compare previous versions that worked.
❏ Run previous tests that worked.
❏ Debug and write down differences.
Closing the Case
Fix, Share & Improve
❏ Adding More Tests
❏ Post Mortems
❏ RCAs
❏ Retrospectives
Adding more Tests
❏ Boys Scout rules.
❏ Closing the Case means you found the issue.
❏ So we need to create test to simulate the issue.
❏ Having the test will proof we don't suffer again.
Closing the Case: Post Mortems
Closing the Case: RCA
❏ Similar to Post Mortems.
❏ Lean tool. Can be used with: 5 whys, fishbone and other
system thinking tools.
❏ Excel file:
❏ Issue
❏ classification
❏ Why it happen
❏ How we make sure it does not happen again
Closing the Case: Retrospectives
Good Investigation Books
Code
Forensics
Diego Pacheco

More Related Content

PDF
AWS IAM
PDF
Reflections on SCM
PDF
Architecture 101: Vision, Properties and Skills
PDF
Dealing with dependencies
PDF
PDF
Holacracy
PDF
Architecture & Engineering : Doing the non-obvious!
PDF
The Death of Microservices
AWS IAM
Reflections on SCM
Architecture 101: Vision, Properties and Skills
Dealing with dependencies
Holacracy
Architecture & Engineering : Doing the non-obvious!
The Death of Microservices

What's hot (17)

PDF
Design is not Subjective
PDF
Sec 101
PDF
Thoughts about Shape Up
PDF
Design 101
PDF
Lean 2020
PDF
Dealing with dependencies in tests
PDF
PDF
Seven ways to be a happier JavaScript developer - NDC Oslo
PDF
Lean/Agile/DevOps 2016 part 3
PDF
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
PDF
Sacrificing the golden calf of "coding"
PDF
You learned JavaScript - now what?
PPTX
2017 Facebook DevC SRS - JavaScript for beginners
PDF
Web dev presentation
PDF
Dynomite Eureka Registry With Prana
PDF
How and Why You Should Become a Kernel Hacker - FOSS.IN/2007
PDF
How to become a domain expert in no time?
Design is not Subjective
Sec 101
Thoughts about Shape Up
Design 101
Lean 2020
Dealing with dependencies in tests
Seven ways to be a happier JavaScript developer - NDC Oslo
Lean/Agile/DevOps 2016 part 3
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
Sacrificing the golden calf of "coding"
You learned JavaScript - now what?
2017 Facebook DevC SRS - JavaScript for beginners
Web dev presentation
Dynomite Eureka Registry With Prana
How and Why You Should Become a Kernel Hacker - FOSS.IN/2007
How to become a domain expert in no time?
Ad

Similar to Code Forensics (20)

PDF
TDD in Python With Pytest
PDF
Spaghetti gate
PPTX
Notes on Debugging
PDF
10 tips to save you time and frustration while programming
PDF
Become a Better Developer with Debugging Techniques for Drupal (and more!)
PDF
Software Design Notes
PDF
Pentester++
PPT
PHP - Introduction to PHP Bugs - Debugging
PPTX
Software Development Essential Skills
PDF
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
PDF
Services, tools & practices for a software house
PDF
Scottish Ruby Conference 2014
PPTX
"Introduction to Bug Hunting", Yasser Ali
PPTX
Preocupações Desenvolvedor Ágil
PDF
Bug Hunting Safari
PPTX
Writing clean scientific software Murphy cleancoding
PDF
Pigaios: A Tool for Diffing Source Codes against Binaries (Hacktivity 2018)
PDF
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
PPTX
Developing Better Software
PDF
The Fault In Our Code
TDD in Python With Pytest
Spaghetti gate
Notes on Debugging
10 tips to save you time and frustration while programming
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Software Design Notes
Pentester++
PHP - Introduction to PHP Bugs - Debugging
Software Development Essential Skills
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Services, tools & practices for a software house
Scottish Ruby Conference 2014
"Introduction to Bug Hunting", Yasser Ali
Preocupações Desenvolvedor Ágil
Bug Hunting Safari
Writing clean scientific software Murphy cleancoding
Pigaios: A Tool for Diffing Source Codes against Binaries (Hacktivity 2018)
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
Developing Better Software
The Fault In Our Code
Ad

More from Diego Pacheco (16)

PDF
Naming Things Book : Simple Book Review!
PDF
Continuous Discovery Habits Book Review.pdf
PDF
Encryption Deep Dive
PDF
Management: Doing the non-obvious! III
PDF
Management doing the non-obvious II
PDF
Testing in production
PDF
Nine lies about work
PDF
Management: doing the nonobvious!
PDF
AI and the Future
PDF
Kanban 2020
PDF
Hardening
PDF
Sidecars
PDF
SRE 101
PDF
Making sense of streaming
PDF
SOA.2020
PDF
Understand the system
Naming Things Book : Simple Book Review!
Continuous Discovery Habits Book Review.pdf
Encryption Deep Dive
Management: Doing the non-obvious! III
Management doing the non-obvious II
Testing in production
Nine lies about work
Management: doing the nonobvious!
AI and the Future
Kanban 2020
Hardening
Sidecars
SRE 101
Making sense of streaming
SOA.2020
Understand the system

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
20250228 LYD VKU AI Blended-Learning.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25 Week I
Reach Out and Touch Someone: Haptics and Empathic Computing
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Code Forensics

  • 2. @diego_pacheco ❏ Cat's Father ❏ Head of Software Architecture ❏ Agile Coach ❏ SOA/Microservices Expert ❏ DevOps Practitioner ❏ Speaker ❏ Author diegopacheco http://diego-pacheco.blogspot.com.br/ About me... https://diegopacheco.github.io/tinyurl.com/diegopacheco
  • 3. Things we will talk about... Things you should avoid. DON'TS01 Science 101 How to run a investigation02 Observability, Debug Tricks, Linux Tools... Tools & Tricks03 Post Mortems, RCAs and Retrospectives Closing the Case04
  • 5. Don't: FREAK OUT ❏ Avoid extra pressure on yourself ❏ Avoid worry about time. ❏ Avoid making comparisons like this should be done in 1h or so. ❏ As time pass is easy to Freak Out ❏ Making progress is your friend, don't nail it down only about solving the mystery. ❏ Your eyes can trick you, use tools. ❏ Make sure you do things properly. ❏ Comparing Strings ❏ Read Errors Carefully. ❏ Don't forget to Breath
  • 6. Don't: Do two many things at time. ❏ Don't change 2 things at the time. ❏ Code ❏ Vars / Config ❏ Trys ❏ One Hypotesy at the time ❏ Otherwise how do you know what did what? ❏ You need to be: ❏ Methodical ❏ Boring ❏ Slow
  • 7. How to Run a investigation Science 101 Have Theories Write Down Facts Have a Partner (Pair Programing) Minimize Investigation Efforts
  • 9. Science 101: Do we have a smoking gun?
  • 10. Minimize Investigation Efforts 4% of code == 72% of defects (Code as Crime Scene)
  • 11. Have Theories ❏ It's a like a guessing game, how the murder happen? ❏ Think on most likely thing it could be. ❏ There are classical Offenders like: ❏ NPE Lack of validation/test ❏ Code Change ❏ Config Change ❏ Credentials Change ❏ Typo somewhere ❏ Lack of Security groups ❏ Not enough Resources (memory, space) ❏ OOM Killer
  • 12. Write down Facts ❏ Write down (paper, txt file, evernote, google docs) ❏ Write Important fact like: ❏ Class Names, Methods, Variables ❏ Make sure you don't get lots. ❏ It's easy to forget important pieces of information when you are worried and want to fix the issue fast.
  • 13. Have a Partner (Pair Programing)
  • 14. Have a Partner (Pair Programing)
  • 15. Have a Partner (Pair Programing)
  • 16. Tools & Tricks ❏ Observability ❏ Debug tricky's ❏ Linux Tools ❏ Write your own tools
  • 18. —Filipe Fortes "Debugging is like being the detective in a crime movie where you are also the murderer." -
  • 19. Debug tricks ❏ Know your IDE. ❏ Remote Debugging. ❏ Debug tricks like: ❏ Conditionals ❏ Log Expressions ❏ Runtime eval ❏ Exception Breakpoints ❏ Field Break points
  • 21. Write your own tools ❏ Help to nail down problems faster. ❏ Simple Utilitary. ❏ Program or scripts (Groovy, Python , Rust, Go). ❏ Quick diagnostics.
  • 22. Could you compare with something else? ❏ It's very likely the issue is a code change, so maybe was working before. Some digging is needed. ❏ Not always possible (i.g new feature) ❏ Use diff tools. ❏ Compare previous versions that worked. ❏ Run previous tests that worked. ❏ Debug and write down differences.
  • 23. Closing the Case Fix, Share & Improve ❏ Adding More Tests ❏ Post Mortems ❏ RCAs ❏ Retrospectives
  • 24. Adding more Tests ❏ Boys Scout rules. ❏ Closing the Case means you found the issue. ❏ So we need to create test to simulate the issue. ❏ Having the test will proof we don't suffer again.
  • 25. Closing the Case: Post Mortems
  • 26. Closing the Case: RCA ❏ Similar to Post Mortems. ❏ Lean tool. Can be used with: 5 whys, fishbone and other system thinking tools. ❏ Excel file: ❏ Issue ❏ classification ❏ Why it happen ❏ How we make sure it does not happen again
  • 27. Closing the Case: Retrospectives