OASIS Open Document Format for Office Applications (OpenDocument) TC

 View Only
Expand all | Collapse all

Formula: test cases

  • 1.  Formula: test cases

    Posted 03-29-2007 14:41
    Greetings!
    
    I am deeply uncertain about the test cases for reasons similar to my 
    concerns about the "hidden" text. If the required behavior is 
    sufficiently specified, then the test cases should not be adding 
    anything to the standard. That is to say if I implement the normative 
    text, it should not be possible to obtain a result that is inconsistent 
    with the test cases.
    
    No doubt the test cases are very valuable as in drafting or 
    post-adoption, implementors can test their implementations to insure 
    that implementing the normative text does result in the correct 
    outcome(s), but that really isn't part of the normative text. That is to 
    say that I should not simply implement the test cases and think that I 
    have implemented the normative text. If someone "cheats" in that 
    fashion, they may well encounter an edge case that is not covered by the 
    test cases but is covered by the normative language.
    
    So, test cases are invaluable, but I am leaning towards suggesting that 
    they should not appear in the normative text of the standard. Actually I 
    am not entirely sure they should even appear in a non-normative annex. 
    In part because if there is any conflict between the normative text and 
    the test cases, which controls? The normative language or the test cases?
    
    That is one reason why standards strive to only say any rule once and 
    only once. Not entirely possible if you want a readable result but it is 
    something that is a good rule to follow in general. That reduces the 
    grounds for reaching different interpretations.
    
    Actually I would argue that if I need the test cases to understand the 
    normative text, that is a good sign there is a problem with the 
    normative text.
    
    I am starting a slow read of the formula proposal this weekend and will 
    post comments on specific sections as I reach them. This and the prior 
    post on notes, rationales, etc., are general comments that I won't 
    repeat as I encounter those aspects of the various sections.
    
    Hope everyone is having a great day!
    
    Patrick
    
    PS: Actually the test cases offer an interesting way to proof the 
    normative text. Remember the "check yourself exercises" in textbooks? 
    Simply cover up the results of the test cases and after reading the 
    normative text, see if you get the same results as are set forth in the 
    test cases. If you don't, it might indicate a problem with the normative 
    text. Will take longer but should result in a very clean normative text.
    
    -- 
    Patrick Durusau
    Patrick@Durusau.net
    Chair, V1 - Text Processing: Office and Publishing Systems Interface
    Co-Editor, ISO 13250, Topic Maps -- Reference Model
    Member, Text Encoding Initiative Board of Directors, 2003-2005
    
    Topic Maps: Human, not artificial, intelligence at work! 
    
    
    


  • 2.  RE: [office] Formula: test cases

    Posted 03-29-2007 15:03
    I agree with Patrick. The normative basis for conformance with a
    standard must be entirely in the text, not in test cases. 
    
    Test cases can be quite useful, but it is difficult to demonstrate that
    a test suite exhaustively exercises all the conforming variations
    supported by a standard or even exercises all the interesting/useful
    options. The validtation of a test suite opens up all sorts of new
    issues that may not even be relevant to the original standard.
    
    When we developed ISO/IEC 8879 (SGML), we recognized the difficulty of
    generating appropriate test suites and so chose to standardize only a
    testing and reporting methodology that would allow reasonable
    interpretation and comparison of results of test suites. This
    methodology is documented in ISO/IEC 13673:1994, "Conformance Testing
    for Standard Generalized Markup Language (SGML) Systems", available at
    http://www1.y12.doe.gov/capabilities/sgml/sc34/document/0131t.pdf.
    
    Several groups, including NIST and the former Omnimark Technologies, did
    publish very useful SGML test suites, but they were never candidates for
    formal standardization.
    
    Jim Mason
    
    


  • 3.  Re: [office] Formula: test cases

    Posted 03-29-2007 16:14
    Mason, James David:
    > Test cases can be quite useful, but it is difficult to demonstrate that
    > a test suite exhaustively exercises all the conforming variations
    > supported by a standard or even exercises all the interesting/useful
    > options.
    
    The test cases ensure that the specification is interpreted unambiguously, specify special cases, and in a few cases ensure that common errors (of implementation or interpretation) can be avoided.  Think back to any book you've read describing something technical - didn't they include examples, to ensure that you got the correct understanding?
    
    The test cases are NOT a full conformance test suite, my apologies if my statements were interpreted otherwise. The purpose of these test cases is NOT to exhaustively exercise all conforming variations, or even all the interesting/useful options.  I agree, that IS a difficult thing to do.  For example, we do NOT define conformance as simply "conforming to the embedded test suite". Passing these test cases isn't enough for that.  But they're enough to ensure that many latent, unidentified ambiguities are suddenly NOT ambiguous.
    
    Stupid example: Let's say that we defined SIN, etc., and nowhere noted if it took degrees or radians. (We DO say it's in radians, by the way.).  It's often hard to spot errors like that.  Add a few test cases, and suddenly, it's impossible to make a non-interoperable solution... because you cannot meet the text and test cases without making the correct determination (radians).
    
    
    > The validtation of a test suite opens up all sorts of new
    > issues that may not even be relevant to the original standard.
    
    In the general case, true.  The restricted domain of formulas eliminates most of those concerns, though.  This is a very narrow domain, and what wouldn't work elsewhere actually makes sense in this domain.
    
    My experience is that many validation test suite efforts take a lot of time trying to figure what the spec actually MEANT.  In the ideal case, that doesn't happen, but in the real world it does.  Including a few test cases in the spec itself can eliminate much of that ambiguity.
    
    Anyway, I'm fully aware that specifications don't "normally" include test cases.  But this is merely a statement of current practice, and says nothing about what SHOULD be there. I'm arguing that in this narrow domain there is a better way. My hope is that once you examine it in practice, you'll agree.
    
    --- David A. Wheeler
    


  • 4.  Re: [office] Formula: test cases

    Posted 03-29-2007 15:32
    Patrick Durusau:
    > I am deeply uncertain about the test cases for reasons similar to my 
    > concerns about the "hidden" text. If the required behavior is 
    > sufficiently specified, then the test cases should not be adding 
    > anything to the standard. That is to say if I implement the normative 
    > text, it should not be possible to obtain a result that is inconsistent 
    > with the test cases.
    
    The test cases are a NORMATIVE part of the specification, and have been so from the beginning.  There are a large number of special cases.  Instead of trying to state them all in English, which is both confusing and lengthy, we have stated them as required answers as part of the test cases.
    
    Removing the test cases would be like cutting out random sentences.
    
    > No doubt the test cases are very valuable as in drafting or 
    > post-adoption, implementors can test their implementations to insure 
    > that implementing the normative text does result in the correct 
    > outcome(s), but that really isn't part of the normative text. That is to 
    > say that I should not simply implement the test cases and think that I 
    > have implemented the normative text. If someone "cheats" in that 
    > fashion, they may well encounter an edge case that is not covered by the 
    > test cases but is covered by the normative language.
    
    Cheating is countered by the other requirements (there aren't JUST test cases).
    
    But the reverse is actually more of a problem; malicious implementation can occur, but more often the problem is that there's text that LOOKS unambiguous but in fact IS ambiguous.  It's VERY easy to create text that LOOKS like it covers all the cases, but it FAILS to do so.  The only method we've found for ENSURING that people actually agree on the meaning of text is to include test cases that FORCE a particular meaning.
    
    For proof that "obviously clear" text will be later understood with different incompatible meanings, look at any standards group :-).  If an approach keeps not working, perhaps another approach would be sensible.  Especially in this limited domain where it's POSSIBLE to create test cases like this.
    
    > So, test cases are invaluable, but I am leaning towards suggesting that 
    > they should not appear in the normative text of the standard.  Actually I 
    > am not entirely sure they should even appear in a non-normative annex. 
    > In part because if there is any conflict between the normative text and 
    > the test cases, which controls? The normative language or the test cases?
    
    I _STRONGLY_ disagree with this idea. It's just like removing random sentences; the test cases are NORMATIVE.
    
    As far as conflicts go, that's no different than any other internal conflict in a specification.  If there are multiple sentences in a specification that conflict, which one controls?  The answer is neither; they need to be adjudicated.
    
    If you must have a rule, then the rule is simple: the TEST CASES control.  Because they are the ones that are automatically checked.  We have no way to automatically check arbitrary English text, nor does anyone else.
    
    > That is one reason why standards strive to only say any rule once and 
    > only once. Not entirely possible if you want a readable result but it is 
    > something that is a good rule to follow in general. That reduces the 
    > grounds for reaching different interpretations.
    
    Yes, I agree.
    
    > Actually I would argue that if I need the test cases to understand the 
    > normative text, that is a good sign there is a problem with the 
    > normative text.
    
    I understand and respect that viewpoint (and you!).  But I strongly disagree.
    
    The problem is that formulas are rather different beasts from many other specifications; either you get the "right answer" or you don't.  Many protocols and APIs can be very flexible, allowing a variety of inputs and outputs.  Page layouts can vary.  But formulas get one bite at the apple: Given a specific input, they MUST produce a specific output.
    
    English is disturbingly ambiguous, and text that LOOKS like it's really clear turns out to NOT be the case.  Ah, you say, why then there's a problem with the normative text and you just fix it.  Well, you can CHANGE it, but it turns out that you just create DIFFERENT ambiguities.  Again, and again, and again, we've found that including test cases is the difference between "inadequately specified" and "adequately specified."
    
    > I am starting a slow read of the formula proposal this weekend and will 
    > post comments on specific sections as I reach them. This and the prior 
    > post on notes, rationales, etc., are general comments that I won't 
    > repeat as I encounter those aspects of the various sections.
    > 
    > Hope everyone is having a great day!
    > 
    > Patrick
    > 
    > PS: Actually the test cases offer an interesting way to proof the 
    > normative text. Remember the "check yourself exercises" in textbooks? 
    > Simply cover up the results of the test cases and after reading the 
    > normative text, see if you get the same results as are set forth in the 
    > test cases. If you don't, it might indicate a problem with the normative 
    > text. Will take longer but should result in a very clean normative text.
    
    I encourage you _DO_ that test, and by all means, improve the text with problems you find!
    
    But I believe that is a grossly inadequate way to proof the text; doing that doesn't mean it's actually sufficient without test cases.  Let's say that you get 100% agreement on all cases. So what? The problem is that the next reader/implementor will NOT get the same answer on all the test cases, even if you do.  Time and again, we've crafted "really good English text" only to find that once again, it's possible to misinterpret it.  You'd be shocked at how many "obviously clear" statements for functions turn out to be ambiguous.
    
    The requirement is not, "do YOU get the right answer".  The requirement is that "EVERYONE, AT ALL TIMES, gets the SAME answer."  English text, even when supplemented with mathematical formulas, often LOOKS unambiguous to many reviewers, yet can still have serious ambiguities. We certainly want to improve the text as much as we can... but we also want to have a strategy that ensures that if there's an omission in the text, implementors will ALL get the SAME answer anyway.  The FIRST time. And the way to make that MUCH more likely is to include test cases.
    
    At one time standards bodies routinely created conformance tests.  That's become pretty rare.  One problem is that it's often too costly to create conformance tests after-the-fact from the inadequately defined specifications.  As a result, we have lots of standards with lots of ambiguity, NO useful conformance tests, and lots of interoperability problems.  So we've come up with a different solution: make a conformance test a NORMATIVE PART of the specification.  It eliminates many ambiguities, and greatly encourages INTEROPERABLE implementations.
    
    You still need - and want - good normative text.  On that we agree.  But test cases turn out to be necessary to ensuring that the text is interpreted correctly.
    
    Respectfully,
    
    --- David A. Wheeler
    


  • 5.  Re: [office] Formula: test cases

    Posted 03-29-2007 15:51
    On Mar 29, 2007, at 11:31 AM, David A. Wheeler wrote:
    
    > The problem is that formulas are rather different beasts from many  
    > other specifications; either you get the "right answer" or you  
    > don't.  Many protocols and APIs can be very flexible, allowing a  
    > variety of inputs and outputs.  Page layouts can vary.  But  
    > formulas get one bite at the apple: Given a specific input, they  
    > MUST produce a specific output.
    
    This seems like a reasonable point, and the crux of the matter.
    
    Bruce
    
    


  • 6.  Re: [office] Formula: test cases

    Posted 03-29-2007 16:28
    Bruce,
    
    Bruce D'Arcus wrote:
    
    >
    > On Mar 29, 2007, at 11:31 AM, David A. Wheeler wrote:
    >
    >> The problem is that formulas are rather different beasts from many  
    >> other specifications; either you get the "right answer" or you  
    >> don't.  Many protocols and APIs can be very flexible, allowing a  
    >> variety of inputs and outputs.  Page layouts can vary.  But  formulas 
    >> get one bite at the apple: Given a specific input, they  MUST produce 
    >> a specific output.
    >
    >
    > This seems like a reasonable point, and the crux of the matter.
    >
    Well, a reasonable point but not really the crux of the matter.
    
    David and I don't disagree that given specific input that an application 
    must produce a specific output.
    
    Where we disagree is how to specify the for the application what it must 
    output for a specific input. Quite a different question.
    
    Well, and we disagree on where test cases, admittedly useful things, 
    should be placed.
    
    So, really two questions:
    
    1. How to specify behavior of an application given a defined input, and
    
    2. If test cases are supplied, where do they go?
    
    Hope you are having a great day!
    
    Patrick
    
    > Bruce
    >
    >
    >
    >
    
    -- 
    Patrick Durusau
    Patrick@Durusau.net
    Chair, V1 - Text Processing: Office and Publishing Systems Interface
    Co-Editor, ISO 13250, Topic Maps -- Reference Model
    Member, Text Encoding Initiative Board of Directors, 2003-2005
    
    Topic Maps: Human, not artificial, intelligence at work! 
    
    
    


  • 7.  Re: [office] Formula: test cases

    Posted 03-29-2007 16:31
    On Mar 29, 2007, at 12:26 PM, Patrick Durusau wrote:
    
    >> This seems like a reasonable point, and the crux of the matter.
    >>
    > Well, a reasonable point but not really the crux of the matter.
    
    By this I mean the central question is whether formulas constitute a  
    special case of sorts that would justify the approach. That, it seems  
    to me, *is* the crux of the matter. General rules only work for  
    general cases.
    
    Bruce
    
    


  • 8.  Re: [office] Formula: test cases

    Posted 03-29-2007 16:54
    Bruce,
    
    Bruce D'Arcus wrote:
    
    >
    > On Mar 29, 2007, at 12:26 PM, Patrick Durusau wrote:
    >
    >>> This seems like a reasonable point, and the crux of the matter.
    >>>
    >> Well, a reasonable point but not really the crux of the matter.
    >
    >
    > By this I mean the central question is whether formulas constitute a  
    > special case of sorts that would justify the approach. That, it seems  
    > to me, *is* the crux of the matter. General rules only work for  
    > general cases.
    >
    Oh, OK, I stand corrected. Sorry, did not understand that to be your point.
    
    Hmmm, well I doubt this is the first time that formulas (or other math 
    functions) have been specified. I will check with the usual suspects 
    (standards bodies) and see what I can turn up. Most of that stuff tends 
    to be unavailable online but I will see what I can turn up.
    
    Hope you are having a great day!
    
    Patrick
    
    PS: Would standards by mathematical associations count? Not ISO but 
    certainly similar in character.
    
    -- 
    Patrick Durusau
    Patrick@Durusau.net
    Chair, V1 - Text Processing: Office and Publishing Systems Interface
    Co-Editor, ISO 13250, Topic Maps -- Reference Model
    Member, Text Encoding Initiative Board of Directors, 2003-2005
    
    Topic Maps: Human, not artificial, intelligence at work! 
    
    
    


  • 9.  Re: [office] Formula: test cases

    Posted 03-29-2007 19:56
    Patrick Durusau:
    > PS: Would standards by mathematical associations count? Not ISO but 
    > certainly similar in character.
    
    I'm not claiming that many other organizations include test cases in their official specs. Pointing to "what others do" doesn't answer the question "what is the best approach."
    
    I'll note that essentially ALL spreadsheet help systems do INCLUDE examples, which act just as our test cases - they clarify the meaning of the supposedly unambiguous description.  Microsoft's XML format includes examples (test cases) as well, though not in an automatically processable format, and I'm not sure if they are normative.
    
    Also, the strictly mathematical functions (SIN, etc.) were generally the easy ones; there are LOTS of sources for high-quality, unambiguous definitions. The nasty ones are functions like the financial and date functions, which are easily described in ways that APPEAR rigorous but in fact are not.  Mathematicians are very much at home with rigor; in contrast, most financial users only know that they push the buttons and magic comes out. Since they're the users of financial functions, the definitions of many such functions turn out to be dreadfully ambiguous in the literature.
    
    It's a question of tactics: Does a general definition ALONE guarantee that I have unambiguous text? Or does a general definition, combined with test cases, do a better job?  I am arguing the latter.
    
    --- David A. Wheeler
    


  • 10.  Re: [office] Formula: test cases

    Posted 03-29-2007 20:52

    An interesting example of how others have approved this problem is the functions in XPath 1.0.   Here's how James Clark describes the round() function:

    "Function: number round(number)

    The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned."

    I always liked that definition.  Very complete. It is just text, with no test suite, but the text is mainly a verbose English enumeration of text cases.  Why not rwrite it as:


    "The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned.

    Examples:

    round(NaN) = NaN
    round(Inf) = Inf
    round (-Inf) = -Inf
    round(0) = 0
    round (-0) 0
    round (0.25) = -0"

    Isn't this just a difference of notation and one that is much easier to read?  Interestingly in other parts of XPath, explicit examples are given, such as in the definition of substring().

     If needed we could probably write a Python script that would take all of the test cases and generate English sentences for each one.  But is that an improvement?

    -Rob


    Patrick Durusau <patrick@durusau.net> wrote on 03/29/2007 12:48:50 PM:

    > Bruce,
    >
    > Bruce D'Arcus wrote:
    >
    > >
    > > On Mar 29, 2007, at 12:26 PM, Patrick Durusau wrote:
    > >
    > >>> This seems like a reasonable point, and the crux of the matter.
    > >>>
    > >> Well, a reasonable point but not really the crux of the matter.
    > >
    > >
    > > By this I mean the central question is whether formulas constitute a  
    > > special case of sorts that would justify the approach. That, it seems  
    > > to me, *is* the crux of the matter. General rules only work for  
    > > general cases.
    > >
    > Oh, OK, I stand corrected. Sorry, did not understand that to be your point.
    >
    > Hmmm, well I doubt this is the first time that formulas (or other math
    > functions) have been specified. I will check with the usual suspects
    > (standards bodies) and see what I can turn up. Most of that stuff tends
    > to be unavailable online but I will see what I can turn up.
    >
    > Hope you are having a great day!
    >
    > Patrick
    >
    > PS: Would standards by mathematical associations count? Not ISO but
    > certainly similar in character.
    >
    > --
    > Patrick Durusau
    > Patrick@Durusau.net
    > Chair, V1 - Text Processing: Office and Publishing Systems Interface
    > Co-Editor, ISO 13250, Topic Maps -- Reference Model
    > Member, Text Encoding Initiative Board of Directors, 2003-2005
    >
    > Topic Maps: Human, not artificial, intelligence at work!
    >
    >



  • 11.  Re: [office] Formula: test cases

    Posted 03-29-2007 21:27
    Rob,
    
    robert_weir@us.ibm.com wrote:
    
    >
    > An interesting example of how others have approved this problem is the 
    > functions in XPath 1.0.   Here's how James Clark describes the round() 
    > function:
    >
    > "Function: number round(number)
    >
    > The round function returns the number that is closest to the argument 
    > and that is an integer. If there are two such numbers, then the one 
    > that is closest to positive infinity is returned. If the argument is 
    > NaN, then NaN is returned. If the argument is positive infinity, then 
    > positive infinity is returned. If the argument is negative infinity, 
    > then negative infinity is returned. If the argument is positive zero, 
    > then positive zero is returned. If the argument is negative zero, then 
    > negative zero is returned. If the argument is less than zero, but 
    > greater than or equal to -0.5, then negative zero is returned."
    >
    > I always liked that definition.  Very complete. It is just text, with 
    > no test suite, but the text is mainly a verbose English enumeration of 
    > text cases.  Why not rwrite it as:
    >
    >
    > "The round function returns the number that is closest to the argument 
    > and that is an integer. If there are two such numbers, then the one 
    > that is closest to positive infinity is returned.
    >
    > Examples:
    >
    > round(NaN) = NaN
    > round(Inf) = Inf
    > round (-Inf) = -Inf
    > round(0) = 0
    > round (-0) 0
    > round (0.25) = -0"
    >
    > Isn't this just a difference of notation and one that is much easier 
    > to read?  Interestingly in other parts of XPath, explicit examples are 
    > given, such as in the definition of substring().
    >
    >  If needed we could probably write a Python script that would take all 
    > of the test cases and generate English sentences for each one.  But is 
    > that an improvement?
    >
    Err, well, I am supposed to be reading the formula proposal carefully 
    but I guess I can take a break to reply. ;-)
    
    Sure, if you pick your examples carefully, then a "test case" can appear 
    to be clearer than a normative expression in English.
    
    But, note that your "test cases" enumerates the entire range of possible 
    values.
    
     From the "test cases" that I have examined in the proposal, that is not 
    the case. That is they enumerate some "test" values and specify a result.
    
    That isn't the same thing as abstractly specifying the rule for an 
    entire range of values.
    
    I am not wedded to the notion of expressing all the rules in English. 
    But then I have spent a lot of time with markup theory proposals and so 
    prior experience may color my perception of what is clearly expressed. ;-)
    
    Hope you are having a great day!
    
    Patrick
    
    
    > -Rob
    >
    >
    > Patrick Durusau 


  • 12.  Re: [office] Formula: test cases

    Posted 03-29-2007 21:57

    I guess I'm looking out there and see a trend over the years, where with programming, we once did our code, then wrote the test cases, and then wrote the documentation.  But then we progressed to things like Literate Programming, JavaDoc, assertions, Extreme Programming, etc., and learned the virtues of moving the test and documentation activities earlier into the engineering process, and of integrating those artifacts into the source code where it is more likely to be kept up-to-date.  So self-testing, self-documenting code is the norm now.  The next step forward from this may be self-testing specifications.

    What does this mean for standards?  Well, it doesn't necessarily mean anything.  Standards conventions are conservative.  The fact that ISO standards are available in digital format at all is perhaps as much progress as we can hope for in one lifetime.  But the benefits of having integrated test cases in the standard is motivated by the observation that such approaches have proven to have great usefulness in other areas.  That is where this is coming from.

    -Rob

    Patrick Durusau <patrick@durusau.net> wrote on 03/29/2007 05:26:07 PM:

    > Rob,
    >
    > robert_weir@us.ibm.com wrote:
    >
    > >
    > > An interesting example of how others have approved this problem is the
    > > functions in XPath 1.0.   Here's how James Clark describes the round()
    > > function:
    > >
    > > "Function: number round(number)
    > >
    > > The round function returns the number that is closest to the argument
    > > and that is an integer. If there are two such numbers, then the one
    > > that is closest to positive infinity is returned. If the argument is
    > > NaN, then NaN is returned. If the argument is positive infinity, then
    > > positive infinity is returned. If the argument is negative infinity,
    > > then negative infinity is returned. If the argument is positive zero,
    > > then positive zero is returned. If the argument is negative zero, then
    > > negative zero is returned. If the argument is less than zero, but
    > > greater than or equal to -0.5, then negative zero is returned."
    > >
    > > I always liked that definition.  Very complete. It is just text, with
    > > no test suite, but the text is mainly a verbose English enumeration of
    > > text cases.  Why not rwrite it as:
    > >
    > >
    > > "The round function returns the number that is closest to the argument
    > > and that is an integer. If there are two such numbers, then the one
    > > that is closest to positive infinity is returned.
    > >
    > > Examples:
    > >
    > > round(NaN) = NaN
    > > round(Inf) = Inf
    > > round (-Inf) = -Inf
    > > round(0) = 0
    > > round (-0) 0
    > > round (0.25) = -0"
    > >
    > > Isn't this just a difference of notation and one that is much easier
    > > to read?  Interestingly in other parts of XPath, explicit examples are
    > > given, such as in the definition of substring().
    > >
    > >  If needed we could probably write a Python script that would take all
    > > of the test cases and generate English sentences for each one.  But is
    > > that an improvement?
    > >
    > Err, well, I am supposed to be reading the formula proposal carefully
    > but I guess I can take a break to reply. ;-)
    >
    > Sure, if you pick your examples carefully, then a "test case" can appear
    > to be clearer than a normative expression in English.
    >
    > But, note that your "test cases" enumerates the entire range of possible
    > values.
    >
    >  From the "test cases" that I have examined in the proposal, that is not
    > the case. That is they enumerate some "test" values and specify a result.
    >
    > That isn't the same thing as abstractly specifying the rule for an
    > entire range of values.
    >
    > I am not wedded to the notion of expressing all the rules in English.
    > But then I have spent a lot of time with markup theory proposals and so
    > prior experience may color my perception of what is clearly expressed. ;-)
    >
    > Hope you are having a great day!
    >
    > Patrick
    >
    >
    > > -Rob
    > >
    > >
    > > Patrick Durusau <patrick@durusau.net> wrote on 03/29/2007 12:48:50 PM:
    > >
    > > > Bruce,
    > > >
    > > > Bruce D'Arcus wrote:
    > > >
    > > > >
    > > > > On Mar 29, 2007, at 12:26 PM, Patrick Durusau wrote:
    > > > >
    > > > >>> This seems like a reasonable point, and the crux of the matter.
    > > > >>>
    > > > >> Well, a reasonable point but not really the crux of the matter.
    > > > >
    > > > >
    > > > > By this I mean the central question is whether formulas constitute a  
    > > > > special case of sorts that would justify the approach. That, it
    > > seems  
    > > > > to me, *is* the crux of the matter. General rules only work for  
    > > > > general cases.
    > > > >
    > > > Oh, OK, I stand corrected. Sorry, did not understand that to be your
    > > point.
    > > >
    > > > Hmmm, well I doubt this is the first time that formulas (or other math
    > > > functions) have been specified. I will check with the usual suspects
    > > > (standards bodies) and see what I can turn up. Most of that stuff tends
    > > > to be unavailable online but I will see what I can turn up.
    > > >
    > > > Hope you are having a great day!
    > > >
    > > > Patrick
    > > >
    > > > PS: Would standards by mathematical associations count? Not ISO but
    > > > certainly similar in character.
    > > >
    > > > --
    > > > Patrick Durusau
    > > > Patrick@Durusau.net
    > > > Chair, V1 - Text Processing: Office and Publishing Systems Interface
    > > > Co-Editor, ISO 13250, Topic Maps -- Reference Model
    > > > Member, Text Encoding Initiative Board of Directors, 2003-2005
    > > >
    > > > Topic Maps: Human, not artificial, intelligence at work!
    > > >
    > > >
    > >
    >
    > --
    > Patrick Durusau
    > Patrick@Durusau.net
    > Chair, V1 - Text Processing: Office and Publishing Systems Interface
    > Co-Editor, ISO 13250, Topic Maps -- Reference Model
    > Member, Text Encoding Initiative Board of Directors, 2003-2005
    >
    > Topic Maps: Human, not artificial, intelligence at work!
    >
    >


  • 13.  Re: [office] Formula: test cases

    Posted 03-29-2007 16:32
    David,
    
    David A. Wheeler wrote:
    
    >Patrick Durusau:
    >  
    >
    >>I am deeply uncertain about the test cases for reasons similar to my 
    >>concerns about the "hidden" text. If the required behavior is 
    >>sufficiently specified, then the test cases should not be adding 
    >>anything to the standard. That is to say if I implement the normative 
    >>text, it should not be possible to obtain a result that is inconsistent 
    >>with the test cases.
    >>    
    >>
    >
    >The test cases are a NORMATIVE part of the specification, and have been so from the beginning.  There are a large number of special cases.  Instead of trying to state them all in English, which is both confusing and lengthy, we have stated them as required answers as part of the test cases.
    >
    >Removing the test cases would be like cutting out random sentences.
    >
    >  
    >
    Yes, and you will recall that I raised my misgivings about the inclusion 
    of test cases with you quite some time ago.
    
    We disagree then and if I understand your "English text" it appears we 
    continue to do so. ;-)
    
    BTW, I am reviewing another standards proposal that takes the out "its 
    too complicated to explain" approach. ;-) You can imagine my reaction to 
    such statements.
    I assume you kept a list of cases where the normative text is not 
    controlling and that one has to rely on the test cases?
    
    >>No doubt the test cases are very valuable as in drafting or 
    >>post-adoption, implementors can test their implementations to insure 
    >>that implementing the normative text does result in the correct 
    >>outcome(s), but that really isn't part of the normative text. That is to 
    >>say that I should not simply implement the test cases and think that I 
    >>have implemented the normative text. If someone "cheats" in that 
    >>fashion, they may well encounter an edge case that is not covered by the 
    >>test cases but is covered by the normative language.
    >>    
    >>
    >
    >Cheating is countered by the other requirements (there aren't JUST test cases).
    >
    >But the reverse is actually more of a problem; malicious implementation can occur, but more often the problem is that there's text that LOOKS unambiguous but in fact IS ambiguous.  It's VERY easy to create text that LOOKS like it covers all the cases, but it FAILS to do so.  The only method we've found for ENSURING that people actually agree on the meaning of text is to include test cases that FORCE a particular meaning.
    >
    >For proof that "obviously clear" text will be later understood with different incompatible meanings, look at any standards group :-).  If an approach keeps not working, perhaps another approach would be sensible.  Especially in this limited domain where it's POSSIBLE to create test cases like this.
    >
    >  
    >
    Err, but test cases remove only some ambiguity as I pointed out in my 
    initial post. If you really want to remove *all* ambiguity, then you 
    would have to formally prove the results of each formula. What test 
    cases do is remove ambiguity that you thought about providing a test 
    case for.
    
    That is not the same thing as removing Ambiguity (writ large).
    
    >>So, test cases are invaluable, but I am leaning towards suggesting that 
    >>they should not appear in the normative text of the standard.  Actually I 
    >>am not entirely sure they should even appear in a non-normative annex. 
    >>In part because if there is any conflict between the normative text and 
    >>the test cases, which controls? The normative language or the test cases?
    >>    
    >>
    >
    >I _STRONGLY_ disagree with this idea. It's just like removing random sentences; the test cases are NORMATIVE.
    >
    >  
    >
    Err, it really should not be "like removing random sentences." Isn't 
    that just a bit of an exaggeration?
    
    >As far as conflicts go, that's no different than any other internal conflict in a specification.  If there are multiple sentences in a specification that conflict, which one controls?  The answer is neither; they need to be adjudicated.
    >
    >If you must have a rule, then the rule is simple: the TEST CASES control.  Because they are the ones that are automatically checked.  We have no way to automatically check arbitrary English text, nor does anyone else.
    >
    >  
    >
    Err, are you sure you want that rule? That TEST CASES control?
    
    In that case I can write an application that gives the specified results 
    for the enumerated test cases and utterly random results for any other 
    input.
    
    The problem is that a test case cannot be generalized, well, unless you 
    want to enumerate all possible inputs and results, which would be rather 
    lengthy for the set of integers.
    
    >>That is one reason why standards strive to only say any rule once and 
    >>only once. Not entirely possible if you want a readable result but it is 
    >>something that is a good rule to follow in general. That reduces the 
    >>grounds for reaching different interpretations.
    >>    
    >>
    >
    >Yes, I agree.
    >
    >  
    >
    >>Actually I would argue that if I need the test cases to understand the 
    >>normative text, that is a good sign there is a problem with the 
    >>normative text.
    >>    
    >>
    >
    >I understand and respect that viewpoint (and you!).  But I strongly disagree.
    >
    >The problem is that formulas are rather different beasts from many other specifications; either you get the "right answer" or you don't.  Many protocols and APIs can be very flexible, allowing a variety of inputs and outputs.  Page layouts can vary.  But formulas get one bite at the apple: Given a specific input, they MUST produce a specific output.
    >
    >English is disturbingly ambiguous, and text that LOOKS like it's really clear turns out to NOT be the case.  Ah, you say, why then there's a problem with the normative text and you just fix it.  Well, you can CHANGE it, but it turns out that you just create DIFFERENT ambiguities.  Again, and again, and again, we've found that including test cases is the difference between "inadequately specified" and "adequately specified."
    >
    >  
    >
    Note my comments above on test cases removing ambiguity only for the 
    enumerated test.
    
    >>I am starting a slow read of the formula proposal this weekend and will 
    >>post comments on specific sections as I reach them. This and the prior 
    >>post on notes, rationales, etc., are general comments that I won't 
    >>repeat as I encounter those aspects of the various sections.
    >>
    >>Hope everyone is having a great day!
    >>
    >>Patrick
    >>
    >>PS: Actually the test cases offer an interesting way to proof the 
    >>normative text. Remember the "check yourself exercises" in textbooks? 
    >>Simply cover up the results of the test cases and after reading the 
    >>normative text, see if you get the same results as are set forth in the 
    >>test cases. If you don't, it might indicate a problem with the normative 
    >>text. Will take longer but should result in a very clean normative text.
    >>    
    >>
    >
    >I encourage you _DO_ that test, and by all means, improve the text with problems you find!
    >
    >But I believe that is a grossly inadequate way to proof the text; doing that doesn't mean it's actually sufficient without test cases.  Let's say that you get 100% agreement on all cases. So what? The problem is that the next reader/implementor will NOT get the same answer on all the test cases, even if you do.  Time and again, we've crafted "really good English text" only to find that once again, it's possible to misinterpret it.  You'd be shocked at how many "obviously clear" statements for functions turn out to be ambiguous.
    >
    >  
    >
    Oh, I don't know. I think DSSSL, for example, did a fairly good job at 
    being clear as to what was meant.
    
    Besides, we aren't talking about the range of human experience with 
    standards but this one.
    
    >The requirement is not, "do YOU get the right answer".  The requirement is that "EVERYONE, AT ALL TIMES, gets the SAME answer."  English text, even when supplemented with mathematical formulas, often LOOKS unambiguous to many reviewers, yet can still have serious ambiguities. We certainly want to improve the text as much as we can... but we also want to have a strategy that ensures that if there's an omission in the text, implementors will ALL get the SAME answer anyway.  The FIRST time. And the way to make that MUCH more likely is to include test cases.
    >
    >At one time standards bodies routinely created conformance tests.  That's become pretty rare.  One problem is that it's often too costly to create conformance tests after-the-fact from the inadequately defined specifications.  As a result, we have lots of standards with lots of ambiguity, NO useful conformance tests, and lots of interoperability problems.  So we've come up with a different solution: make a conformance test a NORMATIVE PART of the specification.  It eliminates many ambiguities, and greatly encourages INTEROPERABLE implementations.
    >
    >  
    >
    Sorry, what you have is *not* a conformance test. What you have is a 
    conformance to a specified set of test cases and the hope that if the 
    application conforms to those it will conform to those not enumerated. 
    Those are not the same thing by any means.
    
    >You still need - and want - good normative text.  On that we agree.  But test cases turn out to be necessary to ensuring that the text is interpreted correctly.
    >
    >  
    >
    That is an assumption on your part and I readily agree there are any 
    number of poorly written standards.
    
    Where I disagree is extending that assumption to this standard. DSSSL 
    for example I don't think was considered ambiguous by anyone. Obscure 
    perhaps but not ambiguous. ;-)
    
    Note that I never said that test cases aren't useful. The test cases in 
    the formula draft can be incredibly useful. The question is where do 
    they go?
    
    So, let's at least disagree on what is at issue:
    
    1. How to specify normative behavior? (I would not use test cases.)
    
    2. Where should test cases go? (I would not include test cases in the 
    standard.)
    
    Please do not take any of my comments as doubting the usefulness of the 
    test cases. I am sure they are very useful but I do disagree on the role 
    you want to assign them in this standard.
    
    Hope you are having a great day!
    
    Patrick
    
    >Respectfully,
    >
    >--- David A. Wheeler
    >
    >
    >
    >  
    >
    
    -- 
    Patrick Durusau
    Patrick@Durusau.net
    Chair, V1 - Text Processing: Office and Publishing Systems Interface
    Co-Editor, ISO 13250, Topic Maps -- Reference Model
    Member, Text Encoding Initiative Board of Directors, 2003-2005
    
    Topic Maps: Human, not artificial, intelligence at work! 
    
    
    


  • 14.  Re: [office] Formula: test cases

    Posted 03-29-2007 18:04
    Patrick Durusau:
    > >>I am deeply uncertain about the test cases for reasons similar to my 
    > >>concerns about the "hidden" text. If the required behavior is 
    > >>sufficiently specified, then the test cases should not be adding 
    > >>anything to the standard. That is to say if I implement the normative 
    > >>text, it should not be possible to obtain a result that is inconsistent 
    > >>with the test cases.
    
    Hmm. Since the document currently defines the test cases as being part (though not the whole) of the normative text, it is vacuously true that implementing the normative material cannot produce a result inconsistent with the normative material.  So sure, it's not possible already!
    
    But I know what you mean, so let's carry on with what you mean.
    
    The problem is that without the test cases, people would look at the text, and everyone would agree "yes, that's unambiguous".  Then they'd go off and produce INCOMPATIBLE results.
    
    The perfect solution, of course, is to write perfect text, text that is NEVER ambiguous. I have found no magical way of doing so. Review by large groups helps but doesn't eliminate all ambiguity.  Unfortunately, all we had were fallible human beings, and a language (English) that is not designed to force out all imprecise statements.  Math helps, but not enough; traditional mathematical notation makes assumptions too. Using a second mechanism (test cases) as a way to eliminate most ambiguities turns out to be an incredibly powerful mechanism.
    
    > Yes, and you will recall that I raised my misgivings about the inclusion 
    > of test cases with you quite some time ago.
    > 
    > We disagree then and if I understand your "English text" it appears we 
    > continue to do so. ;-)
    
    :-).
     
    > BTW, I am reviewing another standards proposal that takes the out "its 
    > too complicated to explain" approach. ;-) You can imagine my reaction to 
    > such statements.
    
    EEK! I hope you'll agree that including test cases is way better than THAT :-).
    
    > I assume you kept a list of cases where the normative text is not 
    > controlling and that one has to rely on the test cases?
    
    I'm not aware of any such cases.  English is marvelously adept at being able to make statements that APPEAR precise, without actually BEING precise.  Indeed, I think I could make a case that that is the primary purpose of English :-).
    
    > Err, but test cases remove only some ambiguity as I pointed out in my 
    > initial post. If you really want to remove *all* ambiguity, then you 
    > would have to formally prove the results of each formula. What test 
    > cases do is remove ambiguity that you thought about providing a test 
    > case for.
    > 
    > That is not the same thing as removing Ambiguity (writ large).
    
    If you mean "perfectly removing ambiguity", I agree - but I didn't have the money to do formal proofs at that level :-).
    
    But I _disagree_ if you mean "test cases do not help remove ambiguity".  They do.  We have a lot of experience with text that seemed perfectly clear... until the test case was added :-).
    
    
    > Err, are you sure you want that rule? That TEST CASES control?
    > 
    > In that case I can write an application that gives the specified results 
    > for the enumerated test cases and utterly random results for any other input.
    
    Nope - see below.
    
    > The problem is that a test case cannot be generalized, well, unless you 
    > want to enumerate all possible inputs and results, which would be rather 
    > lengthy for the set of integers.
    
    Er, no.  If ONLY the test cases were normative, that'd be true, but that'd be crazy to try.  I'm NOT arguing that ONLY the test cases are normative.  Test cases BY THEMSELVES certainly DO have the problem you've stated, and are obviously completely inadequate for specification.
    
    But this is NOT just a bunch of test cases.  There is normative semantic text, that STRIVES to be unambiguous... backed up by test cases that winnow out any ambiguities left over in the text.  The test cases make it possible for us to clarify the meaning of the text in a way that's difficult to do otherwise.  E.G., "Hmm, SIN doesn't identify if it takes degrees or radians! Oops, yes it does, because the test cases cannot be correct if interpreted as degrees."  And in my experience, any significant amount of "normative" text has ambiguities.
    
    The goal is not either/or.  We need good normative text, and I'm looking forward to improvements that you suggest. But the goal is to minimize ambiguity, and I believe that can be best done by combining what normative text can do (defining the general case) along with what test cases can do (it can be EXTREMELY precise about the correct result for specific inputs).  By COMBINING these specification approaches, general-case normative text and specific-case test cases, we achieve a general yet far less ambiguous result.
    
    > >>I am starting a slow read of the formula proposal this weekend and will 
    > >>post comments on specific sections as I reach them.
    
    Great!!
    
    > Sorry, what you have is *not* a conformance test.
    
    Correct; the test cases are NOT a full conformance test. Sorry that there was this misunderstanding... I was _contrasting_ with the experience of full conformance tests, not claiming that the test cases here are a full conformance test. It's a "quickie" test, and without anything better I'm sure it will be useful, but its REAL purpose is to squash latent ambiguities that, despite our best efforts, will always hide in any English prose.
    
    An application has to conform to the spec as written - NOT just the test cases.  It is the COMBINATION that is powerful.
    
    
    > So, let's at least disagree on what is at issue:
    > 
    > 1. How to specify normative behavior? (I would not use test cases.)
    > 
    > 2. Where should test cases go? (I would not include test cases in the 
    > standard.)
    
    I would tweak that.  I _agree_ that test cases should not be the ONLY thing that specifies a function.  Instead, the draft includes test cases as PART of the specification of normative behavior, because doing so turns out to eliminate the many latent ambiguities that seem to always crop up in English prose based specifications.
    
    > Please do not take any of my comments as doubting the usefulness of the 
    > test cases. I am sure they are very useful but I do disagree on the role 
    > you want to assign them in this standard.
    
    I understand.  I knew going in that this was an unusual approach.
    
    I ask that you (and others) keep an open mind, and take a look at it.  It's obviously POSSIBLE to move the test cases into some sort "TestCase" style that is part of a rationale document and not part of the final specification.  As long as there's a single master editable document, from which the rationale and specification are generated, it'd certainly be workable.  But that does not make doing so a good idea.
    
    So take a peek at how it ACTUALLY works, before judging it.  Thanks.
    
    --- David A. Wheeler
    


  • 15.  Re: [office] Formula: test cases

    Posted 03-29-2007 18:55
    David,
    
    A longer response in a bit, I just got a thesis proposal to review for a 
    friend dropped on me, but a humorous observation:
    
    David A. Wheeler wrote:
    


  • 16.  Re: [office] Formula: test cases

    Posted 03-29-2007 19:55
    I said:
    > >So take a peek at how it ACTUALLY works, before judging it.  Thanks.
    
    Patrick Durusau:
    > I will be watching how it works rather carefully.
    
    That's all I can ask for.  Obviously, if the TC rejects it, then change will be required (e.g., moving the test cases into a new annotation style). I have an opinion (surprise?), but my goal is to have a good specification, not a quarrel :-).
    
    But I urge all members to give this approach a fair consideration. You might find that this unusual approach has many merits for a formula specification.
    
    --- David A. Wheeler