[TIP] Interface vs Implementation Testing
ischenko at gmail.com
Mon Apr 23 23:01:11 PDT 2007
On 4/24/07, Titus Brown <titus at caltech.edu> wrote:
> -> I coded a huge test suite once that primarily unit tested
> -> implementation. Since there were many tests, any time I wanted to
> -> change the way the app was implemented (faster algorithm here, don't
> -> need this class anymore, more methods now because of feature X) I
> -> usually ended up spending a good deal of time updating and deleting
> -> tests. This just seemed unecessary to me and deterred me from relying
> -> on the test suite as an indication of successful functionality.
> So, isn't this kind of an argument for functional and regression tests
> (I'm honestly curious. I haven't found much of a need for unit tests in
> my own code.)
Functional tests work great when testing "base path" through the system. But
they don't work that great testing corner cases, unexpected conditions and
You can write unit tests which exercise a function/module with (all)
different code paths. The more high-level the test the less feasible it
becomes: number of permutations explodes and many code paths simply aren't
(easily) reachable from the top-level. That off-the-beaten-path code still
needs to be tested and there is no better tool for that than unit tests.
YMMV, of course.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python