This book takes on the problem of software errors by examining the kinds of mistakes developers typically make. The key to writing bug-free code is to become more aware of how and why bugs come about. Programmers can gain this awareness by asking two simple questions for every bug they encounter: "How could I have prevented this bug?" and "How could I have automatically detected this bug?" The guidelines presented in this book are the results of programmers regularly asking these questions over a number of years.