comp.lang.ada
 help / color / mirror / Atom feed
From: Cyrille <comar@eu.adacore.com>
Subject: Re: Preventing type extensions
Date: Fri, 24 Sep 2010 02:27:53 -0700 (PDT)
Date: 2010-09-24T02:27:53-07:00	[thread overview]
Message-ID: <37ae2382-9f7d-4790-be5f-e380b9220d75@s19g2000vbr.googlegroups.com> (raw)
In-Reply-To: 9df21c09-f611-4088-811c-c092452adffc@e20g2000vbn.googlegroups.com

On Sep 24, 10:39 am, Cyrille <co...@eu.adacore.com> wrote:
> On Sep 24, 10:16 am, "J-P. Rosen" <ro...@adalog.fr> wrote:
>
> > and replace every redispatching call to M2 by a call to M2_Class, then
> > the big case disappears. You need (of course) to check coverage for
> > M2_Class, but M1 needs to be checked only for values of type T, not for
> > descendants. That's what I meant when I said that coverage testing drops
> > from N to 1
>
> OK, I kind of supposed you had something like that in mind. Many years
> ago, we proposed a similar idea in a few papers, See for instancehttp://www.adacore.com/wp-content/uploads/2006/03/Certification_OO_Ad....
> Another one written by Franco G. is even mentioned in Chelinsky's FAA
> study on OO (seehttp://www.tc.faa.gov/its/worldpac/techrpt/ar0717.pdf).
> The study is worth reading by the way... We had more automatic
> translation in mind at the time but the idea is the same.
> doing this

Sorry, I hit the send button inadvertently. I was going to say:

Suggesting to do such a transformation manually at the source code
level as you do is particularly dubious since it is in the category of
program transformations whose only purpose is to circumvent specific
verifications. There are many such transformations that have been
proposed to make MC/DC coverage easier... some would say to cheat on
MC/DC... and, not surprisingly, it is not very well perceived by cert
authorities.

Anyway, DO-178C doesn't impose "pessimistic testing" as the only way
to to verify safety of dispatching calls. It allows you to treat
dispatching calls as normal calls as long as you can show separately
that you have "local type consistency" (read LSP) for the types
involved in dispatching calls. This additional verification can be
done formally or using specifically designed tests such as verifying
that all the functional tests attached to a class also work when the
objects of this class involved in the testing  are substituted by
objects of the subclass.

If your class hierarchy hasn't been designed to respect LSP (or if you
are in a situation where you need to express properties that don't fit
well with LSP, such as the example Dmitry gave earlier) then you have
to go the pessimistic testing road. Why? because if you don't, there
is a real risk that a non-conforming subclass method misbehave on a
given dispatching call and standard coverage criteria doesn't
guarantee that you have covered such case. If you want to use the
"trick" you mention above, you better find a convincing reason at the
design level for such a "peculiar" style because the transformation
you suggest doesn't address the specific vulnerability that is
supposed to be addressed by either pessimistic testing or the
additional local type consitency verification.

