From pburns at pburns.seanet.com  Thu Jun 17 11:22:57 2010
From: pburns at pburns.seanet.com (Patrick Burns)
Date: Thu, 17 Jun 2010 10:22:57 +0100
Subject: [Rd] Package development process?
In-Reply-To: <AANLkTimtGcfzKshfvQsRBNGAqfxfiZkrabf0loOVtc1V@mail.gmail.com>
References: <4C182C9E.2080604@structuremonitoring.com>	<AANLkTinvljHoZC-XA5UgJkMoSmft9z9SjsUPwt_9W2F6@mail.gmail.com>
	<4C18E297.7020805@structuremonitoring.com>
	<AANLkTimtGcfzKshfvQsRBNGAqfxfiZkrabf0loOVtc1V@mail.gmail.com>
Message-ID: <4C19E971.7000807@pburns.seanet.com>

I agree with Hadley, and add that trying
to have an example be both an example and
a test may not be good for the example
aspect either.

Examples should make people who are ignorant
of the function twig as to how the function
works.  Creating good examples is hard.

Problems that really test the software are
unlikely to serve as a good example.  Good
examples are unlikely to seriously test the
code.  (But you do want the examples to run,
it is seriously bad advertising when they
don't.)

Pat


On 16/06/2010 15:53, Hadley Wickham wrote:
>>       What about the encouragement to add unit tests, if only disguised as
>> examples?
>
> Examples are not unit tests. Examples are a convenient way of testing
> some aspects of the package, but serve a rather different purpose to
> tests. The R community does not emphase testing nearly as much as
> other communities.  For example,  Ruby has a very strong testing
> culture including at least 10 different unit testing frameworks.
>
>>       I've found the unit tests to be a powerful tool to help improve and
>> maintain the quality of packages to which I contribute.  To this end, Sundar
>> and I added a column "Autochecks" to the table of "Selected Repositories" in
>> the Wikipedia article on "Software repository"
>> (http://en.wikipedia.org/wiki/Software_repository), and we describe it
>> briefly in the text introducing that table.
>
> Unfortunately your description highlights a inadequacy of R and poor
> software development procedures on the part of many R package
> developers (including me!). For exactly the reason you discuss, it's
> never a good idea for your package to depend on the most current
> version of another package.  If you do, changes to that package might
> break yours.  Most other package management systems allow you to
> specify the version of a dependency so that this doesn't happen.  You
> can do this with R, but because it's hard to have multiple versions of
> the same package installed at the same time, it's not as useful.
>
> Hadley
>

-- 
Patrick Burns
pburns at pburns.seanet.com
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')



[Rd] Package development process?
Patrick Burns