comp.lang.ada
 help / color / mirror / Atom feed
From: Ken Garlington <GarlingtonKE@lmtas.lmco.com>
Subject: Re: Papers on the Ariane-5 crash and Design by Contract
Date: 1997/03/28
Date: 1997-03-28T00:00:00+00:00	[thread overview]
Message-ID: <333C4594.631E@lmtas.lmco.com> (raw)
In-Reply-To: E7ox17.MKx@syd.csa.com.au

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7754 bytes --]


Don Harrison wrote:
> 
> Before getting into this, let me say that I acknowledge that specifying
> assertions is largely futile unless they are tested. [Well, that's not
> strictly true because they have documentation value (though not much if not
> correct) and do help the developer become more aware of their assumptions.]
> 
> Ken Garlington writes:
> 
> :From this, I deduced (possibly erroneously) that Design by Contract
> :helps in the
> :precise specification of components, and that the implementation
> :language has
> :nothing to do with this specification.
> 
> At the risk of putting words into their mouths, I think Bertrand and Jean-Marc
> may mean Design by Contract in its richest sense as available in Eiffel and
> Sather rather than an impoverished version of it.

Exactly. This contradicts an earlier post by Mr. J�z�quel, to which I
was responding.

> If they are speaking of it
> in this sense, this statement is certainly true of any language that supports
> it fully. It's also true that the same benefit is available to a lesser degree
> in languages that support it in an impoverished form. The truth is, Ada
> developers use Design by Contract (of a kind) liberally as I'll explain below.

However, the paper (and Mr. Meyer, in posts to this thread) make it
clear that
Ada (including Ada95) is not adequate for Design by Contract.

> 
> They ought to make no excuse for believing in using the best available tools
> for that's what software engineering is about - using the best tools for the
> job in the most effective way to produce high quality software. This is the
> essence of genuine Design by Contract.
> 
> I now use contracting liberally in my own Ada development (well, I've always
> used subtypes, but now use more general assertions as well) and I'm convinced it
> more than pays for itself in reduced integration time. Granted, they take extra
> effort to design and debug but it's more than offset by easier testing.
> 
> So, what is meant by "Design by Contract in its richest sense". Assertions
> that are:
> 
>   1) Built-in because
>      - It's easier to automatically document the specification.
>      - It's easier to visually differentiate assertions from mandatory code.
>      - Developers are more likely to use them, IMO. ["IMO" only because, while
>        obviously true, it is difficult to prove.  :( ]
> 
>   2) General because
>      - They allow you to specify at any level of abstraction (high to low).
>      - They allow you to specify virtually any specification (anything
>        expressible as a boolean expression - not just range constraints on
>        discrete types).
> 
>   3) Inheritable because
>      - The specification is propagated into descendants causing it to be
>        automatically reused and enforced. Because descendants are forced to
>        honour contracts, you can be confident they will behave correctly
>        (provided the software is tested, of course).
> 
> :To summarize from the post, they are:
> :
> :1. Being ABLE to specify the assumption does not mean that the
> :   assumption WILL be specified.
> 
> True. You can put an electric drill in someone's hands and they can
> (without plugging it in) gouge a hole by manually turning it, but it would be
> a whole lot easier if they just turned the power on and used it properly.

I'm afraid I don't understand this argument. You consider writing code
easier than not writing code?

> 
> :There is evidence it would not have
> :   been specified, even using Design by Contract.
> 
> I consider this unlikely. Assuming a reasonably-designed system, a contract
> testing for this abnormal behaviour would be expressible at some level of
> abstraction.

You are free to consider this unlikely. However, there are specific
statements
in the final report that support this assertion. See the referenced
earlier
post. If you have evidence to the contrary, you may want to address this
point in more detail.

