Sunday, 15 August 2010

Keyword Driven Framework

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.

Suggested Approach1:
1) Identify the list of objects of the Application and most frequently used set of operations  performed on them
2) Spy those objects to identify the native class of the tool and also find out native methods of the tool for those objects
3) List out most frequently used operations/methods performed on different classes of the objects
4) Classify the methods listed in step3 to the keywords
5) Maintain 3 excel sheets as below
   i) Testdriver-> an excel sheet which contains list of test cases to execute between start and end keywords
  ii) Testcase-> an excel sheet which contains keywords/actions as well as object name(the alias defined in step iii)
iii) Objects-> an excel sheet which has list of objects and properties which can be arrived by spying on the application, for each row of an object given an alias, so that it can be referenced by the test case excel sheet
6)  Write a main function which iterates through the Testdriver excel sheet, which has reference to testcase excel sheet and objects excel sheet .For each test case it places calls to functions as below
func1: iterates through Objects excel sheet and builds a hashmap/dictonary of the object and its properties.Basically buids a keyvalue pair
func2: iterates through which TestCase excel sheet which has switch case on keywords, each case statements intern calls a method defined for the keyword
7) Each method of keywords should have a detailed switch case on the object types, which in turn has a code to perform operations on AUT

Advantages of Suggested Approach1:
1) No need to  have advanced knowledge in Automation tool
2) Consistency of the script development is achieved across the project
3) Easier to maintain scripts
4) Easier to maintain test data
5) Faster development of scripts
6)  Easier to schedule  the scripts with out any test management tool
7) Can be used across all applications,with little modifications to keywords. Provided the automation tool supports record and play back on the Applications

1) It restricts individual learning on tool
2) Little bit tough to debug as there is no code except keywords in it
3) Need to remind keywords and there usage
4) Little bit tough to handle conditional execution of scripts,alternative is write code in a functions and call the function in test case  excel sheet using predefined keyword

1 comment: