Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Sunday, August 11, 2013

PL8: On the edge

Yet another area in my 9 coding areas pseudo-localization can test is expansion and edge case handling on I/O data.

In PL5: Expanding your universe, I discussed how pseudo-localization of the user interface can test the effect of translation expansion on the look and layout. Here I'm focusing on I/O.  If input/output data is pseudo-localized such that strings are significantly expanded, it can verify the handling of expanded strings.  This is not just a display issue, it is also and more significantly a processing issue.  Once again, I repeat my mantra: people buy software to do something to their data.  If that something is not done correctly, the software is not useful to them, and they will look for software that is.

What tends to be difficult to determine is what an input field maximum is (and should be).  There is a count question:  should the limit be in bytes or characters?  This is less important than determining how many characters should logically be allowed in a particular field.  Even fields that seem fixed in one country could vary considerably in another.  For example, postal codes can vary from a length of zero (no code) to as many as 12 characters (for some US territories).  This brings up another question:  should the length restrictions vary with the locale?  (Or the localization?)  The same questions hold for a minimum size.

Determining what should happen if the data is greater than the maximum is important.  Should the data be truncated or rejected?  Should a warning message pop-up if it's a user input field (as opposed to programmatic input), or should the user simply not be allowed to continue typing?  Again, similar questions need to be answered for below minimum.

All of the above is in the realm of design rather than testing, but the point is that the desired behavior should be defined.  Pseudo-localization testing will determine what is happening in certain circumstances, but if the behavior is undefined, it is difficult to decide what sort of pseudo-localization needs to be run, and how many locales should be tested.

Similar to PL5, you're looking at the layout and aesthetics of the UI with the expanded text: is it wrapping awkwardly? Is it overlapping other elements? Is it skewing the overall layout?  More importantly, though, is the integrity of the text:  has it been truncated?  Is the last character intact? (if the end of the pseudo-localized string ends in a multibyte character) Has some of the middle text been lost due to over maximum characters overlaying the previous characters in the string?

To the extent that I/O will be displayed, pseudo-l10n can help test paging on smaller devices, as well as PC and tablet.  The expansion from the pseudo data will likely move things around, and it's important to determine what effect it will have, and whether it causes a problem for users working in other languages.

At the risk of boring you with repetition, this is not a substitute for testing with multilingual data, simply a quick way to get data for early testing of these important cases.
Because you want to do unto data as your users expect you to do.

Wednesday, May 08, 2013

Linking all the Internationalization Myths

Since the Internationalization Myth series spans quite a length of time, I thought I'd put links to all the posts in one blog entry, so without further ado, here they are!
  1. Republishing the myths - background information on the series. 

  2. Myth #1: "Internationalization means externalizing the user interface so the software can be translated." 

  3. Myth #2: "Translators choose the best phrase in the target language." 

  4. Myth #3: "The code is in Java and therefore it's internationalized." 

  5. Myth #4: "My product supports Unicode and therefore it's internationalized." 

  6. Myth #5: "My product uses open source and so internationalization requirements don't apply." 

  7. Myth #6: "ISO-8859-1 is the standard encoding for HTML." (This one has almost gone away.)

  8. Myth #7: "All company employees speak English, so only English needs to be supported by internal tools."

  9. Myth #8: "Administration interfaces don't need internationalization." 

  10. Myth #9: "We've never localized this product/module/component/blidget, so it doesn't need internationalization." 

  11. Myth #10: "We added internationalization in the last release, so we're done." 

  12. Myth #11: "If something is wrong, our customers will tell us." 

  13. Myth #12: "My product works in Japanese, therefore it's internationalized." 

  14. Myth #13: "Internationalization is implemented after the base product and is written by a separate group of engineers." 

  15. Myth #14: "Internationalization is only needed in the software development department."

  16. Myth #15: "Internationalization means making the code easily localizable." 

Monday, January 21, 2013

PL7: I-O, I-O, so off to work I go

I've said this before, but it bears repeating:  People buy software to do something to data.  For a more extensive discussion of this, see the Internationalization Myth #1 blog.  Go on and read it, it's very short, and I can wait.

There, that didn't take long.  And now my meaning is clear, you can see how important it is to test software to find out whether it can handle data in a particular character encoding.  But the problem is, where can you get the encoded data to run through the system in a hurry?  Easy, just take your test data files, of which you most certainly have an extensive collection, and pseudo-localize them.  You might need to tweak your pseudo-localization tools a bit, but it's well worth it.

If the data is pseudo-localized with characters from a broad cross-section of Unicode, you'll be able to see if Unicode is processed and output correctly, without mangling anything.  Using other character sets, such as EUC-JP, will bear out whether your software can handle those as well.  It doesn't matter if it's supposed to convert, reject, or process these character sets directly, so long as it handles them in an appropriate manner for the markets you want to sell to.

Check the output and make sure the data has not been corrupted.  For example, if the phrase "Some pseudo localized text" were pseudo-localized with a cross-section of Unicode characters, it might look like this:
§õʍϵ Рѕәטᴆᴑ ᴌᴼᶜᶏḼἷ₹ﭺ口 下王丈৳
Just in case it doesn't get to you unmangled via this blog, or you don't have the fonts loaded, here is an image:
If the software you're testing is supposed to store it in a database, and then retrieve it intact, make sure that the output exactly matches the input.  If it's supposed to break the text into individual characters, check that the characters are the same.  You get the idea.  With pseudo-localization, it should be easy to automate the testing (provided the testing software is properly internationalized) as well as visually test it.

Please don't consider this a substitute for proper multilingual testing.  Each language has its own formatting and processing rules that cannot be tested via a simple pseudo-localization.  The classic example is Thai, which has no spaces or syntactic characters to divide words.  In order to parse Thai words correctly, a dictionary must be used, along with some grammatical processing.  In correct pro cess in go pens up big can sofw. or Ms.  Forth E sake of you ruse RS, create some actual input test data from the languages used in your markets.

And remember that this does not test locale-specific data handling.  That data will also have to be created to represent locales in your target markets.

Test the I-O, your 亹stomers wiѭ th⌘k yo=FA for ☃.  Or at least they'll be able to.

Wednesday, September 26, 2012

PL6: Don't get too attached to fragments

While fragments might be good for a Greek mosaic, they aren't useful for Greek translation.  Or any other translation, for that matter.

In moving text strings to external resources, some engineers try to be as efficient as possible. Efficiency is certainly a laudable attribute, but when it comes to strings, it may mean taking a less obvious path.

Let me clarify.  A simple set of user interface strings might be:
n file(s) have been deleted.
n folder(s) have been deleted.
n file(s) have been moved.
n folder(s) have been moved.
Looking at these strings in English, one might be tempted to break them down into what seem to be obvious components:
file(s)
folder(s)
have been deleted.
have been moved.
Super!  The code just needs to pick up the components and concatenate them. Fewer words, less storage space taken, and the translation should be cheaper and faster, right?

Well, no, not exactly.  The problem is that while in English these components can be simply concatenated and still make sense, this is not true in other languages.  Possible strings appearing in the UI in somewhat stilted English as:
1 file(s) have been deleted.
2 file(s) have been deleted.
1 folder(s) have been deleted.
2 folder(s) have been deleted.
1 file(s) have been moved.
2 file(s) have been moved.
1 folder(s) have been moved.
2 folder(s) have been moved.
Should become in Italian:
1 file è stato eliminato.
2 file sono stati eliminati.
1 cartella è stata eliminata.
2 cartelle sono state eliminate.
1 file è stato spostato.
2 file sono stati spostati.
1 cartella è stata spostata.
2 cartelle sono state spostate.
Ignoring the possibility that this might not be the best Italian translation, note how many changes occur from sentence to sentence, due to changes in gender and number. The translator is not given the option to accommodate these changes, and must cope. The resulting translation would be extremely poor, akin to English users seeing a string such as "These file she have been deleted." Not exactly user-friendly.

