views:

582

answers:

4

I am a hacker not and not a full-time programmer but am looking to start my own full application development experiment. I apologize if I am missing something easy here. I am looking for recommendations for books, articles, sites, etc for learning more about test driven development specifically compatible with or aimed at Python web application programming. I understand that Python has built-in tools to assist. What would be the best way to learn about these outside of RTFM? I have searched on StackOverflow and found the Kent Beck's and David Astels book on the subject. I have also bookmarked the Wikipedia article as it has many of these types of resources.

Are there any particular ones you would recommend for this language/application?

+2  A: 

I know that Kent Beck's book (which you mentioned) covers TDD in Python to some pretty good depth. If I remember correctly, the last half of the book takes you through development of a unit test framework in Python. There's nothing specific to web development, though, which is a problem in many TDD resources that I've read. It's a best practice to keep your business logic separate from your presentation in order to make your BL more testable, among other reasons.

Another good book that you might want to look into is xUnit Test Patterns. It doesn't use Python, but it does talk a lot about designing for testability, how to use mocks and stubs (which you'll need for testing web applications), and automating testing. It's more advanced than Beck's book, which makes it a good follow-up.

Bill the Lizard
+2  A: 

I'd recommend "xUnit Test Patterns: Refactoring Test Code" by Gerard Meszaros. It is not Python or Web specific, but it's a good book on TDD in general and the xUnit framework in particular. Since python unittest is actually an xUnit implementation ("a Python version of JUnit", as the docs say), I'd say that the book is very useful for Python unit testers.

It has an online version at xunitpatterns.com.

Rafał Dowgird
+6  A: 

I wrote a series of blogs on TDD in Django that covers some TDD with the nose testing framework.

There are a lot of free online resources out there for learning about TDD:

For testing web applications, test first or otherwise, I'd recommend twill and selenium as tools to use.

Ryan
+1 for twill, didn't know it yet
jellybean
A: 

A very good unit test framework is also trial from the twisted project.

brubelsabs