[BioRuby] [GSoC][NeXML and RDF API] Code Review.

Pjotr Prins pjotr.public14 at thebird.nl
Fri Jun 25 07:08:04 UTC 2010


> >  http://github.com/tablatom/rubydoctest
> >
> >
> Hey, I did not know that doctests existed for Ruby too. I will have a look
> into it.

They are good, however finding bugs is a bit problematic as the stack
traces are lengthy and often not descriptive. So with troubling code
I tend to write extra unit tests. Also, with BioRuby we have not
settled on doctests yet, so you need to reach coverage with unit
tests and/or Specs.

I really think it is good for validating documentation.

> > I used these in bio/appl/paml/codeml/report.rb - these are examples
> > that double as tests. Kill two birds with one stone! The BioRuby
> > tutorial also uses doctests - i.e. the code in the Tutorial can be
> > validated against the installed bioruby. If you want to use this you
> > need an extra conversion - I have that tool.
> >
> 
> I will check out the examples. What tool? I would like to know more.

It simply parses out commented code in the source headers, and turns
them over to rubydoctest. The tool is in my bioruby-support tree on
github - see 

  http://github.com/pjotrp/bioruby-support/blob/master/bin/uncomment_doctest

you can see it uses an environment variable.

> I am missing Rspec too from my Rails and Merb days. I picked up unit tests
> because much of the framework had used the same and also because I wanted to
> try it out :).
> 
> 
> > I am interested to see what you want to do for RDF support. Maybe you
> > can write out the API as an RSpec? That would be a good start.
> >
> >
> That sounds like a nice idea.

RSpec is new for BioRuby. Since you have experience you are the right
one to introduce it to us ;). If it is convincing to the others we
may accept it as standard use (personally I think it is a step
forward from unit testing - unit tests are not very good as
documentation).

Pj.



More information about the BioRuby mailing list