Re: JavaDocs vs. Tests
Tom Anderson <twic@urchin.earth.li> writes:
You could check that it's undefined in the Java sense and not the C
sense by verifying that the system disk hasn't reformatted.
Is there an official definition of what 'undefined' means, then?
It should mean the same in both language, according to me,
because it is a general programming term.
What was referred to as ?undefined in the Java sense? should
be called ?implementation|client|... specified? in both languages.
Examples of such operations include:
?The general contract of the method run is that it may
take any action whatsoever.?
http://download.java.net/jdk7/docs/api/java/lang/Runnable.html#run()
?Any action whatsoever?, of course, includes formatting any
harddisks.
?Invoked when an action occurs.?
http://download.java.net/jdk7/docs/api/java/awt/event/ActionListener.html#actionPerformed(java.awt.event.ActionEvent)
In this case, the ?any action whatsoever? is implied by not
placing any restrictions on or making any assertions about
the behavior.
So, when behavior is ?... specified?, then there is at least
the possibility that a party (?...?) can specify and control
this behavior although this specification is not part of the
interface definition using the term ?... specified?. This
party might then specify it in such a way as not to format
any harddisks.
In the case of ?undefined?, there is no chance for any party
to control the behavior.