On Mon, Aug 30, 2010 at 03:33:23PM +1000, Minh Nguyen wrote:
> A few months ago I experimented with writing test cases in LaTeX as
> part of a detailed discussion of underlying relevant theory. So for
> example you want to write some test cases for graph theory. You start
> by writing a short document explaining any relevant theory and runtime
> complexity of algorithms you want to cover, with references to any
> literature where appropriate. Next write down properties you're
> interested in together with any expected results, followed by a
> transcript of a Sage session that verify the stated properties. All of
> these are written up as a LaTeX document just like your normal LaTeX
> document. To run the test cases through Sage, I used a little tool [1]
> to extract the test cases and run them through the Sage doctesting
> framework. As an example of what I mean, refer to this document [2]
> which is a work in progress.

For the record: the (relatively new) sageexample environment of
sagetex allows for including doctest like examples in the latex file:

  \begin{sageexample}
    sage: 1 + 1
    2
  \end{sageexample}

Upon compilation, those examples are all extracted to a separate file
which you can test using sage -t. That's what we use to check the
examples in our French introductory Sage book. This still has a couple
glitches, but the more people use it, the better it will become :-)

Best,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
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