Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Old programmers never die, they just become managers.


devel / comp.lang.ada / Ada and software testing

SubjectAuthor
* Ada and software testingPaul Rubin
+* Re: Ada and software testingDmitry A. Kazakov
|`- Re: Ada and software testingPaul Rubin
+* Re: Ada and software testingGautier write-only address
|+- Re: Ada and software testingDmitry A. Kazakov
|`* Re: Ada and software testingPaul Rubin
| `* Re: Ada and software testingDmitry A. Kazakov
|  `* Re: Ada and software testingPaul Rubin
|   `- Re: Ada and software testingDmitry A. Kazakov
`* Re: Ada and software testingG.B.
 `* Re: Ada and software testingPaul Rubin
  `- Re: Ada and software testingPaul Butcher

1
Ada and software testing

<871r84cq4r.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5553&group=comp.lang.ada#5553

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.ada
Subject: Ada and software testing
Date: Sun, 11 Jul 2021 17:49:56 -0700
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <871r84cq4r.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="d795330fbdde19ce534ba4db1502b999";
logging-data="26934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/S7IT+bewYX6u2xcKRBti6"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:DE9F7yvmm1eYH/zCCeYF4DS6boo=
sha1:mHquS+a3lq6gqKnIG5u4oe05Xwg=
 by: Paul Rubin - Mon, 12 Jul 2021 00:49 UTC

I wonder if there is good guidance around for software testing in the
Ada world, or if it depends too closely on the application area. I'm
aware of DO-178B and DO-178C in the aviation world, though I haven't
studied either of them. Sqlite's document about its testing procedure
is also interesting and maybe a cautionary tale. Sqlite is a really
nice SQL database whose main misfortune from the Ada perspective is that
it is written in C. Its testing doc is here:

https://sqlite.org/testing.html

and a little more info can be found in this interview with the author:

https://corecursive.com/066-sqlite-with-richard-hipp/#testing-and-aviation-standards

Overview:

1. Sqlite originally had only ad hoc testing. Then the author
(Dr. Richard Hipp) did some work with Rockwell, heard about DO-178B
there, and embarked on a large effort to strenghten Sqlite's testing in
accordance with DO-178B. Particularly, the Sqlite team created an
enormous suite of unit tests aiming to get 100% MC/DC test coverage.
That is, for any "if" statement, there must be tests that exercise both
branches of the "if". This seemingly got Sqlite to be very reliable.

2. Later on, fuzz testing came into vogue, so they started fuzzing
Sqlite. This in fact found a bunch of crashes and vulnerabilities that
were duly fixed, and nonstop fuzzing was added to the test setup. But
the testing document (section 4.1.6) notes a tension between MC/DC and
fuzzing: MC/DC requires deep parts of the code to be reachable by test
inputs, while fuzz protection tends to use defensive programming against
"impossible" inputs, resulting in seemingly unreachable code. Fuzz
testing has been effective enough at finding bugs in C programs that it
has now displaced a lot of static analysis in the C world.

