need help with tool requirement

Bob Bell bbell at hp.com
Wed Apr 21 10:58:00 EDT 2004


On Wed, Apr 21, 2004 at 01:16:44AM -0400, bmcculley at rcn.com <bmcculley at rcn.com> wrote:
> The approach I thought of is based on doing exactly that, in an
> emulator or virtual machine environment, single stepping automagically
> through the debugger until a conditional transfer of control is
> recognized.  At that point a snapshot would be taken, the natural
> branch followed, iterating until complete.  Then revert to the last
> snapshot, force the alternative branch, repeat until done.
> 
> What's the big deal?  Seems like it could probably all be wrapped into
> a PERL one-liner at the top level, even if the one-liner has to expand
> into some more complex subfunctions down the tree.
> 
> All right, I concede I am not considering potential data dependencies
> (e.g. if this leg of the branch is taken some data item(s) must be
> this value not that), which could affect array indexing for example.
> I'll accept that limitation for the present, because this will not be
> used in isolation.

I think that that's a big problem -- the different dependencies required
to take a branch.  Taking branch B may only "make sense" if back in
routine R variable X was set to Y, and if you take branch B when X is Z,
your program may do weird things, and for good reason.

The approach taken here at HP for HP-UX, where there has been a lot
emphasis recently on quality and, in turn, code coverage, is using
a tool from Bullseye (http://www.bullseye.com/) that records when the
true and false cases of every "condition/decision point" are taken, and
then adding testing to make sure that some minimum percentage of
coverage is reached.

It's actually from trying to add testing to get that coverage that
I assert that "forcing" a branch is non-trivial with regard to
dependencies.  And, if intuition serves correctly by extrapolating some
concepts from compiler theory, definitively examining those dependencies
would take expotential time with the best algorithms we have, and in
fact I believe may be NP-complete.

DISCLAIMER: I think I'm right, but I could just be blowing smoke...

-- 
Bob Bell



More information about the gnhlug-discuss mailing list