I've updated it, and yep, that makes a very big difference. Pretty
healthy looking.

I should really check a few and make sure there aren't other sections
that are getting counted as tests (I have to explicitly exclude any
sections for them to not be counted). But for the couple of files I
checked the numbers looked right.

Bill.

On Nov 3, 9:20 pm, John H Palmieri <jhpalmier...@gmail.com> wrote:
> On Nov 3, 7:42 am, Bill Hart <goodwillh...@googlemail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On 3 Nov, 11:09, Mitesh Patel <qed...@gmail.com> wrote:
> > <SNIP>
>
> > > > I have been saying this for a very long time, to many people. *ALL*
> > > > mathematical libraries are broken and contain bugs. If you don't test
> > > > the code you are using, it *is* broken. The right ratio of test code
> > > > to code is really pretty close to 50/50. And if you think I don't do
> > > > this myself when I write code (even Sage code), well you'd be wrong.
>
> > > Does anyone have an estimate of this ratio for the Sage library?
>
> > I don't know how to measure this. I noted that tests seem to appear
> > inside docstrings r""" .... """ in sections labelled TESTS. There were
> > lots of other lines in docstrings in sections labelled EXAMPLES,
> > INTERNAL DOCUMENTATION or REFERENCES.
>
> > So I wrote a short C program and script to cover the .py files
> > recursively in sage-4.6/devel/sage-main/sage and the output is here:
>
> >http://selmer.warwick.ac.uk/output
>
> > The final column should give the % of nonblank lines in the file which
> > are in a docstring after a header TESTS, but not in any of the other
> > kinds of sections in a docstring. (This is not the most scientific
> > measurement in the world but a first approximation.) The count
> > includes the TESTS header itself.
>
> > The program skips blank lines and lines containing only whitespace and
> > does not count them for any purpose.
>
> > If you tell me what other kinds of sections I should look for, I can
> > modify the program. I can also easily get it to print the number of
> > lines of references, etc, if that is useful info.
>
> I think you should include EXAMPLES also, since those actually contain
> most of the doctests in the Sage library.  "TESTS" blocks are not used
> very systematically, I think.
>
> --
> John

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to