Fifty exercises to help you find bugs faster—with less aggravation! Bug hunting is an art, and you need to be a master. Get "Find the Bug," and you'll become one. Long-time Microsoft programmer Adam Barr presents fifty programs, each with exactly one bug. Your assignment: find it. As you do, Barr will teach you how to "think like your processor"...anticipating exactly how code will behave, even without running it. You'll learn better ways to read code, understand it--and above all, improve it. Whether you're building new systems or maintaining someone else's, you'll find bugs earlier, faster, with less frustration...and write cleaner code to begin with. Presents "bugged" programs in C, Java, Python, Perl, and x86 assembly language, with carefully explained solutions.
Includes language overviews to help you debug all fifty examples, even if you don't know the language.
Shows how to look past the "surface" of code to uncover its hidden internal logic.
Offers practical guidance on analyzing programs, including specific inputs to test.
Presents a wide range of realistic bugs, with no phony "gotchas."
Draws on the types of coding and debugging challenges Microsoft uses to interview new programmers.
This book is an indispensable resource for working programmers, maintainers, testers, quality specialists, and everyone involved in code reviews.
Review By: Mike Cohn 12/01/2005
If you don't see enough bugs at work, "Find the Bug" by Adam Barr does a good job of presenting different types of bugs nestled into many short programs. The reader's job is to find each bug. The main part of the book is organized into five chapters, each covering a different programming language: C, Python, Java, Perl, and x86 assembly language.
The sample programs in the book are well constructed. If you can't find the bug, the author provides hints. The author clearly understands each of the languages he includes. Short introductions were written for each language so it's possible to pick up the basics before looking for the bugs. Still, the bug hunting exercises in the examples I read were consistently good examples. Each exercise concludes with a discussion.
The book seems most relevant to programmers or perhaps to testers doing white box testing. It is ideal for those trying to improve code inspection skills or are beginning an inspection discipline. "Find the Bug" could even be fun to work through as a group. In that case, I prefer exercises that don't include the answers.
The author did a good job of selecting a variety of bugs that one may encounter in the field. Because of the diverse examples, I categorize this book as a strategy book. If you enjoy strategy-type books, you will almost certainly enjoy Barr's "Find the Bug."
Review By: Sunil S. Prasad 12/01/2005
In "Find the Bug," author Adam Barr wisely instructs readers to "find the bug before the bug finds you." Unfortunately, we all tend to deviate from the software development process to meet project deadlines and budgets. "Find the Bug" is for anyone in the software profession--those responsible for ID/assess, analysis, requirements, design, coding, or testing—as well as anyone who uses the software. It encourages readers to look at algorithms and understand the logic before coding.
The book is full of practical examples of good and bad code, which the reader can incorporate into his daily software world. It begins with a theoretical definition of bug classification. Most of us are able to find bugs but not always able to assign the bugs to proper categories. This leaves the categorization to the development team’s mercy and leads to a loss of control of defects management.
Barr methodically explains the process of technically looking at defects (walk-through code) and covers several code languages, giving a brief description of each at the beginning of each chapter. This book is not intended to replace in-depth books on any of these topics, but rather the author pools all your reference material together and reminds you of things you may have forgotten. He also provides clear definitions of the topics presented.
I finished this book having gained a clearer understanding of QA as a whole. The author provides an excellent overview for anyone who has studied some elements, such as C, Perl, and Java, and wants to better understand how to generate the same kind of application and expose hidden defects in the code.
I recommend this interesting and inspirational book to everyone in the software world. In fact, I urge everyone to read it. It's time to demand better and more secure software.