We are thinking along some of the same lines. Most likely I'll have to
create any tool that I use. I was hoping someone would have thought of
that already.
 
> But what I would usually suggest is extensive logging.

I've created a quick class that logs an event every time a member
function is called, and that works well for seeing what paths the
program took on any particular run, but it doesn't allow me to force
certain paths to be taken. It is really useful for gaining an
understanding of what my code is actually doing, and it's helped me
optimize something.

> > I was thinking there should be a way to control a program's threads
> > from the outside and write a script to test every path, but I don't
> > know if that's possible.
> 
> I don't know of any such tool, but I'd be quite interested to 
> know if there
> is one.

I am thinking of writing a program that creates a set of events (one for
each thread in my app), and has a button that triggers that event.

Then I would sprinkle WaitForSingleEvent() calls all over my code. Then
my program would be a "puppet" of the other one and the threads would
run in a completely deterministic order.

That would catch some race conditions, but it would miss those that
happen between my WaitForSingleEvent() calls.

I would want to create a set of scripts for the controller program that
test every combination.

There are some technical things to worry about, like the threads are
created and destroyed on the fly, so the controller would have to know
about new ones.

In any case, it sounds like a lot of work, and possibly not very
thorough. I was hoping someone had gone down this path before.



Reply via email to