3. Sqlite uses a little bit of static analysis (section 11) but the
document says it has not helped much. Ada on the other hand uses static
analysis extensively, both in its fine grained type system (compared
with C's) and using tools like SPARK.

4. Bugs found by fuzz testing C programs are typically the standard C
hazards like buffer overflows, undefined behaviour (UB) from bad
arithmetic operands, etc. I'm of the impression that Ada is less
susceptible to these bugs because of mandatory range checking and less
UB in the language.

Well, that went on for longer than I expected. My questions are
basically:

Q1. Are there good recommendations for Ada testing strategies? Do
the tests resemble the stuff in the Sqlite doc?

Q2. Is fuzz testing an important part of Ada testing, and does it
tend to find many bugs?

Thanks!

Re: Ada and software testing

<scgv5m$obu$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5554&group=comp.lang.ada#5554

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Mon, 12 Jul 2021 10:40:24 +0200
Organization: Aioe.org NNTP Server
Lines: 38
Message-ID: <scgv5m$obu$1@gioia.aioe.org>
References: <871r84cq4r.fsf@nightsong.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Mon, 12 Jul 2021 08:40 UTC

On 2021-07-12 02:49, Paul Rubin wrote:

> Well, that went on for longer than I expected. My questions are
> basically:
>
> Q1. Are there good recommendations for Ada testing strategies? Do
> the tests resemble the stuff in the Sqlite doc?
>
> Q2. Is fuzz testing an important part of Ada testing, and does it
> tend to find many bugs?

I do not think so.

Here is a war story of a bug I fixed recently. A network protocol
implementation used a callback to send the next portion of data, when
the transport becomes available.

The callback implementation peeks a portion of data from the outgoing
queue and *asynchronously* sends it away. *If* initiation of sending is
successful, the queue is popped.

OK?

No, it is a bug that almost never shows itself because initiation of I/O
would normally deprive the task of the processor. But if it does not and
I/O completes without losing the processor, the callback is called
recursively *before* popping the queue and the *same* portion of data is
sent again.

Now, nether 100% coverage, nor fuzz, not even 100% black box testing can
detect this, arguably trivial bug.

[The fix is to make recursive calls void]

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Ada and software testing

<5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5556&group=comp.lang.ada#5556

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:6b0f:: with SMTP id w15mr20164987qts.366.1626106480257;
Mon, 12 Jul 2021 09:14:40 -0700 (PDT)
X-Received: by 2002:a25:aa09:: with SMTP id s9mr68267510ybi.165.1626106479961;
Mon, 12 Jul 2021 09:14:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 12 Jul 2021 09:14:39 -0700 (PDT)
In-Reply-To: <871r84cq4r.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1206:4564:bea0:1c51:57ed:40df:3086;
posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG
NNTP-Posting-Host: 2a02:1206:4564:bea0:1c51:57ed:40df:3086
References: <871r84cq4r.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>
Subject: Re: Ada and software testing
From: gautier_...@hotmail.com (Gautier write-only address)
Injection-Date: Mon, 12 Jul 2021 16:14:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1678
 by: Gautier write-only a - Mon, 12 Jul 2021 16:14 UTC

Le lundi 12 juillet 2021 à 02:50:17 UTC+2, Paul Rubin a écrit :

> Q2. Is fuzz testing an important part of Ada testing, and does it
> tend to find many bugs?

You can combine the power of fuzzing with the power of Ada's strong typing, implying standard Ada run-time checks (e.g. range checks), plus a compiler's own checks (e.g. GNAT's validity checks).

Read the following article for details: https://blog.adacore.com/running-american-fuzzy-lop-on-your-ada-code

Re: Ada and software testing

<schrbk$9kc$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5557&group=comp.lang.ada#5557

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Mon, 12 Jul 2021 18:41:28 +0200
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <schrbk$9kc$1@gioia.aioe.org>
References: <871r84cq4r.fsf@nightsong.com>
<5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 12 Jul 2021 16:41 UTC

On 2021-07-12 18:14, Gautier write-only address wrote:

> You can combine the power of fuzzing with the power of Ada's strong typing, implying standard Ada run-time checks (e.g. range checks), plus a compiler's own checks (e.g. GNAT's validity checks).

Before the Dark Age of Computing, testing was not arbitrary. You knew
things about your implementation and even, God forbid, foresaw some of them.

E.g. if the implementation was "linear" (the case for all buffer
overflow stuff) you would simply test the end points (extremes) and one
point inside instead of wasting time on anything else.

Of course, to make such considerations and techniques work, the programs
needed to be designed very differently, which was one of the motivations
behind Ada constrained subtypes, ranges etc.

This is also one of the reasons why unbounded strings, dynamic memory
allocation etc must be avoided as you leave some upper bounds undefined
making lot of things non-testable.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Ada and software testing

<87pmvky9lz.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5560&group=comp.lang.ada#5560

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Wed, 14 Jul 2021 12:32:40 -0700
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <87pmvky9lz.fsf@nightsong.com>
References: <871r84cq4r.fsf@nightsong.com>
<5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="158c5d4bee3779fbf0a272d27e09ef8a";
logging-data="6444"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YmbL4yZ/p52FfKqztzbNA"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:RSL5yHMQOL6pPadU+nG65NwLChA=
sha1:TrCnXwGQUK1ivLjTEgc9tVtpxSs=
 by: Paul Rubin - Wed, 14 Jul 2021 19:32 UTC

Gautier write-only address <gautier_niouzes@hotmail.com> writes:
> You can combine the power of fuzzing with the power of Ada's strong
> typing, implying standard Ada run-time checks (e.g. range checks),
> Read the following article for details:
> https://blog.adacore.com/running-american-fuzzy-lop-on-your-ada-code

Thanks, this is pretty interesting. He runs AFL on three Ada programs:
Zip-Ada, and Ada libraries for reading YAML and JSON. It finds bugs in
all three, though not very many. It fits my picture that Ada programs
are less susceptible than C programs are, to the types of bugs that
fuzzing uncovers.

I do have to say that errors thrown by runtime checks on range types are
still program bugs, in the sense that they are type errors, that in
principle we should want to catch at compile time.

Re: Ada and software testing

<scnf8n$1lgd$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5561&group=comp.lang.ada#5561

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Wed, 14 Jul 2021 21:51:54 +0200
Organization: Aioe.org NNTP Server
Lines: 26
Message-ID: <scnf8n$1lgd$1@gioia.aioe.org>
References: <871r84cq4r.fsf@nightsong.com>
<5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>
<87pmvky9lz.fsf@nightsong.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Wed, 14 Jul 2021 19:51 UTC

On 2021-07-14 21:32, Paul Rubin wrote:

> I do have to say that errors thrown by runtime checks on range types are
> still program bugs,

No, it depends on the contract.

> 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.

> that in
> principle we should want to catch at compile time.

If you can. In reality it is impossible to enforce validity per type
system, because such contracts are often not enforceable.

So the trick is to relax the contract by including exceptions, which is
what Ada constrained subtypes do. But then Constraint_Error becomes a
legal "value" function + would "return" on overflow.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Ada and software testing

<87lf68y8iv.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5562&group=comp.lang.ada#5562

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Wed, 14 Jul 2021 12:56:08 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <87lf68y8iv.fsf@nightsong.com>
References: <871r84cq4r.fsf@nightsong.com> <scgv5m$obu$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="158c5d4bee3779fbf0a272d27e09ef8a";
logging-data="6444"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UsTy+WiGuUMzFwfHxlf3/"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:vffcUYVxo6v85XyIlViRSMRzq6U=
sha1:vSb2t4J96LL1DD7AII1897pr23g=
 by: Paul Rubin - Wed, 14 Jul 2021 19:56 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> But if it does not and I/O completes without losing the processor, the
> callback is called recursively *before* popping the queue and the
> *same* portion of data is sent again.

This is a garden variety concurrency bug that you're right, wouldn't
normally be found with conventional fuzzing, but might be findable with
stress testing. A more rigorous approach would involve model checking.

This type of problem happens in C programs all the time as well, and
doesn't really signify anything about the effectiveness of fuzz testing.
Fuzzing is very effective against C programs, but tentatively maybe less
so against Ada programs, because of Ada's more thorough type checking.

> [The fix is to make recursive calls void]

Hopefully there would be some locks between the tasks, though in that
case the problem would show up as deadlock.

Re: Ada and software testing

<87h7gwy88g.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5563&group=comp.lang.ada#5563

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Wed, 14 Jul 2021 13:02:23 -0700
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87h7gwy88g.fsf@nightsong.com>
References: <871r84cq4r.fsf@nightsong.com>
<5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>
<87pmvky9lz.fsf@nightsong.com> <scnf8n$1lgd$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="158c5d4bee3779fbf0a272d27e09ef8a";
logging-data="6444"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O2E0LVLIO60iBxU1f38Uf"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:sTMxMHbIGCKEd1LAig7f3J2pRkk=
sha1:nvus6uljX4xJBajw+O9FjMKPa9A=
 by: Paul Rubin - Wed, 14 Jul 2021 20:02 UTC

"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.

Re: Ada and software testing

<scoo19$154u$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5568&group=comp.lang.ada#5568

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Thu, 15 Jul 2021 09:27:37 +0200
Organization: Aioe.org NNTP Server
Lines: 31
Message-ID: <scoo19$154u$1@gioia.aioe.org>
References: <871r84cq4r.fsf@nightsong.com>
<5bc2434a-6784-47d6-ba66-50edff4f80f0n@googlegroups.com>
<87pmvky9lz.fsf@nightsong.com> <scnf8n$1lgd$1@gioia.aioe.org>
<87h7gwy88g.fsf@nightsong.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Content-Language: en-US
X-Mozilla-News-Host: news://news.aioe.org
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Thu, 15 Jul 2021 07:27 UTC

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

Re: Ada and software testing

<scrlec$h26$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5577&group=comp.lang.ada#5577

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bauh...@notmyhomepage.invalid (G.B.)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Fri, 16 Jul 2021 12:01:47 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <scrlec$h26$1@dont-email.me>
References: <871r84cq4r.fsf@nightsong.com>
Reply-To: nonlegitur@notmyhomepage.de
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 16 Jul 2021 10:01:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="16ede9abdaa38f7352e6561422ea7240";
logging-data="17478"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/A3AVrkVZC91bpDXVWFl+vD3E7ZGpu2CI="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
Gecko/20100101 Thunderbird/78.11.0
Cancel-Lock: sha1:Ndyo7YBacVZG7NQt5bhZOqCufSY=
In-Reply-To: <871r84cq4r.fsf@nightsong.com>
Content-Language: en-US
 by: G.B. - Fri, 16 Jul 2021 10:01 UTC

On 12.07.21 02:49, Paul Rubin wrote:

> Well, that went on for longer than I expected. My questions are
> basically:
>
> Q1. Are there good recommendations for Ada testing strategies? Do
> the tests resemble the stuff in the Sqlite doc?
>
> Q2. Is fuzz testing an important part of Ada testing, and does it
> tend to find many bugs?

I'd like to add, if I may, a third question, perhaps a a follow-up question,
after having been bitten by a bug that was hidden behind assumptions.

Is there a way of systematically looking for hiding places of bugs
specifically in places external to the program text? And, then, what kind
of mock-ups could establish typical testing patterns? I/O is mentioned
in in the sqlite examples, but what if you do not assume that there
is going to be X .equiv. I/O?

Example: Some external library, of very closed source nature,
exposes an unforeseen behavior. It turns out that a library function
uses a lock, and while waiting for it, the function call times out,
the client program reports failure and terminates normally - with
side effects...

After the fact, after some reading and then some testing, in an adjusted
setup, it all seems plausible. "But, I didn't think of that!".
Educated guesses about what the library might do need to be based
on a vast set of documents, plus the seller of the library
also sells expensive training. Programs need a quick fix, though.

So, what is a proper testing strategy once the programmers have found
that the transitive closure of some call might sometimes incur externally
caused behavior? Such as timeout, or ordering effect due to concurrency?

Re: Ada and software testing

<87pmvi36fv.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5578&group=comp.lang.ada#5578

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.ada
Subject: Re: Ada and software testing
Date: Fri, 16 Jul 2021 03:21:24 -0700
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <87pmvi36fv.fsf@nightsong.com>
References: <871r84cq4r.fsf@nightsong.com> <scrlec$h26$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="8751defb0216f199d7787b29733bb2c2";
logging-data="26258"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186jxD0fbhRfZrB2MW+gESD"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:zOEQoBy6RvFb0bl31tP+geEOXWI=
sha1:46YxRNAbAS3NOXnO3eVs8WDpGhw=
 by: Paul Rubin - Fri, 16 Jul 2021 10:21 UTC

"G.B." <bauhaus@notmyhomepage.invalid> writes:
> So, what is a proper testing strategy once the programmers have found
> that the transitive closure of some call might sometimes incur externally
> caused behavior? Such as timeout, or ordering effect due to concurrency?

Depending on the situation, this may be an area to try model checking.
I've been wanting to try Alloy (alloytools.org) but so far have only
clicked around its web site a little. It looks interesting.

Re: Ada and software testing

<b707f8a4-3c89-43e9-82cf-0bc82c033825n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5610&group=comp.lang.ada#5610

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:66d1:: with SMTP id m17mr117926qtp.146.1627486136426;
Wed, 28 Jul 2021 08:28:56 -0700 (PDT)
X-Received: by 2002:a25:b0a8:: with SMTP id f40mr329388ybj.253.1627486135964;
Wed, 28 Jul 2021 08:28:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 28 Jul 2021 08:28:55 -0700 (PDT)
In-Reply-To: <87pmvi36fv.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=185.38.247.134; posting-account=5xjsFAoAAACid1fWHbq16AFtrNLfsj6D
NNTP-Posting-Host: 185.38.247.134
References: <871r84cq4r.fsf@nightsong.com> <scrlec$h26$1@dont-email.me> <87pmvi36fv.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b707f8a4-3c89-43e9-82cf-0bc82c033825n@googlegroups.com>
Subject: Re: Ada and software testing
From: butc...@adacore.com (Paul Butcher)
Injection-Date: Wed, 28 Jul 2021 15:28:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Paul Butcher - Wed, 28 Jul 2021 15:28 UTC

Hi Paul,

If you haven't done already you may also want to have a look at: https://blog.adacore.com/advanced-fuzz-testing-with-aflplusplus-3-00

It's a follow blog to to the original R&D work around fuzz testing Ada programs and goes into more detail. It also contains an example of why fuzz testing Ada applications over C can actually identify more program anomalies (again by leveraging the power of the Ada runtime checks).

We're actually seeing a lot of interest in fuzz testing Ada programs and a commercial need for an industrial grade fuzz testing solution for Ada.

You may also want to have a look at ED-203A "Airworthiness Security Methods and Considerations" which is a set of guidelines around ED-202A "Airworthiness Security Process Specification". This report explicitly mentions fuzz testing as a means of identifying vulnerabilities and challenging security measures within airborne software.

In addition (and following on from a previous comment) one aspect we are very interested in exploring is being able to bolster existing unit test input data with a fuzzing campaign. Here we would take the existing test inputs and feed them into the fuzzer as the starting corpus (in an automated fashion).

Fuzz testing Ada programs may not currently be a thing, but it soon will be.... ;-)

Regards,
Paul Butcher
AdaCore

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor