Re: Transactions: good or bad?

From: Marshall Spight <mspight_at_dnai.com>
Date: Tue, 10 Jun 2003 17:09:04 GMT
Message-ID: <QgoFa.1185036$F1.139896_at_sccrnsc04>


"tj bandrowsky" <anakin_at_unitedsoftworks.com> wrote in message news:af3d9224.0306091433.6712f63c_at_posting.google.com...
> > A set of testcases is a demonstration that an algorithm works
> > for a specific set of inputs. A proof is an explanation of why
> > an algorithm works for all possible inputs. They may be related
> > as far as intention, but they are not the same thing.
>
> But, if you have test cases that work for all conditionals within an
> application, then haven't you effectively proven that the algorithm
> works for all inputs?

If your test cases cover 100% of all possible inputs, then you have a proof by exhaustive check. If you merely have 100% code coverage (meaning you have at least one testcase for every code path) then you *don't* have a proof. Although you do have good code coverage!

A simple demonstration:

// boolean AND function: returns true iff a is true and b is true. boolean and(boolean a, boolean b)
{
  return a | b;
}

// testcase:
assert( and(true, true) == true);

So now I have a testcase for every codepath, and all my testcases return the correct results. But my function still has a nasty bug.

I can prove this function using testcases, but I need four of them, even though there is only one codepath.

Marshall Received on Tue Jun 10 2003 - 19:09:04 CEST

Original text of this message