Two Sources of Bugs

  • State
  • Behavior

It's either in the data, or in the code

State

  • Class attributes
  • Input files
  • Method arguments

Revealing State

  • Print Statements
  • Conditional Statements
  • Logging
  • Debuggers

Forcing State

  • Unit Tests
  • Sample Inputs
  • Hard-coding with extreme caution

Behaviors

  • Call Stack
  • Debuggers
  • Print Statements
  • Loggers
  • Unit Tests
"/js/highlight.pack.js"