comp.lang.ada
 help / color / mirror / Atom feed
From: cmcknigh@hercii.lasc.lockheed.com (Chris McKnight)
Subject: Re: Ariane 5 failure
Date: 1996/09/29
Date: 1996-09-29T00:00:00+00:00	[thread overview]
Message-ID: <1996Sep29.193602.17369@enterprise.rdd.lmsc.lockheed.com> (raw)
In-Reply-To: DyE738.Hzz@beaver.cs.washington.edu


In article Hzz@beaver.cs.washington.edu, pattis@cs.washington.edu (Richard Pattis) writes:
>As an instructor in CS1/CS2, this discussion interests me. I try to talk about
>designing robust, reusable code, and actually have students reuse code that
>I have written as well as some that they (and their peers) have written.
>The Ariane falure adds a new view to robustness, having to do with future
>use of code, and mathematical proof vs "engineering" considerations..

  An excellent bit of teaching, IMHO. Glad to hear they're putting some
  more of the real world issues in the class room.

>Should a software engineer remove safety checks if he/she can prove - based on
>physical limitations, like a rocket not exceeding a certain speed - that they
>are unnecessary. Or, knowing that his/her code will be reused (in an unknown
>context, by someone who is not so skilled, and will probably not think to
>redo the proof) should such checks not be optimized out? What rule of thumb
>should be used to decide (e.g., what if the proof assumes the rocket speed
>will not exceed that of light)? Since software operates in the real world (not
>the world of mathematics) should mathematical proofs about code always yield
>to engineering rules of thumb to expect the unexpected.

 A good question.  For the most part, I'd go with engineering rules of thumb
 (what did you expect, I'm an engineer).  As an engineer, you never know what
 may happen in the real world (in spite of what you may think), so I prefer
 error detection and predictable recovery.  The key factors to consider include
 the likelihood and the cost of failures, and the cost of leaving in (or adding
 where your language doesn't already provide it) the checks.

 Consider these factors, likelihood and cost of failures:

    In a real-time embedded system, both of these factors are often high.  Of
    the two, I think people most often get caught on misbeliefs on likelihood of
    failure.  As an example, I've argued more than once with engineers who think
    that since a device is only "able" to give them a value in a certain range, 
    they needn't check for out of range values.  I've seen enough failed hardware
    to know that anything is possible, regardless of what the manufacturer may
    claim.  Consider your speed of light example, what if the sensor goes bonkers
    and tells you that you're going faster?  Your "proof" that you can't get that
    value falls apart then.  Your point about reuse is also well made.  Who knows
    what someone else may want to use your code for?

    As for cost of failure, it's usually obvious; in dollars, in lives, or both.
 
 As for cost of leaving checks in (or putting them in):

    IMHO, the cost is almost always insignificant.  If the timing is so tight that 
    removing checks makes the difference, it's probably time to redesign anyway.
    Afterall, in the real world there's always going to be fixes, new features, 
    etc.. that need to be added later, so you'd better plan for it.  Also, it's
    been my experience that removing checks is somewhere in the single digits
    on % improvement.  If you're really that tight, a good optimizer can yield
    10%-15% or more (actual mileage may vary of course).  But again, if that
    makes the difference, you'd better rethink your design.
   
 So the rule of thumb I use is, unless a device is not physically capable (as
 opposed to theoretically capable) of giving me out of range data, I'm going
 to range check it.  I.E. if there's 3 bits, you'd better check for 8 values
 regardless of the number of values you think you can get.

 That having been said, it's often not up to the engineer to make these 
 decisions.  Such things as political considerations, customer demands, and 
 (more often than not) management decisions  have been known to succeed in
 convincing me to turn checks off.  As a rule, however, I fight to keep them
 in, at very least through development and integration. 

>  As to saving SPEED by disabling the range checks: did the code not meet its
>speed requirements with range checks on? Only in this case would I have turned
>them off. Does "real time" mean fast enough or as fast as possible? To
>misquote Einstein, "Code should run as fast as necessary, but no faster...."
>since something is always traded away to increase speed.

  Precisely!  And when what's being traded is safety, it's not worth it.


  Cheers,

     Chris


=========================================================================

"I was gratified to be able to answer promptly.  I said I don't know".  
  -- Mark Twain

=========================================================================





  reply	other threads:[~1996-09-29  0:00 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <agrapsDy4oJH.29G@netcom.com>
1996-09-25  0:00 ` Ariane 5 failure @@           robin
1996-09-25  0:00   ` Michel OLAGNON
1996-09-25  0:00     ` Chris Morgan
1996-09-25  0:00     ` Byron Kauffman
1996-09-25  0:00       ` A. Grant
1996-09-25  0:00         ` Ken Garlington
1996-09-26  0:00         ` Sandy McPherson
1996-09-26  0:00         ` Byron Kauffman
1996-09-27  0:00           ` A. Grant
1996-09-25  0:00   ` Bob Kitzberger
1996-09-26  0:00     ` Ronald Kunne
1996-09-26  0:00       ` Matthew Heaney
1996-09-27  0:00         ` Wayne Hayes
1996-09-27  0:00           ` Richard Pattis
1996-09-29  0:00             ` Chris McKnight [this message]
1996-09-29  0:00               ` Real-world education (was: Ariane 5 failure) Michael Feldman
1996-09-29  0:00             ` Ariane 5 failure Alan Brain
1996-09-29  0:00             ` Dann Corbit
1996-10-01  0:00             ` Ken Garlington
1996-09-27  0:00         ` Ronald Kunne
1996-09-27  0:00           ` Lawrence Foard
1996-10-04  0:00             ` @@           robin
1996-09-28  0:00           ` Ken Garlington
1996-09-28  0:00             ` Ken Garlington
1996-09-29  0:00           ` Alan Brain
1996-09-29  0:00             ` Robert A Duff
1996-09-30  0:00               ` Wayne L. Beavers
1996-10-01  0:00                 ` Ken Garlington
1996-10-01  0:00                   ` Wayne L. Beavers
1996-10-01  0:00                     ` Ken Garlington
1996-10-02  0:00                       ` Sandy McPherson
1996-10-03  0:00                 ` Richard A. O'Keefe
1996-10-01  0:00             ` Ken Garlington
1996-09-28  0:00         ` Ken Garlington
1996-09-27  0:00       ` Ken Garlington
1996-09-27  0:00       ` Alan Brain
1996-09-28  0:00         ` Ken Garlington
1996-09-29  0:00       ` Louis K. Scheffer
1996-09-27  0:00   ` John McCabe
1996-10-01  0:00     ` Michael Dworetsky
1996-10-04  0:00       ` Steve Bell
1996-10-07  0:00         ` Ken Garlington
1996-10-09  0:00         ` @@           robin
1996-10-09  0:00           ` Steve O'Neill
1996-10-12  0:00             ` Alan Brain
1996-10-04  0:00     ` @@           robin
1996-10-04  0:00       ` Joseph C Williams
1996-10-06  0:00         ` Wayne Hayes
1996-10-04  0:00       ` Michel OLAGNON
1996-10-09  0:00         ` @@           robin
1996-10-17  0:00       ` Ralf Tilch
1996-10-17  0:00         ` Ravi Sundaram
1996-10-22  0:00           ` shmuel
1996-10-22  0:00             ` Jim Carr
1996-10-24  0:00               ` hayim
1996-10-25  0:00                 ` Michel OLAGNON
1996-10-25  0:00                 ` Ken Garlington
1996-10-01  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-02  0:00 ` Matthew Heaney
1996-10-04  0:00   ` Ken Garlington
1996-10-05  0:00     ` Robert Dewar
1996-10-06  0:00       ` Keith Thompson
1996-10-10  0:00       ` Ken Garlington
1996-10-14  0:00       ` Matthew Heaney
1996-10-15  0:00         ` Robert Dewar
1996-10-16  0:00         ` Ken Garlington
1996-10-18  0:00           ` Keith Thompson
1996-10-18  0:00             ` Ken Garlington
1996-10-18  0:00             ` Samuel T. Harris
1996-10-21  0:00               ` Ken Garlington
1996-10-23  0:00           ` robin
1996-10-02  0:00 ` Robert I. Eachus
1996-10-02  0:00   ` Ken Garlington
  -- strict thread matches above, loose matches on Subject: below --
1996-10-01  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-02  0:00 ` Ken Garlington
1996-10-01  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-02  0:00 ` Alan Brain
1996-10-02  0:00   ` Ken Garlington
1996-10-02  0:00     ` Matthew Heaney
1996-10-04  0:00       ` Robert S. White
1996-10-05  0:00         ` Alan Brain
1996-10-06  0:00           ` Robert S. White
1996-10-05  0:00         ` Robert Dewar
1996-10-03  0:00     ` Alan Brain
1996-10-04  0:00       ` Ken Garlington
1996-10-03  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-03  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-03  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-14  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-15  0:00 ` Robert I. Eachus
1996-10-15  0:00   ` Robert Dewar
1996-10-16  0:00     ` Michael F Brenner
1996-10-16  0:00       ` Robert Dewar
1996-10-23  0:00 ` robin
1996-10-16  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-18  0:00 ` Ken Garlington
1996-10-19  0:00   ` Frank Manning
1996-10-21  0:00     ` Norman H. Cohen
1996-10-21  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-10-22  0:00 ` Adam Beneschan
1996-10-28  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1996-10-28  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1996-10-29  0:00 ` Ken Garlington
1996-11-08  0:00   ` robin
1996-10-31  0:00 Marin David Condic, 561.796.8997, M/S 731-93
replies disabled

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