Using a pseudo-localization string that has some sort of opening and closing characters, such as curly braces, will expose concatenated fragments. If a closing brace is followed by an opening brace, chances are the resource strings need some defragging.

Wednesday, January 19, 2011

PL5: Expanding your universe

I expect this next test in the series doesn't cover the universe, but it will get you further towards whole Earth applications.

The pseudo-localization applied to your text resources should grow the length of the strings. Depending on your application, I recommend the length is increased by about 50%, at least for short strings. The additional text should also include Asian characters, that is, characters from the Han range of Unicode. Let me explain why.

One aspect of testing is edge cases - testing limits and restrictions to see if they are working and how. This includes minimum, below minimum, maximum, and above maximum lengths. Translation usually grows the length of strings, both in byte count and in display. Fields in the user interface (UI) are often limited in length (byte and display), due to display constraints. Expanded pseudo-localized text will show how the UI could change. And more.

What are you looking for? For starters, you're looking at the layout and aesthetics of the UI with the expanded text. Is text wrapping awkwardly? Is it overlapping other text or screen elements? Is it pushing other objects out of position, skewing the overall layout? Do items line up where they're supposed to? Is the text truncated? Obviously limitations are necessary due to screen size, especially for mobile applications. But translators aren't mind readers - they're probably only seeing text in a resource file or translation tool. The only indication they'll have of a length restriction is the comment that you write next to the string to be translated. Which of course you have done.

Remember that I recommended using Asian text in the pseudo-l10n? This is useful for checking that these characters are legible in the space provided; by legible I mean that the stroke lines are distinct and the tops or bottoms of the character are not cut off. Asian characters are often more intricate and complex, requiring a larger font and additional vertical space to be rendered legibly. However, Asian translations will frequently shrink in width. A pseudo-l10n won't bear that out because it usually adds on to the existing string length. But you could run one that replaces the string with shorter Asian character strings, and see what that does to the UI.

We all need space for understanding, don't we?

Tuesday, January 11, 2011

PL4: For display only

This next pseudo-localization test in the series is very straightforward. Maybe.

You can verify whether your software correctly handles a particular character encoding by pseudo-localizing the resource files into that encoding. Use a broad spectrum of characters from the encoding, if not all of them, to check that the entire set is handled properly. Simply pseudo-localize the resources, bring up the pseudo-localized user interface, and view the text. Of course, you have to know what you're looking at, but if you've familiarized yourself with the set of characters used in the pseudo-localization, that shouldn't be a problem.

But that's not all! Since all of you are using a Unicode encoding for your user interface (a-hem), there's something else you can test. Some characters use a different font depending on the language they are representing. So for example, if characters from the Han section of Unicode are used in your pseudo-localization, you can set the locale to a Chinese region and verify the characters are in a Chinese font. Then change the locale to a Japanese region and see if a Japanese font is used to display them. Again, you have to know what you're looking at, but if your software is responsible for display, this is an important test. (Take a look at these charts, particularly the second and third sections.) If necessary, select a few key Han characters that differ in Chinese and Japanese, make up an image chart, and familiarize yourself with them. As they're used over and over in the pseudo-localization, you'll get to know them well.

Your customers will be happy you did.

PL3: May we dance with your dates?

This is the third entry in my series of the 9 coding areas pseudo-localization can test.

Amongst ourselves in internationalization, we refer to certain types of data as locale-sensitive. This is data that changes in some way from region to region (locale to locale), typically in format. The classic example is a date. And the classic example of this example is the short format in the US, month/day/year, that becomes day/month/year in most European countries; today is January 11, 2011, written 1/11/11 in the US, but 11/1/11 in the UK. (Often this is accompanied by some US baiting about how illogical that format is, but we won't go there and mention that in human terms, the day becomes less important beyond a week or so, and the month comes into prominence, lasting an entire year, when finally the year is needed, so it's stuck on the end. And it's written month day, year in longer formats, as above. But I won't mention any of that here.)

