Some of you may have noticed a presentation given at the
ICFP06 Erlang Workshop in Portland:
"Testing Telecoms Software with Quviq QuickCheck"
(Arts, Hughes, Johansson, Wiger)
I couldn't find the paper in the ACM library yet, but
I'm sure it will turn up eventually.
Many of you surely know QuickCheck from Haskell.
I thought I'd bring attention to a discussion (pg 8)
where Erlang and Haskell are compared as languages for
writing the kind of properties used in QuickCheck.
I found the passage interesting, not least because it was
written by Prof. John Hughes, co-inventor of Haskell and
Erlang Programmer Extraordinaire.
(I've wikified the text slightly).
"Static typing would certainly have been useful to catch errors
in generators earlier, although we found QuickCheck testing to be
quite a good substitute. The original QuickCheck also allows a
default generator to be associated with each type, so that properties
can be formulated a little more simply when the default generator
is appropriate. However, in this case study, /type/ information is not
enough to determine which generator is appropriate - we need to
know the abstract proxy state too. So in this case, the advantage
of using type information to guide generation would be small.
"On the other hand, representing test cases symbolically in Haskell
requires type definitions, potentially many such, whereas in Erlang
we could simply write down the values we wanted. Moreover, the
kind of processing that `eqc_commands' does of test cases would
require sophisticated generic programming in Haskell, but was
much simpler in Erlang. Interpreting symbolic test cases was eased
by Erlang's ability to invoke a function given its /name/ as an Erlang
atom - Erlang provides some basic reflection via this mechanism.
"We conclude that Erlang is rather a suitable host language for this
kind of testing. It's dubious whether our specifications could have
been expressed as concisely in Haskell, even if the versions of
QuickCheck were otherwise equivalent."
One may make several observations. Here are two of mine:
- For those of you out there doing bread and butter programming,
but play with Haskell and QuickCheck on your spare time, it
may be inspiring to see an industrial case study using QuickCheck
for black-box testing. You can approach your bosses with great
- The pilot project was a success, as were the subsequent courses
for some of our designers. This looks to become yet a very nice
industrial application of techniques risen from the Haskell ranks.
QuickCheck certainly is an amazing tool.
Ulf Wiger, Senior Specialist,
/ / / Architecture & Design of Carrier-Class Software
/ / / Team Leader, Software Characteristics
/ / / Ericsson AB, IMS Gateways