[TIP] Interface vs Implementation Testing

Max Ischenko ischenko at gmail.com
Tue Apr 17 22:08:50 PDT 2007


Hi,

On 4/17/07, Kumar McMillan <kumar.mcmillan at gmail.com> wrote:
>
> As for TDD, everyone has their own style, but to answer your question
> in the way I would do it...
>
> 1. write functional tests at the highest level for all the features
> you want to release [1] so that they are all failing.  The highest
> level might be accessing the queue interface (is it a web app?) adding
> an item, seeing that it shows up in the list view, deleting, etc.
> 2. implement just enough code so that they pass.
> 3. At this point you may want to experiment with a few better
> implementations so keep coding
> 4. decide on an implementaion and write unit tests for all the units
> involved
> 5. start back at number 1 with new features you want to add.  Add to
> any existing unit tests if the features calls for the modification of
> those units


My recent experience with  #1 has been very positive. I found that writing
functional tests for web app is (can be?) _very_ cost effective: you can
test so much with so little code (and a pile of infrastructure code, but
that's a different story).

Granted, these tests are coarse-grained and they tend to produce binary
answer (still works vs. broken). Unit tests gives answer on which unit is
broken but they can be a real drag while you refactoring and functional
tests obsoletes much slower.

Max.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20070418/2ca45706/attachment.htm 


More information about the testing-in-python mailing list