There are many more locale-sensitive pieces of data: numbers, time, prices, measurements, weights, telephone numbers, addresses, sizes, etc. Some of these data formats have been standardized, so that programs can select them using locale identifiers and apply them to the data. The Common Locale Data Repository (CLDR) is a public database with locale formats for many locales throughout the world (though admittedly there are no sizes, nor telephone numbers, nor postal addresses). Internationalization library functions and methods use it for formatting and parsing locale-sensitive data.

As these formats can be accessed programmatically for most of the locales of the world, they should be. That is, rather than externalize a date format for a localizer to alter to suit another locale, dates should be programmatically formatted. Why? The long answer is another blog entry, however the short answer is that there are many more formats than there are localizations. For example, the English localization is usually a single localization, but formats for English-speaking locales vary (see the short date format example above). The same is true for French, Spanish, Traditional Chinese, and so on.

But what does all this have to do with pseudo-localization testing?

You may remember my post about using pseudo-l10n to test whether localized files are picked up when they should be. Or perhaps you don't, in which case you might want to review it. Anyway, once you've set up your system such that the pseudo-localized files are mimicking an actual locale, you can exploit that setup to check on whether locale-sensitive formats are programmatically determined.

Run the system with the locale set to the pseudo-localized files' locale, and pay special attention to the formats of dates and numbers. Now change the locale setting to one that has different formats and run again. Check the dates and numbers - have they changed format? You might want to verify the formats against those listed in the CLDR; if you're looking online, check the summary charts. Start with the language base link, then drill down to get to the specific locale you're looking for.

Change the locale to a third value and check again. The formats should be changing appropriately each time. If not, to your customers today might just look like November 1, 2011.

Friday, December 10, 2010

PL2: It's good to be resourceful

Another aspect of software internationalization that pseudo-localization can test is whether all relevant resources have been made localizable.

Now, I understand that in order for this test to work, everything that is shown to the user must be visually inspected. This means the entire fixed user interface must be made to display, including windows that come up when various menu options are selected, pop-up windows, help messages, alternate text, user messages, and, that most difficult of entities to bring to view, error messages.

It's funny, when I tell people pseudo-localization can test 9 aspects of internationalization (actually I started with 5 and found more as time went on), this is the test they claim is not valid. And yet, at the same time, this aspect is the primary one that people claim they are testing when they pseudo-localize their product. Go figure. Personally I'm not confident that you can verify the entire user interface has been properly externalized this way, only a good portion of it, and therefore likely all of it. The key word is likely.

So run your pseudo-localization tool, bring up the product (hopefully it picks up the pseudo-localized resources - see the previous post), and have a good look. Try to create some errors so you can at least check that some error messages are being picked up correctly. In case you're wondering, you're checking for text that is still in the source language, without the additional characters or character transformations that the pseudo-l10n creates.

And then, move on to the next test.

PL1: A loose l10n is an easy pick-up

The first in my series of the 9 coding areas pseudo-localization can test.
Note: localization is often abbreviated l10n, because there are 10 letters between the l and the n. Sometimes people will capitalize the L to distinguish it from the 1. (PL1 is Pseudo-Localization 1, not Programming Language 1, for those of you old enough to remember that.)

Providing the pseudo-l10n is configured as a real localization will be, it tests whether or not the product will pick up the translated resources.

Once you run your resource files through a pseudo-translator tool, set them up as being for some locale other than the source locale. For example, if your code is typically written in the US and run on environments set to the en-US language/locale, then treat your pseudo-localized files as if they were the Japanese translation for Japan, that is, ja-JP. That typically means appending "ja-JP" to the file names, but may mean they should be stored in a ja-JP directory or database. This exercise also provides familiarity with the localization structure of the product - where the resources reside and what the naming conventions are.

