Question(s)

Alan Gauld learn2program at gmail.com
Tue Oct 24 19:58:02 EDT 2023


On 24/10/2023 22:51, Grant Edwards via Python-list wrote:

>>> Is there a way to verify that a program is going to do what it is
>>> supposed to do even before all the hardware has been assembled and
>>> installed and tested?
> And the specified customer requirements are usually wrong too. Sure,
> the customer said it is supposed to do X, but what they actually
> needed was Y.

And this is the hardest bit, specifying exactly what you want at
a level that can be formally verified. I worked on some safety
critical systems a while back(1990s) and we had to formally verify
the core (non UI) code. We did this, but it still failed in some
scenarios because we verified it against faulty specs which,
in turn, were based on the customer's incorrectly stated requirements.
Garbage-In-Garbage-Out still applies.

Was the 3 months of formal analysis a waste of time? No, we still
caught lots of subtle stuff that might have been missed, but it
wasn't 100%. The bugs we did have were caught and identified
during system tests. So far as I know, nobody has died as a
result of any bugs in that system.

But, to the OP, the effort in
a) Learning the math and gaining experience for formal analysis and
b) actually performing such an analysis of real design/code
is simply not worth the effort for 99% of the programs you will write.
It is much simpler and faster to just test. And test again. And again.
Especially if you use automated testing tools which is the norm nowadays.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Python-list mailing list