test data - food for your test automation framework

Post on 07-Jan-2017

3.678 Views

Category:

Software

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

TEST DATA – FOOD FOR TEST AUTOMATION FRAMEWORK

Anand Bagmar Software Quality Evangelist

@BagmarAnand about.me/anand.bagmar

ABOUT ME

Why are you here?

Test Automation

A PRACTICE THAT MAKES TEAMS SUCCESSFUL?

Test Automation

A PRACTICE THAT MAKES TEAMS UNSUCCESSFUL?

Why do we do

Test Automation?

QUICK FEEDBACK

Automation -

A Safety Net

How to get value from

Test Automation?

Run on every change in the codebase

Product & Test

What makes Automation successful?

o  Repeatable

o  Deterministic

o  Indicates Quality

What makes Automation Repeatable?

Test Data

WHAT IS TEST DATA?

¨  Input - Data required for test to execute

¨ Environment configurations

¨ Credentials

¨ URLs

¨ …

¨ Output - Expected Data as output of actions done on Product-under-test

What is a Design Pattern?

Test Data Patterns

Why do we need to think differently about Test Data?

CRITERIA FOR TEST DATA

¨ Data is complex

¨ Needs to mimic “real” data

¨ Needs to be unique

¨ Data can be nested

¨ Though specified as static, may need to be Dynamic

¨ Data can be shared and reused

Case Study

23

24

25

Code sample

What did we observe?

DIFFERENT WAYS TO SPECIFY TEST DATA

¨  In Test implementation

¨  In Test specification / intent

¨  In code … separate data structures / classes / etc.

¨ External files

TEST DATA SPECIFICATION EXAMPLES

¨ Excel

¨ CSV

¨ Property

¨ XML

¨ YAML

¨ Database

¨  Json

CRITERIA FOR SELECTION

¨ Easy to specify

¨ Easy to read and consume (by test framework)

¨ Ability to override specified data, easily

¨ Usable

TIPS FOR IMPLEMENTATION

¨ Consistent way to specify test data

¨ Read the data – as Business Entities

¨ Override as appropriate

¨ Create DSL to give meaning to data

¨ Use in test implementation

¨  Implement Test Data Entity Utilities – Build, Equals, Copy, Find, etc.

WHICH IS THE “BEST” PATTERN TO USE ?

It DEPENDS! on the

Context!

Some tools

35

@BagmarAnand about.me/anand.bagmar

THANK YOU

top related