comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Float conversion
Date: Thu, 05 Aug 2010 08:05:07 -0400
Date: 2010-08-05T08:05:07-04:00	[thread overview]
Message-ID: <82vd7ps1sc.fsf@stephe-leake.org> (raw)
In-Reply-To: wcctynay1yf.fsf@shell01.TheWorld.com

Robert A Duff <bobduff@shell01.TheWorld.com> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> Phil Clayton <phil.clayton@lineone.net> writes:
>>
>>> On Jul 31, 4:12 pm, Stephen Leake <stephen_le...@stephe-leake.org>
>>> wrote:
>>>> Clearly to cover all cases, you
>>>> need A < B, A = B, A > B, A < C, etc.
>>>
>>> You make it sound easy...
>>
>> It is easy! This is a very small program; exhaustive testing is
>> appropriate. 
>
> I wouldn't call that "exhaustive".  To me, exhaustive testing means
> testing every possible input.  There are far more than 9.

Yes, that's true.

> You seem to be using some sort of coverage metric, not exhaustive
> testing.

Yes.

>> According to the code, there are three important edge cases for each
>> pair: A < B, A = B, A > B
>
> I don't understand that.  Phil Clayton's example was:
>
>   if A < B and A < C
>   then
>     Y := A;
>   elsif B < C and B < A
>   then
>     Y := B;
>   else
>     Y := C;
>   end if;
>
> (Interesting example, by the way!)

I was talking about my rewrite, which got rid of the 'and' operators to
make things clearer.

> And why not A=B-epsilon?

That's one appropriate test case for A < B, along with A = B - 1.0.

> By the way, putting:
>
>     pragma Assert (C < B and C < A);
>
> after "else" might have made the bug clearer.  Or might not.

That's a good idea.

>> What are you verifying, if not a specification?
>
> You can't formally verify specifications.  You can (sometimes) formally
> verify that the code matches a specification.

That's what I meant; the verification process is meaningless without a
specification. 

-- 
-- Stephe



  parent reply	other threads:[~2010-08-05 12:05 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 12:23 Float conversion Henrique
2010-07-29 12:44 ` Jacob Sparre Andersen
2010-07-29 12:46 ` Dmitry A. Kazakov
2010-07-29 15:08   ` Georg Bauhaus
2010-07-29 15:10     ` Georg Bauhaus
2010-07-29 15:35     ` Dmitry A. Kazakov
2010-07-29 18:21       ` Henrique
2010-07-29 19:08         ` Jeffrey R. Carter
2010-07-29 19:15         ` Dmitry A. Kazakov
2010-07-30  1:30           ` Phil Clayton
2010-07-30  8:43             ` Dmitry A. Kazakov
2010-07-30 13:14               ` Phil Clayton
2010-07-30 14:34                 ` Dmitry A. Kazakov
2010-07-31 15:12                 ` Stephen Leake
2010-08-03  1:07                   ` Phil Clayton
2010-08-03  3:31                     ` Shark8
2010-08-03 10:38                     ` Georg Bauhaus
2010-08-04  7:27                       ` Stephen Leake
2010-08-04 16:15                         ` Georg Bauhaus
2010-08-04 16:32                       ` Phil Clayton
2010-08-04  7:26                     ` Stephen Leake
2010-08-04 12:52                       ` Robert A Duff
2010-08-04 14:32                         ` Dmitry A. Kazakov
2010-08-04 19:36                           ` Simon Wright
2010-08-04 19:46                             ` Dmitry A. Kazakov
2010-08-04 20:29                             ` Georg Bauhaus
2010-08-05 12:05                         ` Stephen Leake [this message]
2010-08-07  5:54                           ` Shark8
2010-08-07  8:56                             ` Georg Bauhaus
2010-08-07 13:49                               ` Shark8
2010-08-05 10:20                       ` Phil Clayton
2010-07-30 13:16           ` Henrique
2010-07-29 15:37   ` Warren
2010-07-29 14:56 ` Georg Bauhaus
2010-07-29 17:56   ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox