[Haskell-cafe] HSpec vs Doctest for TDD

Christopher Allen cma at bitemyapp.com
Tue Jun 24 21:24:24 UTC 2014

I don't have a problem with using TDD *and* type-safety to the full extent
of usefulness, but the lifecycle/process isn't what TDD experts would call
proper TDD.

I do use HSpec, very happily. The author has done a truly excellent job
with it.

Process is something like:

    write types, validate types
-> fill holes, validate terms against types
-> compose functions to see if results are sane, go back to 1st or 2nd step
if not.
-> Are there useful invariants QuickCheck can express? Write those first.
Repeat cycle as needed.
-> Decide on meaningful but compact functional/integration tests, repeat
cycle as needed.

Example HSpec tests (just functional/integration):

On Tue, Jun 24, 2014 at 3:55 PM, Gautier DI FOLCO <gautier.difolco at gmail.com
> wrote:

> Hi all,
> I'm a huge fan of TDD (Test-Driven Development) et I used to use tools
> such as RSpec (Ruby). So naturally, I looked to HSpec, but it seems not
> idiomatic in Haskell.
> I have a bunch of questions:
> - Do you do TDD?
> - Which tools do you use?
> - Is doctest "better" (in some senses) than HSpec? Why?
> - Are HSpec and Doctest complementary? If so, in which case do you use one
> or another?
> - Is there some Haskell-specific good practices do to TDD?
> Thanks in advance for your lights.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140624/4ecf21a5/attachment.html>

More information about the Haskell-Cafe mailing list