> 
> :2. SPECIFYING the assumption does not mean that a violation of the
> :   assumption will be DETECTED. There is evidence that it would not
> :   have been detected before flight.
> 
> Agree. An assumption will only be detected if tested.
> 
> :3. Even if the problem was DETECTED, there is no guarantee that the
> :   appropriate ACTION would have been taken. There is evidence that
> :   an incorrect action would have been taken.
> 
> Agree. Appropriate action will only be taken if the exception handler is
> designed to cater for the misadventure.
> 
> However, also true is the fact that if you specify contracts you will detect
> *as many* and, likely, *more* errors (providing testing is adequate etc. etc.)
> than if you do not specify them.

Yes, absolutely.

However, again, my comments are directed at the paper Mr. Meyer and Mr.
J�z�quel regading a *specific* application of contracts in a *specific*
context. Based on that *context*, I believe their conclusions are in
error.
 
> 
> Now, before explaining this, let's clear something up. Many Ada developers
> already use (a specific kind of) Design by Contract day-in-day-out without even
> realising it. Some contributors to this thread have indicated that Ada
> programmers specify their own contracts by declaring Ada subtypes. But subtypes
> are not the only way they use contracting. They also use a swag of pre-defined
> contracts provided by the language environment. To identify them, we need to
> take a look at Ada's predefined exceptions. We see that each one specifies a
> specific kind of contract (sorry this is only Ada-83 - there are probably more
> in Ada-95):
> 
> 1) constraint_error: a contract specifying that
>    - The allowable bounds of a discrete type (subtype, array index) will not
>      be exceeded, or
>    - A record variant will only exist for a specific discriminant value
>    - etc.
> 
> 2) numeric_error: a contract specifying that
>     - A floating point value will be within the bounds of the type.
> 
> 3) program_error: a contract specifying
>    - The unit ('object') containing the operation called will have been
>      initialised, or
>    - A function will return (a postcondition)
>    - etc.
> 
> 4) storage_error: a contract specifying
>    - That a task will not exceed its allocated storage, or
>    - The heap will not exhausted
>    - etc.
> 
> Well, you get the picture. Probably, the reason some Ada developers have
> trouble seeing how they can benefit from Design by Contract is because they're
> oblivious to the fact that they already use it liberally in the form of
> predefined contracts (and reap the benefits of it)!
> 
> While it's good that Ada is rich in specific pre-defined contracts, it
> disappoints in that it doesn't offer the full power and flexibility of
> *user-defined* contracts in the way Eiffel does. If it did, then it would
> be easier to specify the more general kind of assertion that would expose
> the kinds of dysfunction that may go unnoticed in an assertion-less Ada
> program.

Again, in the *context* of the paper:

1. As the paper explicitly states, Ada was adequate for this type of
error.

2. The paper does not make the case that "making it easier to specify"
the
   right assertion would have led to saving the Ariane 5, as it claims.
   As you noted, there are critical holes in the path from "able to
   specify" to "fault detected" which would have avoided the crash.
   Apparently, I think there's more holes than you, but we appear to
   agree there were sufficient holes.

> 
> Don.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Don Harrison             donh@syd.csa.com.au

--
LMTAS - The Fighter Enterprise - "Our Brand Means Quality"
For job listings, other info: http://www.lmtas.com or
http://www.lmco.com




  parent reply	other threads:[~1997-03-28  0:00 UTC|newest]

Thread overview: 254+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-15  0:00 Papers on the Ariane-5 crash and Design by Contract Bertrand Meyer
1997-03-18  0:00 ` Ariane-5: can you clarify? (Re: Please do not start a language war) Jon S Anthony
1997-03-19  0:00 ` Papers on the Ariane-5 crash and Design by Contract Chris Brand
     [not found] ` <tz8ohcjv7cc.fsf@aimnet.com>
1997-03-16  0:00   ` Robert Dewar
1997-03-17  0:00     ` Please do not start a language war (was " Jean-Marc Jezequel
     [not found]       ` <tz8913l930b.fsf_-_@aimnet.com>
