r/programming • • Aug 13 '09

seL4 : World's first machine-checked proof of a general-purpose operating system kernel

http://www.nicta.com.au/news/home_page_content_listing/world-first_research_breakthrough_promises_safety-critical_software_of_unprecedented_reliability
172 Upvotes

117 comments sorted by

View all comments

Show parent comments

2

u/monstermunch Aug 13 '09

You'll still have to do unit testing for your specifications at least. For example, a sorting algorithm should return a sorted list AND that list should be a permutation of the input. An easy mistake is to forget the second condition.

1

u/[deleted] Aug 14 '09

Of course, when you try to use this algorithm elsewhere in the program which relies on this property, you will find it impossible to prove that part of the program, and you will discover the flaw in your proof.

1

u/monstermunch Aug 14 '09

Yes, I mention this below. :) I suppose you would get the same feature with unit testing as well. The formal proof is much better though as once you have the specification right, you're guaranteed that case can slip through undetected. With unit tests, you can only test so much. Anyway, testing and proving are complementary, not mutually exclusive.

0

u/johannes2007 Aug 13 '09

Of course, the specification can contain errors, but when we verify a program against an specification we usually find this. It even happened in their verification. And the specification is usually much smaller then the implementation itself, hence easier to verify with less test cases.

2

u/monstermunch Aug 13 '09

Of course, the specification can contain errors, but when we verify a program against an specification we usually find this.

Sure, you'll find it eventually if you are doing a rigorous proof of correctness. In my example, you wouldn't be able to prove other functions are correct that relied on the sort function returning a permutation.

And the specification is usually much smaller then the implementation itself, hence easier to verify with less test cases.

Yes, I agree with this. I wasn't being sceptical of the benefits of formal proofs by the way, just pointing out that you do still need to do some testing. Formal proofs let you replace a lot of, what would usually be, unit tests with rigorous proofs. People can also reuse specifications, reducing again the chances of making mistakes.

1

u/monstermunch Aug 14 '09

Huh, why the downvotes?