News for hackers. Stuff that matters.
Re:How programmers make sure that their software is correct by junon on Thursday January 06, 2022 @09:12AM (#29823722)
Formalized verification would say otherwise.
Re:How programmers make sure that their software is correct by pydry on Thursday January 06, 2022 @09:21AM (#29823806)
At its worst, formalized verification is an elaborate and overcomplicated process for converting coding bugs into specification bugs.
Re:How programmers make sure that their software is correct by junon on Thursday January 06, 2022 @10:49AM (#29825051)
This is a huge copout and isn't at all correct. It dismisses a bunch of insanely intelligent peoples' life works.
Re:How programmers make sure that their software is correct by odonnellryan on Thursday January 06, 2022 @11:08AM (#29825342)
Can't you use this same argument when being critical about any technology, or really anything complex at all?

It is some kind of logical fallacy - just because really smart people worked on something and dedicated their lives to it doesn't mean it is good or correct or that it works.

Re:How programmers make sure that their software is correct by junon on Thursday January 06, 2022 @11:14AM (#29825417)
The point was more the parent comment was dismissing the work clearly without understanding any of it. They employed a sound byte to disclaim something. You're welcome to go read the prose on the subject. Parent commenter clearly hasn't.
Re:How programmers make sure that their software is correct by pydry on Thursday January 06, 2022 @12:11PM (#29826305)
It's a wry observation that I made when I was forced to learn it by those very same researchers who hyped it up as the future of software development 20 years ago.

It was sold as the "rolls royce of testing" which I think overstated its capabilities and effectiveness.

Re:How programmers make sure that their software is correct by junon on Thursday January 06, 2022 @02:24PM (#29828584)
Okay but things are entirely different than 20 years ago.
Re:How programmers make sure that their software is correct by adwn on Thursday January 06, 2022 @11:49AM (#29825948)
The problem with formal verification is that in practice, many problems can't even be formally specified. Try formally specifying the requirement "the GUI should work as expected" – it's hard enough even to test this, and impossible to formally specify.

Of the remaining problems, the complete, formal specification would be larger, more complex, and more bug-ridden than the implementation. "Hey adwn, can you add a button to the GUI so the user can export the current dataset to a CSV file?" Maybe 20-50 lines of code, but a full specification would be a multi-year project – and it would be almost certainly wrong.

Re:How programmers make sure that their software is correct by AnimalMuppet on Thursday January 06, 2022 @01:37PM (#29827813)
> The problem with formal verification is that in practice, many problems can't even be formally specified.

And even if they can, where does that formal spec come from? Sooner or later, it comes from some informal understanding of what's supposed to happen. Well, how do you check that the formal spec is correct? Because if you can't do that, all formal verification can do is tell you that your program correctly implemented the wrong thing.

And I don't think you can do that. First, I don't think you can go from informal to formal by formal means. Second, even if you can, you still can't verify the informal spec. So formal verification can only go so far.

I can recall several things that were bugs in the spec. Log4j is the most recent example. Heartbleed I think was a specification bug. Back in the day, a lot of computer viruses were helped on their way by bad ideas in the specification of Microsoft Outlook.

Re:How programmers make sure that their software is correct by mhh__ on Thursday January 06, 2022 @09:48AM (#29824140)
Not everyone has a spare 1000 programmer-years to write their script in Coq though.

Model checking can be pretty productive relatively speaking, however.

Re:How programmers make sure that their software is correct by junon on Thursday January 06, 2022 @10:53AM (#29825114)
Yeah this is unfortunately true. The developer experience aspect needs a lot of work here. I don't disagree. But the assertion that you can't write bug free code is still false, regardless of the amount of effort it takes.
Re:How programmers make sure that their software is correct by odonnellryan on Thursday January 06, 2022 @11:10AM (#29825359)
Lots of my bugs are because of unexpected data. I imagine these systems cannot account for that?
Re:How programmers make sure that their software is correct by jeffreygoesto on Thursday January 06, 2022 @02:24PM (#29828568)
That can be improved if you practice to "switch hats" and try to break your own code in all ways you can think of. That is something worth doing when you review other people's PRs as well. Expect all possible inputs before they hit you. Kind of a human fuzzer.
Re:How programmers make sure that their software is correct by odonnellryan on Thursday January 06, 2022 @03:18PM (#29829426)
Well, yes this is good advice no matter what, but it doesn't get rid of the bugs!
Re:How programmers make sure that their software is correct by junon on Thursday January 06, 2022 @11:14AM (#29825424)
Of course they can.
Re:How programmers make sure that their software is correct by odonnellryan on Thursday January 06, 2022 @03:18PM (#29829430)
How?