1997-03-18  0:00         ` Ariane-5: can you clarify? (Re: Please do not start a language war) Gavin Collings
1997-03-18  0:00         ` Ariane-5: can you clarify? (Re: Please do not start a language war Roedy Green
1997-03-18  0:00       ` Please do not start a language war (was Re: Papers on the Ariane-5 crash and Design by Contract Ken Garlington
     [not found]         ` <199703190839.JAA02652@stormbringer.irisa.fr>
1997-03-19  0:00           ` Ken Garlington
1997-03-20  0:00             ` Roger T.
1997-03-21  0:00               ` Ken Garlington
1997-03-21  0:00               ` Jean-Marc Jezequel
1997-03-24  0:00                 ` Ken Garlington
1997-03-20  0:00             ` Robert S. White
1997-03-20  0:00               ` John L. Ahrens
1997-03-20  0:00               ` Martin Tom Brown
1997-03-21  0:00                 ` Wolfgang Gellerich
1997-03-21  0:00                 ` Robert S. White
1997-03-19  0:00         ` Jean-Marc Jezequel
1997-03-19  0:00           ` Richard Kaiser
1997-03-21  0:00           ` Ken Garlington
1997-03-21  0:00             ` Jean-Marc Jezequel
1997-03-25  0:00               ` Ken Garlington
1997-03-26  0:00                 ` Trust but verify " Robert S. White
1997-03-25  0:00                   ` Bertrand Meyer
1997-03-26  0:00                     ` Robb Nebbe
1997-03-27  0:00                     ` Ken Garlington
1997-03-28  0:00                       ` Karel Th�nissen
1997-03-28  0:00                         ` Ken Garlington
1997-04-07  0:00                           ` Jean-Marc Jezequel
1997-03-28  0:00                       ` Jeffrey W. Stulin
1997-03-31  0:00                         ` Ken Garlington
1997-03-29  0:00                     ` the one and only real true kibo
1997-03-18  0:00       ` Please do not start a language war " Richard Irvine
1997-03-17  0:00   ` John McCabe
     [not found]     ` <tz8n2s1hrdc.fsf@aimnet.com>
1997-03-20  0:00       ` John McCabe
1997-03-20  0:00       ` John McCabe
1997-03-20  0:00         ` Jean-Marc Jezequel
1997-03-20  0:00           ` John McCabe
1997-03-21  0:00             ` Niall Cooling
1997-03-21  0:00               ` Gavin Collings
1997-03-27  0:00                 ` Joachim Durchholz
1997-04-03  0:00                   ` Gavin Collings
1997-04-03  0:00                     ` Ken Garlington
1997-04-04  0:00                       ` Derek Clarke
1997-04-04  0:00                     ` Derek Clarke
1997-04-06  0:00                       ` Robert Dewar
1997-04-07  0:00                         ` Ken Garlington
1997-04-09  0:00                           ` Gavin Collings
1997-04-03  0:00                   ` Robert I. Eachus
1997-04-04  0:00                     ` Derek Clarke
1997-04-04  0:00                     ` Chris Beer
1997-04-04  0:00                   ` Ken Garlington
1997-04-04  0:00                     ` Robert Dewar
1997-04-03  0:00                 ` Robin Rosenberg
1997-03-24  0:00             ` Ken Garlington
1997-03-26  0:00           ` Thomas Beale
1997-03-26  0:00             ` Ken Garlington
1997-03-21  0:00       ` "Paul E. Bennett"
1997-03-22  0:00     ` Nigel Tzeng
1997-03-23  0:00       ` John McCabe
1997-03-17  0:00   ` Paul Johnson
1997-03-17  0:00     ` Enrico Facchin - Sartori E.T.
1997-03-19  0:00       ` Anders Pytte
1997-03-18  0:00     ` Ken Garlington
1997-03-17  0:00   ` Nick Leaton
1997-03-17  0:00     ` Richard Kaiser
1997-03-18  0:00     ` Richard Kaiser
1997-03-18  0:00       ` Nick Leaton
1997-03-19  0:00         ` Richard Kaiser
1997-03-19  0:00           ` Jean-Marc Jezequel
1997-03-19  0:00             ` Richard Kaiser
1997-03-19  0:00           ` Fergus Henderson
1997-03-18  0:00       ` Jean-Marc Jezequel
1997-03-19  0:00         ` Ken Garlington
1997-03-18  0:00     ` Richard Kaiser
1997-03-18  0:00       ` Nick Leaton
1997-03-18  0:00         ` "Paul E. Bennett"
1997-03-19  0:00           ` Nick Leaton
1997-03-24  0:00           ` Joachim Durchholz
1997-03-25  0:00             ` Robert Dewar
1997-03-31  0:00               ` Joachim Durchholz
1997-04-02  0:00                 ` Robert Dewar
1997-04-03  0:00                   ` Martin Tom Brown
1997-04-04  0:00                   ` Derek Clarke
1997-04-04  0:00                   ` Jonathan Egre'
1997-04-06  0:00                     ` Robert Dewar
1997-04-06  0:00                       ` Nick Roberts
1997-03-31  0:00               ` Jan Galkowski
1997-03-31  0:00             ` Alexander Anderson
1997-04-01  0:00             ` Alexander Anderson
1997-04-02  0:00             ` Ken Garlington
1997-03-20  0:00         ` John the Hamster
     [not found]     ` <tz8g1xtzx9y.fsf@aimnet.com>
1997-03-18  0:00       ` Anders Pytte
1997-03-18  0:00         ` Jean-Marc Jezequel
1997-03-18  0:00           ` Anders Pytte
1997-03-19  0:00             ` Programming language fanaticism! Louis Bastarache
1997-03-20  0:00               ` Anders Pytte
1997-03-20  0:00             ` Papers on the Ariane-5 crash and Design by Contract Matt Kennel (Remove 'nospam' to reply)
1997-03-24  0:00             ` Joachim Durchholz
1997-03-24  0:00               ` Anders Pytte
1997-03-26  0:00                 ` Robert Dewar
1997-03-27  0:00                   ` the one and only real true kibo
1997-03-29  0:00                   ` the one and only real true kibo
1997-03-29  0:00                     ` Nick S Bensema
1997-03-30  0:00                       ` the one and only real true kibo
1997-03-26  0:00                 ` Matt Kennel (Remove 'nospam' to reply)
1997-03-29  0:00                   ` Anders Pytte
1997-03-29  0:00                     ` Steve Furlong
1997-03-18  0:00           ` Anders Pytte
1997-03-21  0:00           ` Ken Garlington
1997-03-21  0:00             ` Bertrand Meyer
1997-03-21  0:00               ` William Clodius
1997-03-21  0:00                 ` Bertrand Meyer
1997-03-23  0:00                   ` the one and only real true kibo
1997-03-23  0:00                   ` William Clodius
1997-03-22  0:00               ` Fergus Henderson
1997-03-22  0:00                 ` Bertrand Meyer
1997-03-23  0:00                   ` the one and only real true kibo
1997-03-23  0:00                     ` Anders Pytte
1997-03-24  0:00                   ` FUD (Re: Papers on the Ariane-5 crash and Design by Contract) Alexander Anderson
1997-03-24  0:00                   ` Alexander Anderson
1997-03-23  0:00               ` Papers on the Ariane-5 crash and Design by Contract Anders Pytte
     [not found]                 ` <3335BC24.13728473@eiffel.com>
1997-03-23  0:00                   ` Bertrand Meyer
1997-03-24  0:00                     ` Robert Dewar
1997-03-31  0:00                       ` Ken Garlington
1997-04-01  0:00                         ` Bertrand Meyer
1997-03-25  0:00                     ` Ken Garlington
1997-03-24  0:00                 ` the one and only real true kibo
1997-03-24  0:00                 ` Ken Garlington
1997-03-24  0:00               ` John Hogg
1997-03-24  0:00               ` Ken Garlington
1997-03-26  0:00                 ` Robert Dewar
1997-03-26  0:00                   ` Ken Garlington
     [not found]                     ` <E7ox17.MKx@syd.csa.com.au>
1997-03-28  0:00                       ` Ken Garlington [this message]
1997-03-18  0:00         ` Laurent Moussault
1997-03-17  0:00   ` Alexander Anderson
1997-03-17  0:00   ` Bertrand Meyer
1997-03-18  0:00     ` John McCabe
1997-03-18  0:00       ` Ray McVay
1997-03-27  0:00         ` Robert Dewar
1997-03-29  0:00           ` the one and only real true kibo
1997-03-30  0:00             ` Nick Roberts
1997-04-06  0:00             ` Doctorb
1997-04-08  0:00         ` Ron Crocker
1997-04-11  0:00           ` Richard Riehle
1997-03-17  0:00   ` Please do not start a language war (was " Jon S Anthony
1997-03-18  0:00     ` Kent Tong
1997-03-20  0:00       ` Ranan Fraer
1997-03-17  0:00   ` Robert I. Eachus
1997-03-17  0:00     ` Martin Tom Brown
1997-03-18  0:00   ` Jon S Anthony
1997-03-18  0:00   ` Jon S Anthony
1997-03-19  0:00     ` Ron Forrester
1997-03-21  0:00       ` Ken Garlington
1997-03-22  0:00         ` Ron Forrester
1997-03-18  0:00   ` Jon S Anthony
1997-03-18  0:00   ` Ulrich Windl
1997-03-18  0:00   ` Robert I. Eachus
1997-03-18  0:00   ` Tarjei Jensen
1997-03-18  0:00   ` Jon S Anthony
1997-03-18  0:00   ` Ken Garlington
1997-03-19  0:00     ` Eric M. Boyd
1997-03-19  0:00       ` Jeffrey W. Stulin
     [not found]       ` <3345cd60.2092398@news.sydney.apana.org.au>
1997-04-03  0:00         ` Ariane-5 crash , Eiffel and Ada Jeffrey W. Stulin
1997-04-03  0:00         ` Nick Leaton
1997-04-08  0:00         ` AdaWorks
1997-03-19  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) Karel Th�nissen
1997-03-19  0:00   ` Papers on the Ariane-5 crash and Design by Contract Karel Th�nissen
1997-03-19  0:00   ` Jon S Anthony
1997-03-20  0:00     ` Jean-Marc Jezequel
1997-03-24  0:00       ` Ken Garlington
1997-03-20  0:00     ` Paul Johnson
1997-03-24  0:00       ` Ken Garlington
1997-03-24  0:00         ` Design by Contract in C++ (was Re: Papers on the Ariane-5 crash and Design by Contract) Anders Pytte
1997-03-19  0:00   ` Papers on the Ariane-5 crash and Design by Contract Nick Leaton
1997-03-19  0:00   ` Jon S Anthony
1997-03-19  0:00   ` Karel Th�nissen
1997-03-19  0:00   ` Ken Garlington
1997-03-19  0:00   ` Ken Garlington
1997-03-20  0:00     ` Richard Kaiser
1997-03-24  0:00       ` Ken Garlington
1997-03-20  0:00     ` Martin Tom Brown
1997-03-21  0:00       ` Frank Manning
1997-03-21  0:00         ` Martin Tom Brown
1997-03-23  0:00           ` Frank Manning
1997-03-25  0:00             ` Ken Garlington
1997-03-20  0:00   ` Robert I. Eachus
1997-03-20  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) Nick Leaton
1997-03-20  0:00   ` Karel Th�nissen
1997-03-20  0:00   ` Nick Leaton
1997-03-20  0:00   ` Papers on the Ariane-5 crash and Design by Contract Robert I. Eachus
1997-03-21  0:00   ` Ulrich Windl
     [not found]   ` <tz8sp1qiywm.fsf@aimnet.com>
1997-03-21  0:00     ` ae59
1997-03-21  0:00   ` Alexander Anderson
1997-03-23  0:00     ` "Paul E. Bennett"
1997-03-21  0:00   ` Please do not start a language war (was " Jon S Anthony
1997-03-22  0:00   ` Bertrand Meyer
1997-03-22  0:00     ` Anders Pytte
1997-03-23  0:00       ` Steve Furlong
1997-03-24  0:00         ` Anders Pytte
1997-03-24  0:00           ` Simulating Eiffel-style assertions (was: Papers on the Ariane-5 crash and Design by Contract) Wolfgang Reddig
1997-03-24  0:00             ` Anders Pytte
1997-03-25  0:00               ` Wolfgang Reddig
1997-03-25  0:00                 ` Anders Pytte
1997-03-31  0:00                 ` Joachim Durchholz
1997-03-26  0:00             ` Alan Brain
1997-03-26  0:00               ` Wolfgang Reddig
1997-03-29  0:00                 ` How old time languages survive EJon
1997-03-22  0:00   ` Papers on the Ariane-5 crash and Design by Contract Bertrand Meyer
1997-03-23  0:00     ` Dale Stanbrough
     [not found]       ` <3335E18E.33590565@eiffel.com>