Next, continuing with the example, the environment needs to look like a typical Japanese customer's. Whether that means the system settings are set to ja-JP, or the software itself is set to Japanese, or just the session, make it so. Maybe any of those settings are supposed to make your software switch to Japanese - all environments should then be tested. A side benefit of this is learning how other language/locale environments are set, and how the product is supposed to behave (yes, many folks don't know what the expected behavior should be in some cases).

Now, run your software. Is it picking up the pseudo-Japanese files in all areas of the product? Is it displaying date, numeric, and other dynamically determined formats according to the Japanese locale preferences? Did it do this without requiring a rebuild?

If not, you've got some work to do.

Monday, September 14, 2009

Long time, new series - The 9 Coding Areas Pseudo Localization can Test

Hello out there!
It's been a very long time, but not in my head. That is, I always have lots of topics that I'd like to blog about, just very little time to blog. The topic I'd like to begin on today is pseudo-localization, also known as pseudo-translation, pseudolocalization, pseudo-l10n, and probably some other names.

What pseudo-localization is
Pseudo-localization is the programmatic localization of a software product to enable early testing of product localizability. Typically this entails automatically transforming the translatable text into characters outside of ASCII in another character encoding. Sometimes it may include changing localizable objects that are not text, such as data templates and patterns.

For example, some pseudo-localization tools will allow the user to specify a string of characters to be appended to the beginning of a text string and another to the end. When the tool is run against the text resources of the product, all text strings will have these characters appended to them. The intention is that the appended strings contain accented characters and characters from other scripts (such as Russian or Chinese).

Why it is used
The usual reason given for pseudo-localization testing is to determine whether the user interface text is localizable; that is, whether the text has been put into separate resource files to enable localization without changing the program code files. Since the translation is automated, this testing can be done much earlier in the development process than if the real localization were used.

Two other aspects are also commonly tested as an adjunct to the localizability area: whether strings have expansion room, and whether another character encoding is handled correctly.

But the truth is that there is much more pseudo-localization can help test. In this series, I'll explain how it can be used to test 9 areas of internationalization. Stay tuned.

Friday, August 03, 2007

Myth #12 - More quality by the dozen

Continuing in the myth series, we address the scope of internationalization:
"My product works in Japanese, therefore it's internationalized."
Seems sort of logical doesn't it? I mean, if Japanese data gets processed and displayed correctly, surely that means the internationalization is correct? Alas, no. In fact, for a long time there was (and to some extent still is) a specialty called "Japanization". So many companies in the U.S. wanted to take advantage of the lucrative Japanese market that firms sprang up, offering this service. They would take the software and alter it to enable Japanese data processing and display on Japanese-capable machines. Sounds pretty good, huh? Except that it was expensive, time-consuming, and had to be repeated for each release. But we'll get into that myth later.

But let's say you didn't send it to a third party "Japanizer", and you really tried to do proper internationalization over the course of design and development. If you test using Japanese, then that must indicate everything is OK, right? Well, no. It's true that testing with Japanese can uncover some real internationalization problems, but not all of them. Arabic, Hindi, and French have different i18n issues from Japanese - even Chinese is different. What are these differences? These other languages often use different charsets, and in the case of Arabic and Hindi, different rendering capabilities. Beyond language, the Japan locale has its own data formats, which are not the same as France, or Brazil, or Russia, etc. And as a further area to test, Japan is within a single time zone, so you haven't tested a multiple time zone situation (a genuine problem for the U.S. with its 7 time zones).

But wait, there's more! Most customers require multilingual capabilities in their software, and that needs to be tested. For example, if you're working on server software, consider that companies will run the software on a server which is set to one language and locale (with the admin possibly using a different language for the console), but clients will be using lots of different languages and locales as they contact the server. This is a very common configuration nowadays. And it's not limited to servers. Just because someone is running the Italian localization of your email client doesn't mean that all their emails will be in Italian, or even Latin script. They may be emailing in Thai, and you need to verify that your product can handle these sorts of multilingual requirements.

For more information on testing the internationalization of software, see my article, Internationalizing Testing. And keep reading the myths!