testing through trace analysis

Luke Gorrie luke@REDACTED
Tue Oct 12 10:36:51 CEST 1999

Hi all,

I've been playing with a novel (to me) way of testing programs by
tracing their actions while they run, and then at the end checking
that the sequence of events is valid. Like some stuff I read about in
CSP. I did this by hand because it was fairly convenient to send
special messages to a logging process all within the unit test module.

Now I've noticed how powerful the trace/3 BIF is for this sort of
thing and I'm really curious to know how people use it. I'm
envisioning a testing framework that uses a little language that can
be used to say what order(s) a set of events (sending messages, calls
to certain modules, etc) can occur - the set of all possible correct
traces - and then have it automatically and painlessly validated.

Do people do this stuff? I'm finding it useful in my very simple
example which lends itself to this sort of thing, but I'm curious to
know if it's widely applicable.

I've also been generally trying to imagine what the testing frameworks
in use look like, and thinking about things like having any failed
unit test automatically restarted in the debugger with a breakpoint
set at the start, etc. If anyone wants to satisfy my curiousity as to
what testing support works well I'd be very grateful. :-)

"Time flies like an arrow; fruit-flies like a banana." -Groucho Marx

More information about the erlang-questions mailing list