Registered: Sep, 2005
Re: Reviewable, Runnable Specifications Ensure Software Quality
Posted: Jun 15, 2010 4:20 PM
> >> As Eric (I think) noted, tests can't prove the code
> >> correct, they can only prove it wrong. It's much like
> >> modern philosophy of science. You have a theory that
> >> test, the more tests that don't prove the theory wrong,
> >> the more faith you have in the theory but it is never
> >> proven to be correct.
> True, but this is the wrong question! We - as computer
> scientist - are used to think in categories like
> true-false, 0-1, black-white.. but the point is testing is
> about confidence. If you have 100 good test cases than you
> have greater confidence in your programm than if you only
> have 10 random ones.
Isn't this exactly what I said?
> But does it matter? James Watson will
> say: Well you can have a greater confidence but if your
> program crashes than your program crashes! True, but if
> you have greater confidence than one can expect that in
> most cases the program will work. Probably not 100%. But
> again: To expect that it will work in 90% of the cases is
> still better than to expect that it will work only in 50%
> of the cases.
First, I'd be interested to understand how you would come up with a 50% or 90% estimate. What would you base it on?
There is no way to verify that an application will work in 100% of cases for the reasons we've discussed. But the answer is not to pretend that it is possible and claim that your unit tests give you that guarantee.