comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pcc482719@gmail.com>
Subject: SPARK and testing. Was: Lost in translation (with SPARK user rules)
Date: Fri, 28 May 2010 07:57:46 -0400
Date: 2010-05-28T07:57:46-04:00	[thread overview]
Message-ID: <4bffaed5$0$2378$4d3efbfe@news.sover.net> (raw)
In-Reply-To: 4bfebb3f$0$27571$ba4acef3@reader.news.orange.fr

Pascal Obry wrote:

> Just curious, why do you feel that you still need to write tests after
> having run successfully the SPARK proof checker?

Despite the proofs testing is still essential. At least that is my view. Here
is why:

1. The proofs show that the subprograms obey the annotations that I provide.
However, there is nothing that I'm doing that formally links those
annotations to the actual intended purpose of my code. My code might be
correctly implemented (proved) but perhaps it correctly implements the wrong
thing. I realize there are formal methods that address this issue, but I'm
not using them.

2. The proofs only show that the source code is, in some sense, correct.
However, they say nothing about the correctness of the code generated by the
compiler or about how that code will interact with the operating system or
hardware. Testing isn't as exhaustive as proof but it is a "top to bottom"
method of checking one's code. If a test succeeds, the entire execution stack
worked properly... for that case at least. My code tends to interact with
hardware in a very low level way. What if I misunderstood what I read in the
hardware data sheets? SPARK can't help me with that misunderstanding.

3. Some of what I want to test are "non-functional" requirements such as
execution speed and memory consumption. There are also some usability issues
to consider. It seems like these things are outside SPARK's domain.

4. I might get lazy or run out of time and not complete all the proofs. After
a while testing becomes the easier path. I could believe that the rate of bug
elimination per unit of development time might improve by switching over to
testing before every single VC has been discharged. Of course this will
depend on how experienced one is with the tools (and with testing), so I'm
not sure if this is really true or not.

In summary I've concluded that no matter how nifty it is to prove one's code
using a tool like SPARK, testing remains a necessary step in the production
of quality software. SPARK is great but it has a limited scope of
applicability; there are important things that SPARK has nothing to say
about. So I write test programs.

Recently a collague of mine pointed me to the following article about recent
radiation therapy machine accidents:

http://www.nytimes.com/2010/01/24/health/24radiation.html?pagewanted=all

He commented that SPARK might have helped to avoid those accidents. Based on
my understanding of the article, I agree that SPARK might have been helpful
to a degree. However, some of the problems that occurred were really related
to poor user interface decisions and poor hospital procedures. I don't see
how SPARK could have helped with that. However, appropriate user testing
might have caught some of the problems.

It seems to me that SPARK is all about building a correct *implementation*,
but it says nothing about the correctness of the design.

Peter




  parent reply	other threads:[~2010-05-28 11:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26 10:09 Lost in translation (with SPARK user rules) Yannick Duchêne (Hibou57)
2010-05-26 10:38 ` Phil Thornley
2010-05-26 10:57   ` Yannick Duchêne (Hibou57)
2010-05-26 14:15     ` Pascal Obry
2010-05-26 14:28       ` Dmitry A. Kazakov
2010-05-26 19:28         ` Yannick Duchêne (Hibou57)
2010-05-26 20:14           ` Dmitry A. Kazakov
2010-05-26 21:14             ` Yannick Duchêne (Hibou57)
2010-05-26 21:15               ` Yannick Duchêne (Hibou57)
2010-05-26 22:01             ` Peter C. Chapin
2010-05-27 12:32               ` Mark Lorenzen
2010-05-27 18:34               ` Pascal Obry
2010-05-27 19:18                 ` Yannick Duchêne (Hibou57)
2010-05-28  9:39                 ` Maciej Sobczak
2010-05-28 11:57                 ` Peter C. Chapin [this message]
2010-05-28 12:59                   ` SPARK and testing Peter C. Chapin
2010-05-28 23:06                     ` Yannick Duchêne (Hibou57)
2010-05-26 19:16       ` Lost in translation (with SPARK user rules) Yannick Duchêne (Hibou57)
2010-05-26 19:32         ` Pascal Obry
2010-05-26 20:56           ` Yannick Duchêne (Hibou57)
2010-05-26 22:06           ` Peter C. Chapin
2010-05-27 18:39             ` Pascal Obry
2010-05-26 22:17         ` Peter C. Chapin
2010-05-27 10:11       ` Sockets package in SPARK (Was: Lost in translation (with SPARK user rules)) Jacob Sparre Andersen
2010-05-27 18:41         ` Pascal Obry
2010-05-27 19:20           ` Yannick Duchêne (Hibou57)
2010-05-28  7:43             ` Sockets package in SPARK Jacob Sparre Andersen
2010-05-27  8:13     ` Lost in translation (with SPARK user rules) Yannick Duchêne (Hibou57)
2010-05-27 10:55       ` Yannick Duchêne (Hibou57)
2010-05-27 11:32         ` Yannick Duchêne (Hibou57)
2010-05-27 11:41           ` Phil Thornley
2010-05-27 12:42             ` Yannick Duchêne (Hibou57)
2010-05-27 12:22         ` stefan-lucks
2010-05-27 11:37           ` Yannick Duchêne (Hibou57)
2010-05-27 11:57           ` Phil Thornley
2010-05-27 12:36             ` Yannick Duchêne (Hibou57)
2010-05-27 13:38               ` Phil Thornley
2010-06-03  2:44                 ` Yannick Duchêne (Hibou57)
2010-05-27 19:53 ` Warren
2010-05-29 23:03 ` Yannick Duchêne (Hibou57)
2010-05-30  6:55   ` Yannick Duchêne (Hibou57)
2010-05-30  9:30     ` Phil Thornley
2010-05-30  9:46       ` Yannick Duchêne (Hibou57)
2010-05-30  9:26   ` Phil Thornley
2010-05-30  9:57     ` Yannick Duchêne (Hibou57)
2010-06-01  5:42 ` Yannick Duchêne (Hibou57)
replies disabled

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