Friday, April 13, 2012

Pragmatic Debug IT - Book Review

I went through this book because I was interested to learn something more about debugging, not as a simple research of a bug, but as a set of methodologies and pragmatic tips that can help to write robust, clear and self-explaining software. The book is splitted into two main topics, the former is a microscopic journey through four step the author has identified as the principal operations to be executed when facing a bug; the latter is a macroscopic vision of the whole system and the author provides tips and especially tools to deal with the debugging process inside a company.

The first 5 chapter belongs to the microscopic description.
The first chapter is an introduction of the empirical approach used to remove a bug. This chapter introduces the reader to the main step of debugging:
  • Reproduce
  • Diagnose
  • Fix
  • Reflect
The other four chapter deals with each of this steps. The "Reproduce" chapter explains that reproduce a bug is the most important and sometimes difficult step to do during debugging and provides a series of suggestions as logging or control the inputs.
The "Diagnose" chapter explain what happen next the reproduction. In this phase, the programmer must define hypothesis and experiments to find the real cause of the problem. The experiments he/she conducts are aimed to verify or not his/her hypothesis. Typically the experiments:
  • Tries to examine the internal state of the software  (as example using a debugger)
  • Modify the environment the software runs in (input files, OS. variables)
  • Change the logic of the code and see the effect.
The "Fix" chapter helps to understand better the implication of your changes in the code and how to avoid regression. Finally, the "Reflect" chapter describes how the knowledge acquired fixing a bug can be shared with the others and make think about other possible errors.

The next 2 chapters gives a whole vision of bug management inside a software company. Topics of this chapters are how a company should manage bugs and bug reports,how give priorities to the bugs such as none of them is left behind before continue the development, how to deal with the customers and so on.

The last 3 chapters that completes the book gives some useful tips to how avoid bugs or simply make it easy find them. Chapter 8 explains special cases where the normal empirical approach can't be used rigorously. Chapter 9  instead explains how Automatic Testing, Automatic Builds, Source Control, Continuos integration system and so on can be a blessing for debugging. The last chapter close the book explaining ways of how our code can be "prepared" to be debugged in a more easy way and how our software can give us useful information without effort.

I found this book very helpful and even if doesn't teach you to found a bug in 2 seconds It gives you a method to debug your software more efficiently and make the software debug itself. Also provides some clues about set of tools that can be used for the process. The "experiences" paragraphs through the book helps to understand better how to apply the tips of the book and also clarified which are the errors I used to do while debugging.

No comments:

Post a Comment