-
Notifications
You must be signed in to change notification settings - Fork 0
Scalability in natural language testing
Imagine there are hundreds of language templates defined in the LanguageTemplateContainer and hundreds of nlxx and nls files written. Will this amount of instructions defined and used be maintainable?
For scalability and maintainability reasons the following best practices are important to follow:
1) Consciously distinguish between the following types of natural language instructions:
- Stage instructions (for meta information only, e.g. "Test-Phase: Arrange)
- Imperative statements (e.g. "Enter in field...")
- Questions (e.g. "Is the number of table entries "3"?")
- Passive statements ("The number of table entries is being stored as <Order Number>.")
1a) Use imperative statements only to operate the system under test. For applications with a graphical user interface this means manipulating the current view or page.
1b) Use questions to prove an expected outcome that are answered with either 'Yes' or 'No'. The expected outcome is supposed to have business value and is typically defined by a domain expert. Ideally, formulate your question in such a way that for a successfully executed behaviour the answer is 'Yes'!
1c) Use passive statements to store test data for further references during the current XX. SysNat allows to "persist" any value or data object (e.g. file) that is created during test execution. Those dynamic data objects are not stored permanently. They are available during runtime until the current XX has terminated. To make that work, the passive statement must contain a reference indicated by '<' and '>'. Those references can be used in later instructions to refer to this value data object.
2) Don't repeat yourself (DRY) and avoid to build synonym instructions. Use the same expression for the same action, e.g. always use "Enter in field "Name" value "Bob".". Do not invent arbitrary variants like "Into field "Name" put value "Bob"." or "For "Name" set "Bob".".
3) Find for each graphical element (text field, selection box, radio button, checkbox, ...) a specific verb or expression that describes the manipulation operated on it, for instance, "Enter in field...", "Click button...", "Select in selection box...".
Applying these best practices, the number of language templates remains relatively small and manageable. A list of already existing and available language templates are found in the help directory.