Resources for TDD aimed at Python Web Development [closed]

偶尔善良 提交于 2019-12-02 14:57:55

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.

Can I plug my own tutorial, which covers the materials from the official Django tutorial, but uses full TDD all the way - including "proper" functional/acceptance tests using the Selenium browser-automation tool... http://tdd-django-tutorial.com

[update 2014-01] I now have a book, just about to be published by OReilly, that covers all the stuff from the tutorial and much more. The full thing is available online (free) at http://www.obeythetestinggoat.com

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.

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.

user1629366

Here is a great series of article written on test driven development in python. It starts from basic and goes to a point, where you are taught stuffs as designing for maintainability etc. I am sure you would like it.

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

A little late to the game with this one, but I have been hunting for a Python oriented TDD book, and I just found Python Testing: Beginner's Guide by Daniel Arbuckle. Haven't had a chance to read it yet, but when I do, I'll try to remember to post a follow up here. The reviews on the Amazon page look pretty positive though.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!