Read my book

I wrote books about Webpack and React. Check them out!

Friday, June 24, 2011

Book Review - Python Testing Cookbook

Disclaimer: I received a digital review copy of this book from the publisher, Packt Publishing.

It has been a while since I wrote a book review. The friendly folks at Packt just asked me to review Python Testing Cookbook a while ago so I thought why not! After all since I travel a lot using train these days I need something to read during the trips. iPad is great for this kind of stuff. :)

So how did I like the book? It's the first cookbook one I read. Essentially the idea seems to be that this kind of books discuss some common problems and show solutions to them. All in all very simple concept.

There's no doubt the author, Greg L. Turnquist, is a pro. The book is filled with amazing detail. I might have written some bits a little differently but overall there's plenty of good info in the book. If you are Python developer and test your code (good idea anyway :) ), you'll probably benefit from reading the book.

Cookbook as a Format

In a way it's nice to have a programming book written in this kind of format (example chapter from this book). I certainly appreciate the idea of having solutions laid out this way. I do have some kind of a nagging feeling that this might work out better as digital.

There were times when I felt that there's some unneeded duplication, esp. in code examples. Having some kind of cookbook wiki thingy might mitigate this problem. Perhaps appendices would work well in book form.

It's interesting the book doesn't contain a thorough introduction and conclusion. I would have appreciated a nice overview on the concepts discussed and how they connect to each other. This would have taken a few pages at tops and added some conceptual integrity to it.

I admit writing some kind of conclusion would have been tough in this case. Still it would have been nice to have something to highlight the main ideas. The last chapter does highlight some higher level ideas, though, so props for that.

Good Bits

As I mentioned at the introduction, the book contains plenty of useful information. For me especially the parts discussing continuous integration seemed cool. I also loved the insights hidden here and there. The author has some serious experience and it shows. :)

The language used is fluent and without errors. I did not manage to find a single typo which I kind of surprising. Usually technical books contain at least some amount of these. I'm guessing the editors did their part well this time.

I'll definitely be referring to this book later. It's one those keepers. The book isn't without its faults, though.

Nasty Bits

If there's one thing I really don't dig a lot, it's the way terminal screens have been captured. I'm guessing this is just an oversight on the author's part. Now the captures have green text on black background. That's far from optimal. I would have appreciated white on black or pure text instead of captures. Note that I read the digital version (PDF) so this might not be an issue in the print.

There were times when I felt there was simply too much duplication of code. I guess some of that could have been avoided with some careful restructuring (move part to appendices etc.). This was more of an annoyance, though. Nothing that serious.

It would have been handy to have some other tools mentioned. Now you get to know some specific tool doing some specific thing well. It's good to be aware of alternatives and their relative strengths and weaknesses. Another great candidate for an appendix.


If you are a Python developer and want to learn something about testing, this is probably a good book to have. I think even seasoned developers have something to learn from the book. Depending on your experience some parts might seem a bit trivial. It's still cool to have all this information stashed in one book.