5 ms·
> unless you don't write tests either. You mean "oracles" (from the blog post). Just program correctly amirite? eyeroll If your example doesn't deal with user
by TooBrokeToBeg 8y ago
> unless you don't write tests either.
You mean "oracles" (from the blog post). Just program correctly amirite? eyeroll
If your example doesn't deal with user input, you're talking about a problem of modeling under known conditions, which is trivial and ivory tower arrogance.
- coldtea 8y ago>You mean "oracles" (from the blog post). Just program correctly amirite? eyeroll I don't see the reason for the eyeroll. You'd have a point if the "just program correctly" meant "just get it right". But it's not. It's "just use contracts and invariants explicitly defined in your program, Eiffel style to check its correctness". Which is even more powerful than writing tests. >f your example doesn't deal with user input, you're talking about a problem of modeling under known conditions, which is trivial and ivory tower arrogance. Not sure how tests are anything other than "modeling under known conditions". Are the assertions in your test in any way "unknown"? If you mean fuzzing, you can do that trivially with Eiffel style programs as well. And the "tests" you do that way are there in the code, available in the debugger, and so on.
- pdimitar 8y agoCan you give a practical example on how to encode invariants explicitly in a more popular language? As for contracts, basically 99% of the languages have some form of the Java interfaces, or Elixir behaviours/protocols, or LISP's several ways of doing it. But for invariants, I would appreciate an example if you are willing to provide one.