launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #02669
Re: Model objects and doc tests
On Friday 19 February 2010 11:54:08 Henning Eggers wrote:
> Am 19.02.2010 12:47, Julian Edwards schrieb:
> > Should all model objects should have doc tests? (ie. testable
> > documentation)
> >
> > Discuss.
>
> What about the rule "test and browser code do not import from model
> code"? As as that is in place, I understand that we are supposed to test
> against interfaces not a specific implementation.
I've never seen that rule - if you look at the code base you'll see why.
> I am not sure, though, if that rule applies to both doc and unit tests.
>
> So with that paradigm still in place, I'd say 'No'. The rule should then
> be that each model object must implement an interface and that each
> interface must have a doc test.
>
> Or we change the paradigm. Or I misunderstood it. ;)
I think maybe you did.
My rationale is that there's a single place I can go that describes and
discusses how to use a model object. Some teams are using a unit tests
exclusively and some use both doctests and unittests. And some seem to be
random.
I'd really like to see better doc tests; I find it totally impossible to
understand what a model object does through unit tests as it encourages a
different style.
J
Follow ups
References