Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Dark Art of Debugging

The Dark Art of Debugging

A talk about developing the soft-skills required to be a good software debugger.

eojthebrave

May 22, 2015
Tweet

More Decks by eojthebrave

Other Decks in Technology

Transcript

  1. The Dark Art of Debugging
    php[tek] 2015 - Chicago
    Joe (@eojthebrave) Shindelar
    https://joind.in/event/view
    /3183

    View full-size slide

  2. Hi. I’m Joe Shindelar
    @eojthebrave

    View full-size slide

  3. 5 Minutes - GO!
    + Bugs are inevitable
    + Debugging is a science
    + Replicate, Isolate,
    Understand, Fix
    + Practice …

    View full-size slide

  4. So … where do bugs
    come from?

    View full-size slide

  5. Software: Is a set of written
    instructions provided for a computer
    to interpret and use to accomplish a
    task.

    View full-size slide

  6. Software: Is a set of written
    instructions provided for a computer
    to interpret and use to accomplish a
    task.
    Bugs: Are the defects that arise
    when those instructions are
    incorrectly translated.

    View full-size slide

  7. “There’s a space between zero and
    one, between the way the machine
    counts and thinks and the way we
    count and think. When you search
    for explanations for software’s
    bugs and delays and stubborn
    resistance to human desires, that
    space is where you’ll find them.”
    - Scott Rosenberg -Dreaming In Code

    View full-size slide

  8. The ONLY way to be a
    zero bug programmer is
    to not write any code.

    View full-size slide

  9. Debugging is a
    practical application
    of both technical skills
    and analytical abilities

    View full-size slide

  10. This presentation is not
    about tools. But tools
    play an important roll in
    debugging. Learn your
    tools. Use your tools.

    View full-size slide

  11. + Replicate
    + Isolate
    + Understand
    + Fix

    View full-size slide

  12. Ready? Fire! Aim.
    Give yourself 10 minutes
    to jump in and dirty-
    debug. But STOP before
    you go crazy.

    View full-size slide

  13. STEP ONE
    Replicate the problem

    View full-size slide

  14. It is a capital mistake to theorize
    before one has data. Insensibly
    one begins to twist facts to suit
    theories, instead of theories to
    suit facts.
    - Sherlock Holmes Quote -A Scandal in Bohemia

    View full-size slide

  15. Replicate
    + Keep a log

    View full-size slide

  16. Replicate
    + Keep a log
    + Get it to fail

    View full-size slide

  17. Replicate
    + Keep a log
    + Get it to fail
    + Lay a trap

    View full-size slide

  18. Replicate
    + Keep a log
    + Get it to fail
    + Lay a trap
    + Stimulate. Don’t simulate

    View full-size slide

  19. Replicate
    + Keep a log
    + Get it to fail
    + Lay a trap
    + Stimulate. Don’t simulate
    + Automate the failure

    View full-size slide

  20. Goal: Generate a list of steps

    View full-size slide

  21. STEP TWO
    Isolate the problem

    View full-size slide

  22. There is nothing more deceptive
    than an obvious fact.
    - Sherlock Holmes Quote
    - The Bascombe Valley Mystery

    View full-size slide

  23. Isolate
    + Avoid easter egging

    View full-size slide

  24. Isolate
    + Avoid easter egging
    + Check the plug

    View full-size slide

  25. Isolate
    + Avoid easter egging
    + Check the plug
    + Divide & conquer

    View full-size slide

  26. Isolate
    + Avoid easter egging
    + Check the plug
    + Divide & conquer
    + Change one thing at time

    View full-size slide

  27. Isolate
    + Avoid easter egging
    + Check the plug
    + Divide & conquer
    + Change one thing at time
    + Stop thinking and look

    View full-size slide

  28. Goal: Explain what is causing the
    problem to occur. Include details
    about application state, time, and
    inputs.

    View full-size slide

  29. STEP THREE
    Understand the problem

    View full-size slide

  30. Nothing clears up a case so much
    as stating it to another person.
    - Sherlock Holmes Quote
    - Silver Blaze

    View full-size slide

  31. Understand
    + Brain games

    View full-size slide

  32. Avoid confirmation bias
    Beware the availability heuristic

    View full-size slide

  33. Understand
    + Brain games
    + Don’t assume anything. Ever

    View full-size slide

  34. Understand
    + Brain games
    + Don’t assume anything. Ever
    + Practice tempered humility

    View full-size slide

  35. Understand
    + Brain games
    + Don’t assume anything. Ever
    + Practice tempered humility
    + Read the manual

    View full-size slide

  36. “Why bother, I can look it up in
    the Phone book.”
    - Einstein

    View full-size slide

  37. Understand
    + Brain games
    + Don’t assume anything. Ever
    + Practice tempered humility
    + Read the manual
    + Ask for help

    View full-size slide

  38. Goal: Explain the root cause, and
    how your proposed fix will solve
    the problem.

    View full-size slide

  39. STEP FOUR
    Fix the problem

    View full-size slide

  40. Eliminate all other factors, and
    the one which remains must be
    the truth.
    - Sherlock Holmes Quote
    - The Sign of Four

    View full-size slide

  41. Fix
    + Don’t stop until you’re done

    View full-size slide

  42. Fix
    + Don’t stop until you’re done
    + Establish causality

    View full-size slide

  43. Fix
    + Don’t stop until you’re done
    + Establish causality
    + Test your fix

    View full-size slide

  44. Goal: Close the ticket!

    View full-size slide

  45. + Replicate
    + Isolate
    + Understand
    + Fix

    View full-size slide

  46. “The greats weren't great
    because at birth they could
    paint. The greats were great
    cause they paint a lot.”
    - Macklemore

    View full-size slide

  47. The Dark Art of Debugging
    php[tek] 2015 - Chicago
    Joe (@eojthebrave) Shindelar
    https://joind.in/event/view
    /3183

    View full-size slide