The Dark Art of Debugging
Don't assume anything. Being able to replicate, isolate, and fix bugs in software requires methodical logic, creative problem solving, curiosity and a never ending quest for understanding. The ability to do so is what sets great developers apart. No one writes perfect code, and bugs are an inevitable part of the software development process. But they can also be extremely elusive, 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 bugs in software and its stubborn resistance to human desires, that space is where you’ll find them.
It's relatively easy these days to start a new debugging session, connect to your IDE of choice, and start stepping through your code. Figuring out where, why, and how applications fail however requires far more than just being able to examine a variable or a call-stack.
I'll share the process and techniques that have helped me to improve my debugging skills over the last decade working as a PHP application developer. At a very high level that process is as follows:
- Replicate the problem
- Isolate the problem
- Understand the problem
- Fix the problem
This session is about the soft skills of debugging, and while I will talk a little bit about some of the tools available for debugging PHP applications like xdebug, xhprof, and the venerable var_dump(), this talk focuses primarily on problem solving techniques and not specific tools. I'll talk about creating a plan of attack before diving blindly into your debugger. Using techniques like divide and conquer to isolate a problem within a larger application, and methodical dissection of problematic points.
This session is appropriate for PHP developers of any level. It will help people who are newer to the process learn how to apply problem solving skills to software debugging. For experienced developers it will help to formalize a process that you're probably already doing, though may not fully grok.