Keyword-driven testing
Keyword-driven testing, also known as table-driven testing or action-word testing, is a software testing methodology for automated testing that separates the test creation process into two distinct stages: a Planning Stage, and an Implementation Stage.
Contents |
[edit] Overview
Although keyword testing can be used for manual testing, it is a technique particularly well suited to automated testing[1]. The advantages for automated tests are the reusability and therefore ease of maintenance of tests that have been created at a high level of abstraction.
[edit] Methodology
The keyword-driven testing methodology divides test creation into two stages:-
- Planning Stage
- Implementation Stage
[edit] Definition
A keyword in it's simplest form is a aggregation of one or more atomic test steps.
[edit] Planning Stage
[edit] Examples of keywords*
- A simple keyword (one action on one object), e.g. entering a username into a textfield.
| Object | Action | Data |
|---|---|---|
| Textfield (username) | Enter text | <username> |
- A more complex keyword (a combination of test steps into a meaningful unit), e.g. logging in.
| Object | Action | Data |
|---|---|---|
| Textfield (domain) | Enter text | <domain> |
| Textfield (username) | Enter text | <username> |
| Textfield (password) | Enter text | <password> |
| Button (login) | Click | One left click |
[edit] Implementation Stage
The implementation stage differs depending on the tool or framework. Often, automation engineers implement a framework that provides keywords like “check” and “enter” [1]. Testers or test designers (who don’t have to know how to program) write test cases based on the keywords defined in the planning stage that have been implemented by the engineers. The test is executed using a driver that reads the keywords and executes the corresponding code.
Other methodologies use an all-in-one implementation stage. Instead of separating the tasks of test design and test engineering, the test design is the test automation. Keywords, such as “edit” or “check” are created using tools in which the necessary code has already been written. This removes the necessity for extra engineers in the test process, because the implementation for the keywords is already a part of the tool. Tools such as GUIdancer and QTP
[edit] Pros
- Maintenance is low in the long run:
- Test cases are concise
- Test cases are readable for the stake holders
- Test cases easy to modify
- New test cases can reuse existing keywords more easily
- Keyword re-use across multiple test cases
- Not dependent on a specific tool or programming language
- Division of Labor
- Test case construction needs stronger domain expertise - lesser tool / programming skills
- Keyword implementation requires stronger tool/programming skill - with relatively lower domain skill
- Abstraction of Layers
[edit] Cons
- Longer Time to Market (as compared to manual testing or record and replay technique)
- Moderately high learning curve initially