OO, FP and XP training (extremely long)

Ulf Wiger (AL/EAB) <>
Thu Dec 15 14:35:04 CET 2005


Dominic Williams wrote:


> When I last looked at QuickCheck, it struck me as an 
> interesting complement to TDD. But it's worth bearing in mind 
> that TDD is not just about testing or verifying: it's a 
> /design process/, what matters is the dynamics, the act of
> doing it, the flow it gets you in.

This is very much true for QuickCheck as well. I would 
say that QuickCheck has the potential to really 
revolutionize the way people program. It's not necessarily
easy to get into, but it should be well worth the effort.

I heard from John Hughes that he didn't feel too successful
teaching QuickCheck while he used already written code as 
a starting point. When he switched to using QuickCheck as 
a design approach, people caught on much better.

Basically:
when you want to write a function,
- first describe what input the function should
  oeprate on
- then describe what output it should produce.

Describing these things as properties is, when you've
gotten used to QC, often easier than writing the function
itself. Once the properties are written, actually 
writing the function will be easier, too.

And your test cases write themselves... ;-)

/Uffe




More information about the erlang-questions mailing list