Checking for the "11st" Number

 


Summary

OpenOffice.org's Writer 1.1.1 word processor has a bug that causes the program to incorrectly recognize proper ordinal numbers. For example, using the AutoCorrect/AutoFormat feature in Writer, a user may type in "1st", and Writer would change the input to be "1st" by superscripting the ordinal ending. However, Writer incorrectly recognizes "11st" as "11st".


Application Description

OpenOffice.org is an office suite including word processing, presentations, and spreadsheets. Writer is part of the OpenOffice.org suite, and is used to create documents and letters. OpenOffice ships in most versions of Linux or can be downloaded for free from their official site.


Test Design

This example demonstrates the use of Domain testing. In Domain testing, we are evaluating a function's acceptance of input by choosing representative data to enter into the data fields.

For ordinal numbers, we can divide each of ordinal endings into sub-categories:

Yet it is not this simple. There are three exceptions to this rule. The 11th, 12th, and 13th. Despite these numbers ending in 1, 2, and 3, we still attach the ordinal ending of "th" to them.

We want to test this function with Domain testing specifically because we are testing very similar input. If we test "1st" and "21st" and "31st" and "41st" and ... and "XXXXXX1st", we would waste much of our time establishing that the application correctly handles what we expect it to do, notice the "1st" on the end of a number and superscript the ordinal ending. So, we test "1st", "2nd", "3rd" and "4th" to ascertain the basic endings are recognized. We might also test "11th", "12th", and "13th". We use 6 numbers to verify the correct recognition of the ordinal endings rather than thousands and thousands of numbers.


Performing the Test

  1. Launch OpenOffice.org Writer and create a new document by clicking on File->New->Text Document:

  2. Turn on AutoCorrect by clicking on Tools->AutoCorrect/AutoFormat:

  3. Under the Options tab, make sure that "Replace 1st... with 1^st..." is checked on:


    This option ensures that when we type an ordinal number, such as "1st", it will superscript the ordinal ending, so that it becomes "1st".

  4. Click 'OK' to return to the document.
  5. Type in "1st" and press the space bar. Writer should now autoformat what you just typed into "1st".

  6. Press 'Enter' on your keyboard to go to the next line.
  7. Now type in "11st" and press the space bar.

Results/Relevance

You can see in the above picture that Writer has turned "11st" into "11st". This shows that what the AutoCorrect/AutoFormat function is doing is looking for the "1st" on the end of the number, and if it is there it superscripts the "st" without verifying if the ordinal ending is valid for that number.

Not only did we quickly and easily find a path to this bug with Domain testing, but we also have a fairly strong idea of how this function works. This means that we do not need to run many other tests with to verify what we have just seen. Naturally, we can run a few more tests to be certain, but what is important is that by approaching this problem with Domain testing, we saw this bug quickly and we also know where in this function to look for other bugs. (For example, "12nd" and "13rd").


Similar Tests/Additional Notes

More information about the bug in this presentation can be found on the OpenOffice.org Issue Tracker.

Another interesting test would be to add false endings to some numbers. For example, would Writer interpret "12st" as a valid ordinal number to be superscripted? This represents another sub-category in our domain testing of the AutoCorrection Ordinal Numbers.


Configuration Notes

Testing OpenOffice.org's Writer v1.1.1 on:


Created 23 June 2004 for the CSTER

All images and written material ©Copyright Sam Oswald 2004

This work is licensed under the Creative Commons Attribution-ShareAlike License.
To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/2.0/
or send a letter to
Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305,
USA.