News for hackers. Stuff that matters.
Re:Why I Hate Test Driven Development by yummyfajitas on Tuesday May 29, 2012 @08:19AM (#4037081)
...so that it helps me write the function, but "hard-wires" a particular order?

Use assertItemsEqual.

http://docs.python.org/library/unittest.html#unittest.TestCa...

The way I do it:

In the doctest, I include a few toy examples, stuff I can verify by hand, and which helps the user understand what I'm doing.

In the unit tests, I try to do things in the style of Haskell's Quickcheck (the greatest testing library out there). Generate some random values and test properties (e.g., len(permute(x)) == factorial(len(x))).

There are no comments on this comment yet.