be gone bug!
Benjamin Kampmann (@sirDonQui)
for Hackership (@hacker_ship)
Berlin, July 2015
the methodical process of finding and eliminating bugs (defects) in a software programme.
all debugging, which involves a human, interacting with the computer (or its output).
Mostly used to track down known bugs.
The process (after a bug was reported) usually goes as follows:
dry line-by-line execution of code in your head or on a piece of paper
L2: With items = ["a", "b", "a"]
L3: found = {}
L4: FOR: key = "a"
L5: key not in found -> skip to L7
L7: found= {"a": None}
L8: len(found) < 10 -> skip to L4
.....
(Read-Eval-Print-Loop)
`git bisect` to find the error
get inside your process
The base idea of an interactive debugger is to allow you to stop execution (using breakpoints) of your program at any time, jump into an interactive session and allow you to examine the state at that time and continue step by step to observe what is going on or resume execute.
in-browser Javascript debugging
import pdb; pdb.set_trace()
require 'pry'; binding.pry
debugger; node debug script.js