The Testing Goat

Obey the Testing Goat!

TDD for the Web, with Python, Selenium, Django, JavaScript and pals...

The Book

"Test-Driven Web Development with Python" aims to teach TDD for web programming. It uses a concrete example -- the development of a website, from scratch -- to explain the TDD metholology and how it applies to building web applications. It covers the Selenium browser-automation tool, unit testing, mocking, and interacting with Web technologies from the basics of static content, database integration, throught the inescapable JavaScript, and onto more advanced (and trendy) topics like NoSQL, websockets and Async programming.

Reading it

There are lots of ways you can read this book:

Obviously these are my favourite options! O'Reilly have been great, they deserve your support, and although I only get a small amount in royalties (about a dollar per sale if you're curious), it still pays for the occasional dinner out every month which I appreciate. Plus, real physical books are nice...

TIP: I don't recommend you use Google Play Books, or at least not their PDF version, it's horrible

Or read it here for free

Help yourself! It's all free and CC-licenced (thanks O'Reilly!). I see this as a "try-before-you-buy" scheme, and I hope that if you enjoy it you'll buy a copy -- if not for yourself, then perhaps for a friend!

Table of contents follows:


Part 1: The Basics of TDD and Django

Part 2: Web Development Sine Qua Nons

Part 3: More Advanced Topics

Epilogue and appendices:

How to comment

I feel incredibly lucky to be writing this book, and have the standard amounts of impostor syndrome. I've only actually been doing TDD for a couple of years, and I've only been a professional programmer for about 3 years. But I feel I've learned a lot, and I enjoy sharing the knowledge.

The O'Reilly site allows you to submit "errata", and the Chimera site has a comments function. Do use those for typos, errors etc. If you'd like to have a more philosophical discussion, you can get in touch with me directly via

You can even leave comments right here. The important thing is, get in touch! I look forward to hearing from you.


comments powered by Disqus
Read the book

The book is available both for free and for money. It's all about TDD and Web programming. Read it here!

Reviews & Testimonials

"Hands down the best teaching book I've ever read""Even the first 4 chapters were worth the money""Oh my gosh! This book is outstanding""The testing goat is my new friend"Read more...


A selection of links and videos about TDD, not necessarily all mine, eg this tutorial at PyCon 2013, how to motivate coworkers to write unit tests, thoughts on Django's test tools, London-style TDD and more.

Old TDD / Django Tutorial

This is my old TDD tutorial, which follows along with the official Django tutorial, but with full TDD. It badly needs updating. Read the book instead!

Save the Testing Goat Campaign

The campaign page, preserved for history, which led to the glorious presence of the Testing Goat on the front of the book.