Flaskr: Intro to Flask, Test-Driven Development, and jQuery
github.com
github.com
Asking QA to write unit tests falls into the category of busywork with extra overhead which a sure recipe of not being agile.
You could ask them to write functional tests but not any lower than that.
I do not do TDD but I always make sure my commits should have unit tests whenever possible because I do not commit without testing them first :)
You TDD because the code you write with it is code that is easily tested. If you write the tests after you write the code, then you'll have to refactor the code just to get it to the point where its testable without digging really deep into your classes. It will be painful, and the effort will be abandoned.
I thought I wrote good, clean code. Then I started unit testing. Now I wouldn't think of writing code first. The procedural mess that my brain comes up with inevitably results in hard to refactor, hard to test spaghetti.
/shamelessplug
On that note, can anyone refer to me some helpful texts on this matter (designing larger Flask applications), beyond the official docs and Miguel Grinberg's tutorial?
The best way to explain test driven development is through examples, and I think this tutorial does it wonderfully.
I will be sharing this generously.
I love seeing how others approach TDD, it's one of those topics that can be handled in so many different ways and seeing how others tackle it is so informative, even if you've been doing it for awhile.
"Test-Driven Development with Python" (uses Django, is free to read online) http://chimera.labs.oreilly.com/books/1234000000754
is that it starts out with:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.title
before any other thing.Thanks for posting.