[darcs-devel] What about testing ?

Iago Abal iago.abal at gmail.com
Thu Mar 10 15:22:24 UTC 2011


I have found this package to support TDD in Haskell

http://hackage.haskell.org/packages/archive/hspec/0.3.0/doc/html/Test-Hspec.html

the workflow is described here

https://github.com/trystan/hspec/blob/master/README

Although I think some Darcs code (like patch logic) needs a more complex
testing infrastructure (for instance, repository models etc.) the use of
this package could be really useful. Many modules could mix code with
specifications, which will improve a lot the understandability of how some
functions are supposed to work.

For QuickCheck, I have been playing a bit with Agata, which is able to
derive Arbitrary instances via Template Haskell

http://hackage.haskell.org/package/Agata-0.2.1

I think it is enough for most cases.

On Wed, Mar 2, 2011 at 2:15 PM, Iago Abal <iago.abal at gmail.com> wrote:

> I recall Eric said me around September 2010 that you were considering (and
> thinking how) to incorporate testing into Darcs development. There was a
> short talk about this topic one or two months in the irc channel too. What
> about this? I took a look to XMonad some weeks ago and I find these two
> interesting points in their style guidelines:
>
> * Comment every top level function (particularly exported functions), and
>
>   provide a type signature; use Haddock syntax in the comments.
>
>
>> * Any pure function added to the core should have QuickCheck properties
>
>    precisely defining its behavior.
>
>
> I think should be OK for everybody to fulfill these requirements (maybe
> allowing the developer to choose between QuickCheck or HUnit, since HUnit is
> easier) and that will (in the medium-term) solve many Darcs problems.
>
> --
> Iago Abal Rivas
>



-- 
Iago Abal Rivas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20110310/70e7bd5c/attachment.html>


More information about the darcs-devel mailing list