Skip to content
Prev 48701 / 63424 Next

[Wishlist] a 'PackageDevelopment' Task View

On 7/27/2014 7:46 AM, Luca Braglia wrote:
I've heard claims that people who write documentation with unit 
tests first tend to get better code faster than people who write the 
code first and documentation (and maybe examples and unit tests) later.  
I've heard there is research behind this.  However, I'm not sure where 
to find it.  Others may be able to suggest publications that support or 
refute this claim.


       In any event, I tend to create (a) documentation first, including 
(b) unit tests in the examples section, before (c) writing code.  When I 
started writing R packages following this model, I felt my software 
development productivity increased by a factor of 5 or so.  That may 
sound crazy, but I had written code for decades and struggled 
continually with bugs introduced months or maybe years earlier.  "R CMD 
check" dramatically shortened the debug time to produce "trustworthy 
code" (John Chambers' "prime directive").  As a bonus, I got better 
software with documentation making it much easier to share with 
potential users -- in less time with less effort, heartache, blood, 
sweat and tears, etc.  I have not come to using roxygen2, though I've 
been enormously impressed with other things Hadley Wickham has done;  
fortune(298).


       This perspective is reflected in the Wikipedia article on 
"Package development process" and the comparison table of "Selected 
repositories" in the Wikipedia article on "Software repository".  I 
believe that both these articles could be improved by people with 
broader experience and deeper understanding of these issues than I have.


       Spencer Graves