| ▲ | seanwilson 3 days ago | ||||||||||||||||
Major flaws in a specification for one function are usually quickly picked up when the proof for another function relies on the missing specification properties e.g. if you only prove the list returned by a function has a certain length and nothing about the contents of the list, you're going to quickly find out when another function needs to prove anything trivial about the contents of that list. Not that it's flawless either, but supplementing with standard e.g. unit tests helps catch specification bugs like this and you could generate unit test examples from the specification to review for correctness as well. You would notice problems when running the program too just like with regular programming, you wouldn't just write proofs about your program and not try running it. Nothing is perfect but just like in regular programming languages where adding a few simple regular automated tests or some more accurate static type annotations (e.g. JavaScript to TypeScript) will catch a lot of problems compared to nothing at all (and with diminishing returns), a proof of some simple properties will flush out a lot of bugs and edge cases. So I feel the common reaction of "specifications can have flaws" is overplayed when it's clearly a big step up the process of eliminating bugs. Does an alternative exist that's foolproof? | |||||||||||||||||
| ▲ | learningstud a day ago | parent | next [-] | ||||||||||||||||
> Major flaws in a specification for one function are usually quickly picked up when the proof for another function relies on the missing specification properties Great point! In a sense, it's testing by immediate use at compile time. I always imagine this to be the greatest productivity booster, even greater than AI. You'll notice things are wrong as you type. | |||||||||||||||||
| ▲ | akoboldfrying 3 days ago | parent | prev [-] | ||||||||||||||||
> Major flaws in a specification for one function are usually quickly picked up when the proof for another function relies on the missing specification properties Great point! > supplementing with standard e.g. unit tests helps catch specification bugs like this I don't think it does -- any specific input+output pair that a unit test tests for will satisfy all the constraints of a complete spec, so it will necessarily also satisfy an incomplete spec (i.e., a subset of those constraints). You could detect overly strong spec constraints this way, but not insufficiently strong ones. | |||||||||||||||||
| |||||||||||||||||