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

How To Fix Bugs

How To Fix Bugs

A talk for new programmers. My attempt to tell you all the stuff that will seem like common sense to you in two years.

This presentation is not very useful without the full text, which you can read at https://gist.github.com/jorendorff/8008765 .

Jason Orendorff

December 16, 2013
Tweet

More Decks by Jason Orendorff

Other Decks in Programming

Transcript

  1. View Slide

  2. How To Fix Bugs
    Jason Orendorff ~ @jorendorff

    View Slide

  3. What not to do
    ~ Feel discouraged
    ~ Smush the code around
    until it goes away
    ~ Fix it without
    understanding

    View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. What not to do
    ~ Feel discouraged
    ~ Smush the code around
    until it goes away
    ~ Fix it without understanding

    View Slide

  13. View Slide

  14. View Slide

  15. How to fix bugs
    ~ Get steps to reproduce
    ~ Make a test case
    ~ Get more information

    View Slide

  16. How to investigate
    ~ Learn to read a stack trace
    ~ Dump the data
    ~ Tie off loose ends
    ~ Work backwards
    ~ Learn the tools

    View Slide

  17. Writing debuggable code
    ~ Check in the test
    ~ Look everywhere for the same mistake
    ~ Write debug methods
    ~ Write assertions
    ~ Make it obviously correct

    View Slide

  18. good hunting

    View Slide