From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada and software testing
Date: Thu, 15 Jul 2021 09:27:37 +0200 [thread overview]
Message-ID: <scoo19$154u$1@gioia.aioe.org> (raw)
In-Reply-To: 87h7gwy88g.fsf@nightsong.com
On 2021-07-14 22:02, Paul Rubin wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>>> I do have to say that errors thrown by runtime checks on range types are
>>> still program bugs,
>> No, it depends on the contract.
>
> If a contract is broken by either the caller or the callee, it is a
> program bug either way, I would have thought.
If the contract includes exception, then nothing is broken.
>>> in the sense that they are type errors,
>> A type error cannot happen at run-time per definition of strong
>> typing. Constraint violation is not a type error.
>
> Hmm ok, if out of range for a range type is considered a constraint
> error rather than a type error, then it's ok to say the compiler can't
> check it even in principle, and it becomes the responsibility of the
> application user or environment. Inputs that trigger a constraint error
> might be considered invalid in some situations.
Yes, and the tests must include the cases when exceptions are
propagated, which is frequently ignored, though in my view such tests
are even more important than the "normal" cases. Exceptions are not
likely to happen. So the code not handling contracted exceptions tend to
slip into production with catastrophic results.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2021-07-15 7:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-12 0:49 Ada and software testing Paul Rubin
2021-07-12 8:40 ` Dmitry A. Kazakov
2021-07-14 19:56 ` Paul Rubin
2021-07-12 16:14 ` Gautier write-only address
2021-07-12 16:41 ` Dmitry A. Kazakov
2021-07-14 19:32 ` Paul Rubin
2021-07-14 19:51 ` Dmitry A. Kazakov
2021-07-14 20:02 ` Paul Rubin
2021-07-15 7:27 ` Dmitry A. Kazakov [this message]
2021-07-16 10:01 ` G.B.
2021-07-16 10:21 ` Paul Rubin
2021-07-28 15:28 ` Paul Butcher
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox