Oracle OrientationSuppose you were writing a text editing program that would display fonts properly on the screen. How would you test whether the font display is correct?
- How could you determine whether the editor is displaying text in the correct typeface?
- How could you determine whether the editor is displaying text in the right size?
- How would you test whether the editor displays text correctly (in any font that the user specifies)? Describe your thinking about this problem and the strategies you are considering.
Right off the bat, it seems like there are broadly two ways that face,size, and font display overall could be tested: inside the program and outside it. (Theology and philosophy caution that this is overly simple, but we'll go with it to start with, at least.)
From inside the program we can look at a few different things to try and assure that the right fonts are put on screen, and we can d this without going any deeper into the code than our application (If the system platform has trouble with kerning or serifs, then that's going to have to be a project for another day...). In a typical programming environment we should be able to inspect and check on the code that changes the font used (methods, verbs) and we should also be able to peek into or analyze the representation of the text itself (attributes, nouns), perhaps in some some sort of text display widget in a graphics toolkit. It should be trivial to peek at this before and after a font change is requested, and compare values. In either case we can verify at least that the name of the font (symbol) is the same in these different places in the functional code paths and the graphics (output) code. At worst we might have to run the program in a debugger or development mode to expose the data we'd need.
From outside the program there are strategies to look at the font used and check it against the expected outcome. It might seem like a stretch to aim a high resolution camera at the display of a computer running the program, but in most cases a full resolution screen grab would serve as well. From there, optical character recognition algorithms can likely be used to find the text in the image and report on the font used by matching against a vetted library of typefaces. A sufficiently sophisticated piece of software could also measure the face size in pixels or some other standard measurement for comparison. In fact, this could probably be accomplished by hand with printed images taken from the tested software. Typesetters and newspaper editors used to commonly have rulers marked in point and pica and there should still be a few of them around.
Perhaps another path would be to use humans to examine the output text as the controls were manipulated. With formal examples of the desired output in hand they would be able to compare and contrast the sample with the output of the tests. Although there is often an emphasis on automation in some testing, depending on what is being investigated as your budget, human testing may be just the thing in some cases.