Top Banner
Automating the testing of your BI solutions with NBi Cédric L. Charlier
37

Automating the testing of your bi solution with n bi

Aug 04, 2015

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Automating the testing of your bi solution with n bi

Automating the testing of your BI solutions with NBi

Cédric L. Charlier

Page 2: Automating the testing of your bi solution with n bi

Agenda

• Why automating is a must?• Tests with queries (Sql/Mdx/Dax)• Tests with ETL packages (SSIS)• Testing multidimensional and tabular models (SSAS)• Automating the creation of test-suites

Page 3: Automating the testing of your bi solution with n bi

What’s automated

testing?

A piece of software written to reproduce

steps/actions defined in a manual

process

Page 4: Automating the testing of your bi solution with n bi

Benefits of automation

Allow testing to happen more

frequently

Speed up testing to accelerate releases

Improve test coverage

Ensure consistency

Page 5: Automating the testing of your bi solution with n bi

Tests automation doesn’t apply to

Business Intelligence

Page 6: Automating the testing of your bi solution with n bi

Wednesday, November 24, 2012Est. 1869 Price 6d

More than 33% of BI projects fail to deliver

Lack of agility. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoqueCum sociis natoqueCum sociis natoque

Low quality of deliverables Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturientAenean commodo ligula eget dolor. Aenean massa. Cum sociis natoqueCum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec,

Simply Too late.Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec,

Member of the Asscoiated Press . Aenean commodo ligula eget dolor.

Aenean. Aenean commodo ligula eget dolor. Aenhswse. Cejhciebce fcdcdcd.

ILLUSTRATED WEEKLY NEWSPAPER

Page 7: Automating the testing of your bi solution with n bi

We haven’t time to

create these tests

Page 8: Automating the testing of your bi solution with n bi

Time to execute a test-suite

1.0 1.1 1.2 1.3 1.4 1.5

Manual

Automate

Release

Ela

pse

d t

ime

Exponential slope

Why?- New

objects- Old objects

Page 9: Automating the testing of your bi solution with n bi

Time to write a test-suite

1.0 1.1 1.2 1.3 1.4 1.5

ManualAutomatedWith Framework

Release

Ela

pse

d t

ime

Initial gap

Page 10: Automating the testing of your bi solution with n bi

No existing framework for test

automation dedicated to BI

… I’m not proficient enough in C#

Page 11: Automating the testing of your bi solution with n bi

This framework exists: NBi

No C#, just xml syntax

Open-source

Page 12: Automating the testing of your bi solution with n bi

Agenda

• Why automating is a must?• Tests with queries (Sql/Mdx/Dax)• Tests with ETL packages (SSIS)• Testing multidimensional and tabular models (SSAS)• Automate the creation of test-suites

Page 13: Automating the testing of your bi solution with n bi

Compare queries … result-setsSystem-under-

testAssert

Previous release

Two different releases of a same data

warehouse

Tabular model versus Csv fileDAX

… or any brilliant idea

Cube and data warehouseMDX SQL

Page 14: Automating the testing of your bi solution with n bi

Demo: compare queries’ result

• Compare cube/operational database• 101

• Compare cube/flat files• Defaults and References• Tolerance• Intervals

Page 15: Automating the testing of your bi solution with n bi

Other testing goals for queries

• Performance of a query• Executed in less than x seconds• Cache management

• Syntax of a query• Extract queries from reports and assemblies

Page 16: Automating the testing of your bi solution with n bi

Query’s result and format

• Result’s format• Sample: all the cells have effectively 2 digits after the decimal

separator and this separator is a comma.

Page 17: Automating the testing of your bi solution with n bi

Check calculations in your query

• Assert a logical test, row by row, for you result-set• Sample: Calculate the total price from the unit price, quantity

and discount percentage.

• If at least one row doesn’t validate this logical test, the whole test shift to red

Page 18: Automating the testing of your bi solution with n bi

Agenda

