Python Testing Cookbook and over 2 million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
Trade in Yours
For a £6.25 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
Start reading Python Testing Cookbook on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Python Testing Cookbook [Paperback]

Greg Lee Turnquist
4.3 out of 5 stars  See all reviews (3 customer reviews)
RRP: £27.99
Price: £27.15 & FREE Delivery in the UK. Details
You Save: £0.84 (3%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In stock.
Dispatched from and sold by Amazon. Gift-wrap available.
Want it tomorrow, 31 Aug.? Choose Express delivery at checkout. Details

Formats

Amazon Price New from Used from
Kindle Edition £17.50  
Paperback £27.15  
Trade In this Item for up to £6.25
Trade in Python Testing Cookbook for an Amazon Gift Card of up to £6.25, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Learn more

Book Description

17 May 2011 1849514666 978-1849514668
This cookbook is written as a collection of code recipes containing step-by-step directions on how to install or build different types of Python test tools to solve different problems. Each recipe contains explanations of how it works along with answers to common questions and cross references to other relevant recipes. The easy-to-understand recipe names make this a handy test reference book. Python developers and programmers with a basic understanding of Python and Python testing will find this cookbook beneficial. It will build on that basic knowledge equipping you with the intermediate and advanced skills required to fully utilize the Python testing tools. Broken up into lots of small code recipes, you can read this book at your own pace, whatever your experience. No prior experience of automated testing is required.

Frequently Bought Together

Python Testing Cookbook + Python Testing: Beginner's Guide
Price For Both: £52.14

Buy the selected items together

Customers Who Bought This Item Also Bought


Product details

  • Paperback: 364 pages
  • Publisher: Packt Publishing (17 May 2011)
  • Language: English
  • ISBN-10: 1849514666
  • ISBN-13: 978-1849514668
  • Product Dimensions: 23.5 x 19 x 1.9 cm
  • Average Customer Review: 4.3 out of 5 stars  See all reviews (3 customer reviews)
  • Amazon Bestsellers Rank: 598,655 in Books (See Top 100 in Books)

Product Description

About the Author

Greg L. Turnquist


Greg has worked since 1997 as a software engineer at Harris Corporation, always seeking the right tool for the job. Since 2002, Greg has been part of the senior software team working on Harris' $3.5 billion FAA telco program, architecting mission-critical enterprise apps while managing a software team. He provides after hours support and 2nd-level engineering to support the nation-wide telco network and is no stranger to midnight failures and software triage. In 2010, Greg joined the SpringSource division of VMware.


Being a test-bitten script junky, Greg has used JUnit, TestNG, JMock, FEST, PyUnit, and pMock testing frameworks, along with other agile practices to produce top-quality code.


He has worked with Java, Spring, Spring Security, AspectJ, and Jython technologies and also developed sophisticated scripts for *nix and Windows platforms. Being a wiki evangelist, he also deployed a LAMP-based wiki website to provide finger-tip knowledge to users.


In 2006, Greg created the Spring Python project. The Spring Framework provided many useful features, and he wanted those same features available when working with Python.


Greg completed a master's degree in Computer Engineering at Auburn University, and lives in the United States with his family.


Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

3 star
0
2 star
0
1 star
0
4.3 out of 5 stars
4.3 out of 5 stars
Most Helpful Customer Reviews
1 of 1 people found the following review helpful
4.0 out of 5 stars Good Overview, Nice for Reference 24 Jun 2011
Format:Paperback
Disclaimer: I received a digital review copy of this book from the publisher, Packt Publishing.

This was the first programming cookbook I've ever read. I was a bit skeptical about the concept but overall it worked out quite well. The book covers plenty of testing related subjects. The author is an expert and it shows in a good way.

I might have appreciated an introduction and a conclusion to tie things together better. I think the last chapter that discusses some of more general testing concepts makes up for the lack of proper conclusion, though.

The language used by the author is fluent and without errors. At least I could not spot any. Usually technical books contain quite a few of these.

I wasn't particularly fond of the screen captures in the book. The ones showing a terminal had pretty bad contrast due to black background and greenish text in the digital version. It would have been nicer to use black text on white background or just write terminal commands as regular text.

There were times when the code felt a bit duplicated. Perhaps it might have been nicer to stash some of it to appendices and just refer to that instead. This isn't a serious handicap, though.

It could have been nice to have more information about alternative tools and their relative strengths and weaknesses. Now some discussion felt a bit one dimensional this way.

I think the book will serve well as reference material. It's nice to have a broad range of Python testing related concepts discussed well in a single book.
Comment | 
Was this review helpful to you?
1 of 1 people found the following review helpful
Format:Paperback
The short version is: I'm not mad about the layout; it's not entirely what I expected from a Cookbook; but I think it does what it does very well.

Since I'm overall positive, I'll just pick up on the very slight negatives first. In a previous Packt review I commented (adversely) on the style of the layout and so on, and I'm afraid that it hasn't really changed. Obviously, this is somewhat subjective, but I can't be the only person who's subconsciously affected by the font and layout choice. (Bear in mind that I was reading it via PDF which may make a difference). To be clear: it's not awful; it's not even bad; it's just suboptimal.

The other slight negative is hardly a negative at all: that the "recipes" in this cookbook are far broader -- in some cases, chapter-length -- than I'd expected. Subjective expectation, to be sure. But I was a very little bit surprised.

Ok, that's the downsides. Now the upsides:

* Nice division of chapters
* The right pacing
* Pretty much one example used throughout
* "Why didn't you do this?" question sections
* Good re-use or alternative use of previous examples or approaches
* Interesting spread and combination of toolsets

The chapter divisions are: unittest, nose, doctest, BDD, UAT, CI, coverage, load-testing, good habits. In broad terms, each chapter builds on previous ones, but thanks to the reuse of the a simple shopping cart example, repeated in nearly every chapter, you can take a chapter on its own without too much difficulty. In addition, different chapters sometimes offer alternative approaches to the same problem when it makes sense to illustrate one point rather than another.
Read more ›
Comment | 
Was this review helpful to you?
5.0 out of 5 stars Must-read for all automation apprentices 28 Mar 2014
By Intel
Format:Paperback|Verified Purchase
Good, practical examples supported by extensive in-depth knowledge of testing process. The book is well written. Information in it is not cluttered and illegible, rather lightly presented and easy to ingest for every testing engineer and developer,
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 3.6 out of 5 stars  11 reviews
7 of 8 people found the following review helpful
3.0 out of 5 stars Good overview, but not well written 2 Aug 2011
By Yu Cheung Ho - Published on Amazon.com
Format:Paperback
This book is a very complete overview of all aspects of testing with Python. It starts out with simple unit tests, then moves on to nose, BDD, Doctest, acceptance testing, coverage, continuous integration, and smoke tests and load tests. The last chapter of the book gives you a number of advices for starting out with testing.

I enjoyed this book in that it gave me a birds-eye view of all the tools and techniques that are there for Python, many of which I didn't know about before. I also learn new things about things that I had already used before. Lastly, I liked the last chapter in which the author gives us his heart-felt experiences with testing. Although I don't agree with everything he says(running your tests once a day is way too few), there is a lot of good advice there as well as good stories.

One thing that I don't like about this book is that it's too code heavy. Pages and pages of code are print onto the page with only interleaving explanations. I mostly skimmed those parts because reading code line-by-line like that is just too boring. Code is simply not meant to be read in a linear fashion. When you read code, you jump between different files rapidly in order to fill the in missing context as you try to gain an understanding of the code. An even better aid in reading code is the ability to execute the code and instrument it with print statements or stop it with the debugger and inspect the program state. So, in summary, code-heavy books just doesn't make sense. Perhaps instead of writing this as a book, we should just point the readers at a code repository?

The second problem is that not enough was done to motivate each technique that was used. The author didn't properly motivate why one should write unit tests at all. Or why use a given technique listed in the book. Only cursory introduction is given for each technique or tool, and then it was straight to the code. We dwelled too much time on the how and not on the why, which makes this book very unfriendly to beginners.

Overall, I would not recommend this book to beginners or people who are looking for an introduction to testing. I am on the fence about recommending it at all, but it might be helpful for people who are already familiar with test driven development but just haven't been doing it with Python.
2 of 2 people found the following review helpful
4.0 out of 5 stars Good book, with many useful examples 31 July 2011
By Amazon Customer - Published on Amazon.com
Format:Paperback
Disclaimer: I received a digital review copy of this book from the publisher, Packt Publishing. The opinions expressed here are entirely my own.

I recently decided to read through Greg L. Turnquist's new book Python Testing Cookbook. The book promises to give "simple and effective recipes for testing Python code", starting with the most basic testing tool unittest and working into more complex tools like doctest, Nose and the BDD tool Lettuce. The book also touches on some additional topics like code coverage reports, acceptance testing, load testing and configuring tests to run under continuous integration.

I think the chapter I found the most interesting was Chapter 4, Testing Customer Stories with Behavior Driven Development. The chapter starts with a very quick introduction to BDD and progresses into first recipe, which shows how to perform some simple BDD style tests with a custom Nose plugin. The chapter then progresses into recipes for doctest, Nose's spec plugin and Lettuce. While the chapter is not going to turn someone into a master of BDD, it is a good introduction to the software that is available for Python developers and contains some good recipes for quickly getting started and utilizing BDD to test an application.

In addition to Chapter 4, I also enjoyed Chapters 6 and 7 quite a bit. Chapter 6 details a few different ways to integrate Python tests with the continuous integration platforms of Jenkins and TeamCity. These recipes include setting up both services to generate reports, run tests on commit and run tests on a scheduled interval. Chapter 7 is similar, but details how to use the coverage tool with a suite of unit tests. This chapter is made up of recipes which show how to install and run coverage, how to generate XML & HTML reports and how to integrate coverage with Nose and Jenkins.

As a whole I enjoyed the book and I thought that I was able to pick up some nice new pointers for testing my Python applications. As a recommendation for other readers, I would strongly suggest the book to new Python and Python TDD developers. For these developers, each chapter should provide new information and help to get the developer up-to-speed very quickly.

For someone that is already familiar with Python and Python TDD, I would suggest checking out the table of contents for the book. Each chapter is very helpful and provides a good introduction to the topics discussed in the chapter, however because the chapters are written as introductions, if you are already familiar with the topic for that chapter, its unlikely that you'll pick up much new from the chapter.

For new developer's I'll give the book 4 stars, for experienced developers I'll give the book 3 stars.
4 of 5 people found the following review helpful
4.0 out of 5 stars Nicely paced, well structured, slightly let down by forma 10 Jun 2011
By Tim Golden - Published on Amazon.com
Format:Paperback
(I was given a free electronic copy of this to review by the publisher)

The short version is: I'm not mad about the layout; it's not entirely what I expected from a Cookbook; but I think it does what it does very well.

Since I'm overall positive, I'll just pick up on the very slight negatives first. In a previous Packt review I commented (adversely) on the style of the layout and so on, and I'm afraid that it hasn't really changed. Obviously, this is somewhat subjective, but I can't be the only person who's subconsciously affected by the font and layout choice. (Bear in mind that I was reading it via PDF which may make a difference). To be clear: it's not awful; it's not even bad; it's just suboptimal.

The other slight negative is hardly a negative at all: that the "recipes" in this cookbook are far broader -- in some cases, chapter-length -- than I'd expected. Subjective expectation, to be sure. But I was a very little bit surprised.

Ok, that's the downsides. Now the upsides:

* Nice division of chapters
* The right pacing
* Pretty much one example used throughout
* "Why didn't you do this?" question sections
* Good re-use or alternative use of previous examples or approaches
* Interesting spread and combination of toolsets

The chapter divisions are: unittest, nose, doctest, BDD, UAT, CI, coverage, load-testing, good habits. In broad terms, each chapter builds on previous ones, but thanks to the reuse of the a simple shopping cart example, repeated in nearly every chapter, you can take a chapter on its own without too much difficulty. In addition, different chapters sometimes offer alternative approaches to the same problem when it makes sense to illustrate one point rather than another. One chapter, for example, walks you through creating a nose plugin to show how to do it; the next chapter introduces you to a ready-made one since the focus of that chapter is not nose plugins.

And that brings me to the variety of toolkits & modules mentioned throughout the text. This is not a book which simply uses stdlib code to perform various tasks (which I had rather thought it might be when I started). It introduces the ideas mentioned in the paragraph above. And puts forward Python modules (such as nose or mock) or external tools (such as Hudson / Jenkins or TeamCity) as best-of-breed or useful tools.

One final point which really put the icing on the cake is the occasional introduction of pull-out sections answering the very question which was occurring to me as a reader: "Why didn't you use this technique here?" or "How is this different from that?". Perhaps it's just me, but I find this smoothes my progress through a book considerably which otherwise would be (mentally) jarred by my wondering "Now why did he do that?".

I can't but recommend this book. There's a sample chapter here if you want to have sniff. As a final note, it's very slightly unfortunate that the timing of its production precluded the author from picking up on Michael Foord's magnificent work in producing unittest2 / unittest for 2.7 & 3.2. Perhaps there's a "missing chapter" opportunity in there for someone...
5.0 out of 5 stars Liked the examples filled book 24 Dec 2013
By rpv - Published on Amazon.com
Format:Kindle Edition
The book is filled with examples and use cases. The book also could become outdated pretty soon as it focuses a lot on libraries and its classes as it exists now. However, it takes a good stab at unit testing, acceptance testing and stress/performance sorts of testing. Testing is becoming an ever increasing requirements for large scale projects and Python is the best language to automate as of now. It is simple and easy. More and more companies are going to the route of Python for automating their software projects.

This book is a good motivator and can steer software engineers in a right direction. Obviously you need a Linux machine, some time and practice the examples in this book. Definitely recommend to get started!
4.0 out of 5 stars A Pretty Good Survey 7 Feb 2013
By Alejandro Cabrera - Published on Amazon.com
Format:Paperback
The "Python Testing Cookbook" does a reasonable job of surveying testing tools. It's a great match for new Python developers, and seasoned Python developers can also gain some insight into existing tools.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category


Feedback