database solutions test automation

16
© 2013 Acxiom Corporation. All Rights Reserved. © 2013 Acxiom Corporation. All Rights Reserved. Paweł Gutowski Test Automation for Database Solutions 2015-09-04

Upload: stowarzyszenie-jakosci-systemow-informatycznych-sjsi

Post on 14-Apr-2017

185 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved. © 2013 Acxiom Corporation. All Rights Reserved.

Paweł Gutowski

Test Automation for Database Solutions

2015-09-04

Page 2: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Agenda

• Acxiom

• Why 2 complementary approaches to test automation?

• Single functionality testing

• End 2 End testing

• Continuous integration

• Questions

Page 3: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Acxiom

Why does data matter?

Page 4: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Why 2 complementary approaches to test automation?

Solution that needed test coverage (dummy below is much smaller but should give an idea what is our product)

Page 5: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Single Functionality Test Automation

Page 6: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Single Functionality Test Automation

6

Page 7: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Single Functionality Test Automation

Audits:

Check if there is any difference between tables (actual vs expected result) Example: Full outer join on 2 tables checking if any field is different between them

Check if created table has correct columns (or check any other characteristic) Example: Run query against system views (or catalogue views etc) that verify the structure

7

Page 8: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Single Functionality Test Automation

Page 9: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

End 2 End Test Automation

Page 10: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

End 2 End Test Automation

Page 11: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

End 2 End Test Automation

Page 12: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

End 2 End Test Automation

Example 1 Check if there are any records in BUSINESS TABLE1 that would have Country Code null.

Example 2 Check that if record in BUSINESS TABLE1 has been marked as high quality, it must have

consumer link associated with it in BUSINESS TABLE2

Example 3 Check that values in name_hash field are created the same way for all the records, by applying

concatenation on 3 fields coming directly from source file and hashing the result.

Example 4 Check that all IDs from BUSINESS TABLE1 can be found in BUSINESS TABLE2 as well. The

reverse should happen as well, but only if rehygiene process has not be run.

12

Page 13: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

End 2 End Test Automation

Example5

Field in BUSINESS TABLE1 should be mapped using 3rd party response (if not null)

Otherwise it should be taken from BUSINESS TABLE2 (if not null)

Otherwise, „DEFAULT” value should be set

SELECT COUNT(1) FROM (

<?perl

... Use oracle system view to get list of all 3rd party response tables

... Union them all together

?>)

JOIN -> 2 business tables

WHERE -> business condition is broken

Expected result = 0

Example 6

Verify that if data comes again for existing record but with better priority, it will update existing records. But lower priority should not make

an update SELECT COUNT(1) FROM

JOIN -> 3 tables („before”, „incoming data”, „after”)

WHERE -> tested condition

13

Page 14: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

End 2 End Test Automation

14

Page 15: Database solutions test automation

© 2013 Acxiom Corporation. All Rights Reserved.

Continuous integration

Almost there

• Nightly: End 2 End

• Commit based: Single Functionality (as an addition to unit tests)

Page 16: Database solutions test automation

16