• Why testing automation is a must?• Tests with queries (Sql/Mdx/Dax)• Tests with Etl packages (SSIS)• Testing multidimensional and tabular models (SSAS)• Automate the creation of test-suites

Page 19: Automating the testing of your bi solution with n bi

Demo SSIS

• Assert the execution status of an ETL• Alternatively test performances

Page 20: Automating the testing of your bi solution with n bi

Inside this ETL

DimensionCity

Dimension Scientist

Factless fact Birth/Death

insert insertUnique index

violation

Page 21: Automating the testing of your bi solution with n bi

Setup and Cleanup

• Setup: • Define the state of your testing environment before executing

a test

• Cleanup: • Remove consequences of your tests on the testing

environment

Page 22: Automating the testing of your bi solution with n bi

Tasks and behaviors

• Available tasks • Truncate/Load tables with csv files• Run sql batch, exe or batches• Run Etl packages• Move or delete files• Start/Stop Windows services

• Run-once: execute only once this set of tasks• Parallel: run a set of tasks in parallel

Page 23: Automating the testing of your bi solution with n bi

Demo Setup

• Setup to register a clean state before test’s execution• Assert database’s state after the execution of an ETL

Page 24: Automating the testing of your bi solution with n bi

Agenda

• Why automation is a must?• Testing queries (Sql/Mdx/Dax)• Testing Etl packages (SSIS)• Testing multidimensional and tabular models (SSAS)• Automate the creation of test-suites

Page 25: Automating the testing of your bi solution with n bi

Testing dimension’s members

• “Germany” is a member of dimension “Country”• “Europa” is not a member of dimension “Country”• Dimension “Country” has more than 190 members.• All members of dimension “Country” have at least 4

characters• Members of hierarchy “Month” are ordered

chronologically (and not alphabetically)• …

Page 26: Automating the testing of your bi solution with n bi

Testing structure

• Assert that a dimension, hierarchy, measure, … is visible for end-user in a given perspective.

• Assert the existence of a relation between a measure-group and a dimension.

Page 27: Automating the testing of your bi solution with n bi

Agenda

• Why automation is a must?• Tests with queries (Sql/Mdx/Dax)• Tests with Etl packages (SSIS)• Testing Multidimensional and tabular models (SSAS)• Automating the creation of test-suites

Page 28: Automating the testing of your bi solution with n bi

Some tests are really repetitive

It should be possible to

automate the creation

Page 29: Automating the testing of your bi solution with n bi

It exists! Take a look at

Genbi

A template for the tests

A set of test-cases

Page 30: Automating the testing of your bi solution with n bi

First steps with GenbiFile

loaded from Genbi

Variables to be substituted

(surrounded by $)

Page 31: Automating the testing of your bi solution with n bi

Demo: Genbi

• Load test-cases• From a flat file

• Select a template• Generate the test-suite• Grouping option

Page 32: Automating the testing of your bi solution with n bi

I’m scripting macros to automate the

actions performed by genbi …

With genbiL!

Page 33: Automating the testing of your bi solution with n bi

Sample for genbiL

Subject

Action Parameters

Page 34: Automating the testing of your bi solution with n bi

Demo for genbiL

• Command line

Page 35: Automating the testing of your bi solution with n bi

Conclusions

• Benefits of test automation• Save Time (Time-on-market)• Better Quality (end-result)• More confidence

• NBi• Support large range of different tests• No need of compiler (neither C#)• Good feedback when tests are failing• Open-Source• Automate the creation of your test-suites (genbi / genbiL)

Page 36: Automating the testing of your bi solution with n bi

Read further

• Website: http://nbi.codeplex.com

• Download, documentation, bugs/Wishes list, support

• Blog: http://seddryck.wordpress.com

• Twitter: @Seddryck

Partnership

TestingSquad

Rue des Déportés, 471200 Bruxelles

phone : +32 470/84.07.47email  : [email protected]   : www.testingsquad.eu

Page 37: Automating the testing of your bi solution with n bi