Framework 3: Data-Driven Testing

A data-driven framework is where test input and output values are read from data files (ODBC sources, CVS files, Excel files, DAO objects, ADO objects, and such) and are loaded into variables in captured or manually coded scripts. In this framework, variables are used for both input values and output verification values. 

Navigation through the program, reading of the data files, and logging of test status and information are all coded in the test script. This is similar to table-driven testing (which is discussed shortly) in that the test case is contained in the data file and not in the script; the script is just a "driver," or delivery mechanism, for the data. In data-driven testing, only test data is contained in the data files.

Merits of data-driven testing

The merits of the Data-Driven test automation framework are as follows,

Ø      Scripts may be developed while application development is still in progress

Ø      Utilizing a modular design, and using files or records to both input and verify data, reduces redundancy and duplication of effort in creating automated test scripts

Ø      If functionality changes, only the specific "Business Function" script needs to be updated

Ø      Data input/output and expected results are stored as easily maintainable text records.

Ø      Functions return "TRUE" or "FALSE" values to the calling script, rather than aborting, allowing for more effective error handling, and increasing the robustness of the test scripts. This, along with a well-designed "recovery" routine, enables "unattended" execution of test scripts.

 

Demerits of data-driven testing

The demerits of the Data-Driven test automation framework are as follows,

Ø      Requires proficiency in the Scripting language used by the tool (technical personnel)

Ø      Multiple data-files are required for each Test Case. There may be any number of data-inputs and verifications required, depending on how many different screens are accessed. This usually requires data-files to be kept in separate directories by Test Case

Ø      Tester must not only maintain the Detail Test Plan with specific data, but must also re-enter this data in the various required data-files

Ø      If a simple "text editor" such as Notepad is used to create and maintain the data-files, careful attention must be paid to the format required by the scripts/functions that process the files, or script-processing errors will occur due to data-file format and/or content being incorrect

2 comments:

Unknown said...

excellent explanation..
keep up the good work!

Anish Pillai said...

Very Nice and Simple Explanation.

You can also refer to the below article for more information and sample scripts for Data Driven Framrwork.

QTP Data Driven Framework