8 of 8 people found the following review helpful:
5.0 out of 5 stars
Book Review: Debug It!, December 23, 2009
This review is from: Debug It!: Find, Repair, and Prevent Bugs in Your Code (Pragmatic Programmers) (Paperback)
Earlier this year, I had the opportunity to do a technical review of Paul Butcher's new book "Debug It!" and now that it's been published I'm pleased to be able to review the final product. A number of classic programming books, such as Steve Maguire's "Writing Solid Code" or Steve McConnell's "Code Complete", touch on debugging as one aspect of the software development process, but I'm not sure that I've ever seen or read an entire book devoted to the topic of debugging software. In that regard, Paul's new book fills a pretty interesting niche.
Paul breaks the debugging process up into four stages: reproduce, diagnose, fix and reflect. These stages are covered in detail in the first five chapters of the book, and this is the most important section. In the chapter on reproducing bugs, he touches on topics such as how to control the environmental conditions under which bugs manifests themselves, and techniques for reproducing the inputs that trigger the bugs. He also addresses some of the difficulties involved in dealing with especially difficult-to-reproduce nondeterministic bugs. In the chapter on diagnosis, Paul moves on to the process of forming a hypothesis about what's causing the bug and then performing experiments to refine that hypothesis until you settle in on a root cause. There are a lot of useful guidelines here, including my favorite: Only change one thing at a time! The chapter on fixing bugs is relatively short, which reflects the reality that once you understand what's going on it's usually not that difficult to fix the problem. Here the author stresses the importance of adding regression tests, and making sure that you're fixing the root cause and not merely the symptoms. The last step is to reflect on the significance of this bug and what it might be telling you about the overall quality of your code (e.g. are similar bugs lurking elsewhere in the code?)
The second section of the book ("The Bigger Picture") takes a higher-level look at the issues surrounding software bugs, namely, how do you create an environment such that you stay on top of bugs and not fall into an "infinite defects" situation. It addresses topics such as tracking bugs and working with users and the support staff to better understand the bugs they're seeing in production. The third section of the book ("Debug-Fu") is sort of a hodge-podge of more advanced topics, I suppose. Some of the information in these later chapters is arguably out of place in this book. For example, Chapter 9, "The Ideal Debugging Environment," stresses the importance of having automated tests, a continuous build system, and so forth. There's no question that this is good advice; I'm just not sure that it's completely on-topic for this book. Having said that, they are good disciplines for any programmer to have, and if the stuff in the rest of this book is new to you there's a good change that Paul's advice on testing and continuous builds is new to you too.
It is important to note that the focus of this book is the debugging mindset, and strategies and techniques that you'll use when debugging software. It does not teach you how to use any particular debugging tools. If you merely want to learn how to use the GNU debugger (gdb), or the graphical debugger in your IDE of choice, this is not the book for you.
In conclusion, I would highly recommend "Debug It!" to any junior-level programmer who's interested in developing a more disciplined approach to debugging. If you're not a junior-level programmer but still feel like you waste a lot of time debugging, you will probably find this book helpful as well. It's like having a mentor sitting there with you, teaching you how to take your debugging game to the next level.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
6 of 6 people found the following review helpful:
5.0 out of 5 stars
Excellent book, December 9, 2009
This review is from: Debug It!: Find, Repair, and Prevent Bugs in Your Code (Pragmatic Programmers) (Paperback)
Debug It! is now on my shelf beside classics like
The Pragmatic Programmer and Steve McConnell's
Code Complete.
While
Debug It! hews to its pragmatic nature, walking the reader through how to approach debugging in a consistent and logical manner, this book also covers how to design for testability (including TDD and code coverage) and how to make a number of tricky debugging scenarios more manageable.
In fact, I recently used a suggestion from the book to flush out a nasty threading bug we were having a hard time reproducing.
Highly recommended!
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
6 of 6 people found the following review helpful:
4.0 out of 5 stars
Much more than just debuggers, December 8, 2009
This review is from: Debug It!: Find, Repair, and Prevent Bugs in Your Code (Pragmatic Programmers) (Paperback)
Too many people think that debugging just means "using the debugger." Like any tool, debuggers can provide valuable information, but the ability to get into the experimental mindset is much more valuable. This book has its priorities in order. It lays down the foundation for the debugging process first, before getting into specific techniques and tools.
Newer developers will get the most out of this book, as it lays the groundwork for solid practices---like finding the minimal reproduction of a bug, or adding logging non-invasively.
Intermediate developers will be able to use the catalogue of techniques like an artist's palette. "Have I tried changing the timing to make this concurrency problem happen sooner? Have I tested this boundary condition?"
Experts will pick up a trick or two as well, such as automatic checking of exception-safety.
The book sprinkles rallying cries throughout: "One Change at a Time," "Suspect Your Own Code First," and so on. These will be useful as reminders even for readers who think they've been there, done that.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No