1997-03-23  0:00         ` FUD (Re: Papers on the Ariane-5 crash and Design by Contract) Bertrand Meyer
1997-03-24  0:00           ` William Grosso
1997-03-24  0:00             ` William Clodius
1997-03-24  0:00             ` Bertrand Meyer
1997-03-24  0:00             ` Brad Appleton
1997-03-24  0:00     ` Papers on the Ariane-5 crash and Design by Contract Robert Dewar
1997-03-24  0:00       ` Manners (was Re: Papers on the Ariane-5 crash and Design by Contract) Bertrand Meyer
1997-03-25  0:00         ` the one and only real true kibo
1997-03-22  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) Stuart Yeates
1997-03-22  0:00   ` Papers on the Ariane-5 crash and Design by Contract Jon S Anthony
1997-03-28  0:00     ` Matt Kennel (Remove 'nospam' to reply)
1997-03-24  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) Ken Garlington
1997-03-24  0:00   ` Papers on the Ariane-5 crash and Design by Contract Jon S Anthony
1997-03-24  0:00   ` Ken Garlington
1997-03-24  0:00   ` Alexander Anderson
1997-03-24  0:00   ` Ken Garlington
1997-03-27  0:00     ` Joachim Durchholz
1997-03-31  0:00       ` Ken Garlington
1997-04-06  0:00         ` Joachim Durchholz
1997-03-24  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) Nick Leaton
1997-03-24  0:00   ` Ken Garlington
1997-03-24  0:00   ` Papers on the Ariane-5 crash and Design by Contract Ken Garlington
1997-03-24  0:00   ` Robb Nebbe
1997-03-24  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) William Clodius
1997-03-25  0:00   ` Papers on the Ariane-5 crash and Design by Contract Robert I. Eachus
1997-03-25  0:00   ` Ariane-5: can you clarify? (Re: Please do not start a language war) Ken Garlington
1997-03-25  0:00   ` David Starr
1997-03-25  0:00   ` Ken Garlington
1997-03-26  0:00   ` Papers on the Ariane-5 crash and Design by Contract Ken Garlington
1997-03-26  0:00   ` Alexander Anderson
1997-03-26  0:00   ` Jon S Anthony
1997-03-27  0:00   ` Trust but verify (was " Robert I. Eachus
1997-03-28  0:00   ` Robert I. Eachus
1997-03-28  0:00   ` Jon S Anthony
1997-03-31  0:00   ` Ken Garlington
1997-03-23  0:00 ` the one and only real true kibo
  -- strict thread matches above, loose matches on Subject: below --
1997-03-17  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-03-20  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-03-25  0:00 ` Nick Roberts
1997-03-24  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-03-27  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-04-03  0:00 Adrian B.Y. Hoe
1997-04-05  0:00 ` Nick Roberts
replies disabled

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