|
|
|
|
|
by hansvm
2 days ago
|
|
Yes, but there's an implicit assumption that many parts of the contract are easier to understand than the corresponding code. Take sorting as an example. Verifying any one instance is easy even in something like Python all(a<=b for a,b in zip(L,L[1:]))
Which wasn't really made for the task. If you have theorem proving as part of your contracts then that just gives you extra confidence above and beyond however else you're verifying them. Note that this is much easier to understand even if you don't know Python than a typical sorting algorithm.I've personally never seen a contract system properly handle business rules well (the set of rules is usually about as verbose and we'll abstracted as the top-level code implementing them, and bugs are typically exactly the issue you posed, that the rules were improperly specified), so I'm skeptical of this approach. |
|