From: Paul Rubin <no.email@nospam.invalid>
Subject: Re: Ada and software testing
Date: Wed, 14 Jul 2021 13:02:23 -0700 [thread overview]
Message-ID: <87h7gwy88g.fsf@nightsong.com> (raw)
In-Reply-To: scnf8n$1lgd$1@gioia.aioe.org
"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.
>> 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.
> If you can. In reality it is impossible to enforce validity per type
> system, because such contracts are often not enforceable.
Yep. SPARK tries to enforce such constraints at compile time, but it's
not always possible to use it.
next prev parent reply other threads:[~2021-07-14 20:02 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 [this message]
2021-07-15 7:27 ` Dmitry A. Kazakov
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