test data - food for your test automation framework

36
TEST DATA – FOOD FOR TEST AUTOMATION FRAMEWORK Anand Bagmar Software Quality Evangelist

Upload: anand-bagmar

Post on 07-Jan-2017

3.676 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Test Data - Food for your Test Automation Framework

TEST DATA – FOOD FOR TEST AUTOMATION FRAMEWORK

Anand Bagmar Software Quality Evangelist

Page 2: Test Data - Food for your Test Automation Framework

@BagmarAnand about.me/anand.bagmar

ABOUT ME

Page 3: Test Data - Food for your Test Automation Framework

Why are you here?

Page 4: Test Data - Food for your Test Automation Framework

Test Automation

A PRACTICE THAT MAKES TEAMS SUCCESSFUL?

Page 5: Test Data - Food for your Test Automation Framework

Test Automation

A PRACTICE THAT MAKES TEAMS UNSUCCESSFUL?

Page 6: Test Data - Food for your Test Automation Framework

Why do we do

Test Automation?

Page 7: Test Data - Food for your Test Automation Framework

QUICK FEEDBACK

Page 8: Test Data - Food for your Test Automation Framework

Automation -

A Safety Net

Page 9: Test Data - Food for your Test Automation Framework

How to get value from

Test Automation?

Page 10: Test Data - Food for your Test Automation Framework

Run on every change in the codebase

Product & Test

Page 11: Test Data - Food for your Test Automation Framework

What makes Automation successful?

Page 12: Test Data - Food for your Test Automation Framework

o  Repeatable

o  Deterministic

o  Indicates Quality

Page 13: Test Data - Food for your Test Automation Framework

What makes Automation Repeatable?

Page 14: Test Data - Food for your Test Automation Framework

Test Data

Page 15: Test Data - Food for your Test Automation Framework

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

Page 16: Test Data - Food for your Test Automation Framework

What is a Design Pattern?

Page 17: Test Data - Food for your Test Automation Framework
Page 18: Test Data - Food for your Test Automation Framework

Test Data Patterns

Page 19: Test Data - Food for your Test Automation Framework

Why do we need to think differently about Test Data?

Page 20: Test Data - Food for your Test Automation Framework

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

Page 21: Test Data - Food for your Test Automation Framework

Case Study

Page 22: Test Data - Food for your Test Automation Framework
Page 23: Test Data - Food for your Test Automation Framework

23

Page 24: Test Data - Food for your Test Automation Framework

24

Page 25: Test Data - Food for your Test Automation Framework

25

Page 26: Test Data - Food for your Test Automation Framework

Code sample

Page 27: Test Data - Food for your Test Automation Framework

What did we observe?

Page 28: Test Data - Food for your Test Automation Framework

DIFFERENT WAYS TO SPECIFY TEST DATA

¨  In Test implementation

¨  In Test specification / intent

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

¨ External files

Page 29: Test Data - Food for your Test Automation Framework

TEST DATA SPECIFICATION EXAMPLES

¨ Excel

¨ CSV

¨ Property

¨ XML

¨ YAML

¨ Database

¨  Json

Page 30: Test Data - Food for your Test Automation Framework

CRITERIA FOR SELECTION

¨ Easy to specify

¨ Easy to read and consume (by test framework)

¨ Ability to override specified data, easily

¨ Usable

Page 31: Test Data - Food for your Test Automation Framework

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.

Page 32: Test Data - Food for your Test Automation Framework

WHICH IS THE “BEST” PATTERN TO USE ?

Page 33: Test Data - Food for your Test Automation Framework

It DEPENDS! on the

Context!

Page 34: Test Data - Food for your Test Automation Framework

Some tools

Page 35: Test Data - Food for your Test Automation Framework

35

Page 36: Test Data - Food for your Test Automation Framework

@BagmarAnand about.me/anand.bagmar

THANK YOU