[Haskell-cafe] HSpec vs Doctest for TDD

Bob Hutchison hutch-lists at recursive.ca
Thu Jun 26 12:18:06 UTC 2014


On Jun 25, 2014, at 6:53 PM, Johan Larson <johan.g.larson at gmail.com> wrote:

> Has anyone here actually done strict TDD?

Yes. Routinely. For many years. With many programming languages, including Haskell.

> 
> I would expect strict TDD-based development (with no substantial design up front) to gradually build up a system from fuzzy ideas.

Why? Read Richard O’Keefe’s post from yesterday. Testing at the DSL level that he’s talking about is precisely where the tests in TDD exist. If it’s not a DSL it’ll be an API. In TDD, you do not test anywhere else. This includes regression test suites. There are constraints on an application’s architecture implied by TDD — you need an interface of some kind. If you feel testing at a more detailed level would be helpful when you write some part of the system, go ahead but delete those tests when you’re done.

A recent talk about what TDD is, and isn’t, is at:

http://www.infoq.com/presentations/tdd-original



> This would grow increasingly unwieldy until the designer got fed up trying to keep it all together and redesigned it from scratch. And for a large system there could be several such redesign-completely episodes.
> 
> 
> On Wed, Jun 25, 2014 at 6:26 PM, MigMit <miguelimo38 at yandex.ru> wrote:
> And TDD is not the same as having tests, so please stop arguing for the second while pretending to be arguing for the first.
> 
> Отправлено с iPhone
> 
> > 26 июня 2014 г., в 0:21, Frerich Raabe <raabe at froglogic.com> написал(а):
> >
> >> On 2014-06-25 18:05, MigMit wrote:
> >> Again, nobody here suggests that tests aren't necessary.
> >
> > And rightfully so! TDD is not "a poor substitute for type safety" (as you put it in your earlier mail) at all.
> >
> > In fact, strong type systems complement test-driven development very nicely. An expressive type system greatly simplifies testing because the compiler can catch a larger classes of mistakes and because - in the case of pure functions - the function signatures very clearly communicate the required input and output. There are no hidden dependencies and there's no setup or tear-down work required.
> >
> > So I'd argue that test-driven development is relevant *because* of Haskell's type system, not *in spite of* it.
> >
> > --
> > Frerich Raabe - raabe at froglogic.com
> > www.froglogic.com - Multi-Platform GUI Testing
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 
> 
> -- 
> Johan Larson -- Toronto, Canada
> _______________________________________________
> 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/20140626/842e5e55/attachment.html>


More information about the Haskell-Cafe mailing list