To conclude about differentiating T and T'Class, the trick you suggest
here is easily implementable in other OO languages. There is nothing
magic in creating a wrapper around a given dispatching call and use
this wrapper at each dispatch point. The only problem is that it
doesn't address the (perceived) vulnerability and thus doesn't meet
properly the do-178c objective.



  reply	other threads:[~2010-09-24  9:27 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 10:18 Preventing type extensions Florian Weimer
2010-09-12 11:59 ` Ludovic Brenta
2010-09-12 12:53   ` Florian Weimer
2010-09-12 21:23     ` Maciej Sobczak
2010-09-13  5:32       ` Florian Weimer
2010-09-13  7:13         ` Dmitry A. Kazakov
2010-09-13  9:19           ` Georg Bauhaus
2010-09-13  9:42             ` Dmitry A. Kazakov
2010-09-13 10:23               ` Niklas Holsti
2010-09-13 12:55                 ` Cyrille
2010-09-13 13:55                   ` Dmitry A. Kazakov
2010-09-13 21:13                   ` J-P. Rosen
2010-09-21 13:57                     ` Cyrille
2010-09-21 14:19                       ` Dmitry A. Kazakov
2010-09-21 14:44                         ` Cyrille
2010-09-21 16:25                           ` Dmitry A. Kazakov
2010-09-21 17:11                             ` Georg Bauhaus
2010-09-21 18:11                               ` Dmitry A. Kazakov
2010-09-23 20:00                                 ` Simon Wright
2010-09-23 20:49                                   ` Dmitry A. Kazakov
2010-09-24  9:10                                     ` Georg Bauhaus
2010-09-24 10:24                                       ` Dmitry A. Kazakov
2010-09-24 13:30                                 ` Niklas Holsti
2010-09-24 16:27                                   ` Dmitry A. Kazakov
2010-09-24 17:47                                     ` Niklas Holsti
2010-09-24 19:42                                       ` Dmitry A. Kazakov
2010-09-21 14:32                       ` J-P. Rosen
2010-09-21 15:02                         ` Cyrille
2010-09-21 15:26                           ` J-P. Rosen
2010-09-21 16:18                             ` Cyrille
2010-09-22  8:01                               ` J-P. Rosen
2010-09-22 17:28                                 ` Cyrille
2010-09-22 19:30                                   ` Ludovic Brenta
2010-09-22 19:51                                     ` Florian Weimer
2010-09-22 20:14                                       ` Dmitry A. Kazakov
2010-09-22 20:25                                         ` Florian Weimer
2010-09-22 20:38                                           ` Dmitry A. Kazakov
2010-09-22 21:25                                             ` Vinzent Hoefler
2010-09-22 21:20                                           ` Georg Bauhaus
2010-09-22 20:16                                       ` Ludovic Brenta
2010-09-22 20:34                                         ` Florian Weimer
2010-09-22 22:45                                           ` Britt Snodgrass
2010-09-23  8:02                                           ` Ludovic Brenta
2010-09-23 16:51                                     ` Pascal Obry
2010-09-23 18:37                                       ` Florian Weimer
2010-09-23 18:55                                         ` Pascal Obry
2010-09-23 20:28                                       ` Ludovic Brenta
2010-09-24  9:20                                         ` Ludovic Brenta
2010-09-24 14:49                                           ` Simon Wright
2010-09-24 15:09                                             ` Ludovic Brenta
2010-09-24 16:21                                           ` Robert A Duff
2010-09-25  7:10                                         ` Pascal Obry
2010-09-25 12:03                                           ` Brian Drummond
2010-09-24  8:16                                   ` J-P. Rosen
2010-09-24  8:39                                     ` Cyrille
2010-09-24  9:27                                       ` Cyrille [this message]
2010-09-29 16:47                                         ` J-P. Rosen
2010-09-30 10:08                                           ` Cyrille
2010-10-05 17:02                                             ` J-P. Rosen
2010-10-08  7:50                                               ` Cyrille
2010-10-08 13:58                                               ` Cyrille
2010-10-08 20:12                                                 ` Dmitry A. Kazakov
2010-10-11  7:57                                                   ` Cyrille
2010-10-11  8:24                                                     ` Dmitry A. Kazakov
2010-10-12  5:23                                                   ` Shark8
2010-10-13  9:06                                                 ` J-P. Rosen
2010-10-13 17:37                                                   ` Cyrille
2010-10-13 18:50                                                     ` Dmitry A. Kazakov
2010-09-21 14:50                       ` (see below)
2010-09-21 17:37                         ` Cyrille
2010-09-21 19:07                           ` (see below)
2010-09-13 13:05                 ` Dmitry A. Kazakov
2010-09-13 20:21                   ` Niklas Holsti
2010-09-13 21:00                     ` Dmitry A. Kazakov
2010-09-13 21:10                 ` J-P. Rosen
2010-09-14 12:16                   ` Niklas Holsti
2010-09-14 16:46                     ` Dmitry A. Kazakov
2010-09-14 18:08                       ` Niklas Holsti
2010-09-14 18:32                         ` Niklas Holsti
2010-09-15  8:18                         ` Dmitry A. Kazakov
2010-09-14 17:04                     ` J-P. Rosen
2010-09-13 15:12               ` Securing type extensions (was: Preventing type extensions) Georg Bauhaus
2010-09-13 15:29                 ` Securing type extensions Dmitry A. Kazakov
2010-09-13 17:23                 ` Simon Wright
2010-09-13 20:22                   ` Georg Bauhaus
2010-09-13 20:41                     ` Dmitry A. Kazakov
2010-09-14 10:02                       ` Georg Bauhaus
2010-09-14 12:22                         ` Dmitry A. Kazakov
2010-09-14 21:18                           ` Georg Bauhaus
2010-09-15  8:15                             ` Dmitry A. Kazakov
2010-09-15 20:47                               ` Georg Bauhaus
2010-09-16  7:47                                 ` Dmitry A. Kazakov
2010-09-16 11:52                                   ` Georg Bauhaus
2010-09-16 12:45                                     ` Dmitry A. Kazakov
2010-09-16 20:53                                       ` Georg Bauhaus
2010-09-16 21:37                                         ` Dmitry A. Kazakov
2010-09-17  8:45                                           ` Georg Bauhaus
2010-09-17  9:39                                             ` Dmitry A. Kazakov
2010-10-05  5:59                     ` Randy Brukardt
2010-09-13 18:32           ` Preventing " Florian Weimer
2010-09-13 20:30             ` Dmitry A. Kazakov
2010-09-22 19:41               ` Florian Weimer
2010-09-22 20:34                 ` Dmitry A. Kazakov
2010-09-22 21:10                   ` Georg Bauhaus
2010-09-17  0:16           ` Shark8
2010-09-17  7:04             ` AdaMagica
2010-09-17 21:05               ` Shark8
replies disabled

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