3 Results
The authors found that it was extremely difficult to achieve a widely-understood, Thai translation of Cucumber feature specifications. Three major obstacles were discovered:
• Not all keywords could be written naturally in the phrase initial position. The concept of Then sounds more natural rendered in Thai as จะ (will) which occurs between the subject and the verb.
• Borrowed words and abbreviations abound in the Thai language. Often, borrowed words provide a more popular, efficient and meaningful phrase than the Thai technical term.
• Each problem domain is related to its own set of professional jargon and borrowed words. The experts in the Thai language were often in disagreement over the correctness of the expressions suggested by the experts in the various problem domains.
The Gherkin keyword Then was universally problematic. In Thai, the outcome resulting from a list of conditions were often accompanied by the word จะ (will) as in ฉันจะออกจากโปรแกรม (I will leave the program). However, since this word is normally placed between the subject and verb of Thai sentences, the automatic parsing of such renderings would be very difficult even though the readability would greatly improve.
In Thailand, software engineers and programmers have often used the Thai word ดังนั้น to represent the Then portion of conditional process flow but non-programmers found the use of this phrase awkward in describing actions arising from a set of constraints. A compromise was suggested in which ดังนั้น: is used as a label instead of the first word in a phrase. This alternative was acceptable to all informants and has been in used the final version of the Thai Cucumber specifications.
Similarly, as seen in Table 1, various key terms of the business rationale included in the description of features were often not in phrase initial position. As described earlier, actions arising from various constraints are normally either unmarked or marked by adverbs that occur after the subject. It is useful to note that English description also shares this feature and that the Gherkin language has yet to standardize keywords for the components of the business rationale.
The Thai versions of the Cucumber specifications are shown below in the following Code Examples. In each case, the Thai representing the Gherkin keywords are shown in boldface type.
Although there was a fair amount of discussion with the informants over the use of English variable names in Code Example 11. In the end, the consensus was that Thai names would be too confusing because Thai variable names are not commonly used in programming in Thailand even though languages like Ruby and Lua would support them.
Code Example 12 was the least controversial scenario of the test set. However, Code Example 13 is the result of numerous revisions to standardize the expressions used. By standarding the phrases used, the parsing and extraction of the test parameters from the description was greatly simplified without loss of readability of the text.
Code Example 14 represents the Thai translation of Code Example 9. This Cucumber description of the game specifications caused numerous of problems in translation. Generally those familiar with electronic game play either lacked confidence in about their Thai description of the behaviour or used borrowed English terms and abbreviations. In addition, they disagreed with the specification and kept wanting to change it to a more aggressive behaviour. On the other hand, those who are experts in the Thai language had limited experience with game play and disagreed over the rendering of whether the strength of a soldier should be rendered as แข็งแรง (strength as regards to fitness) or กำลัง (strength as a measure of power).
Some programming paradigms are not easily captured in Thai. The state table in Code Example 15 presented a challenge as the convention is not widely used by non-programmers. Likewise, the use of keywords to represent parameters in a definition used in Code Example 16 required special attention. Because Thai words in a sentence are not separated by whitespace the < character has been appended to all keywords that are expected to exist in the phrase initial position. Labels are unmarked as they are expected to be followed by punctuation or white space.
As a final check of the Thai definitions, Cucumber was run in Thai mode using the test features described above. The step definitions were collected and inspected. Code Example 17 shows the test methods for verifying the behaviour of calculator division as described in Code Example 12. The regular expressions of these test steps helped to verify both the division operation of the calculator class and the Thai Gherkin definitions.