[TIP] Interface vs Implementation Testing

Benji York benji at benjiyork.com
Mon Apr 16 12:43:01 PDT 2007


Raphael Marvie wrote:
> Would you:
> 
>   a. write interface-based tests and implementation specific ones  
> (the first ones could then be re-used later on),

> If you have chosen a., would you:
> 
>   1. write interface-based tests as doctests in the module itself,  
> and write unittest ones for the implementation specific part,

I would use a stand-alone (i.e., text file) doctest for both aspects of 
the testing.  One that is about the interface and is meant to be user 
docs (user of the interface, a programmer).  The other would test 
particularly complex bits of the implementation to verify interesting 
invariants.
-- 
Benji York
http://benjiyork.com



More information about the testing-in-python mailing list