Copyright 2015 Varigence, Inc. Unit and Integration Testing in SSIS A New Approach Scott @varigence.

Slides:



Advertisements
Similar presentations
Creating a Meta Data Driven SSIS Solution with Biml
Advertisements

Module 8 Importing and Exporting Data. Module Overview Transferring Data To/From SQL Server Importing & Exporting Table Data Inserting Data in Bulk.
Introduction to ETL Using Microsoft Tools By Dr. Gabriel.
Deep Dive into ETL Implementation with SQL Server Integration Services
SSIS Field Notes Darren Green Konesans Ltd. SSIS Field Notes After years of careful observation and recording of the Species SSIS, Genus ETL, in both.
Relational Databases Chapter 4.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Error Handling in SSIS Reza Rad SQL Server MVP, Author, DW / BI Architect.
Copyright © 2013 Varigence, Inc. CSV files import automation Kostya Khomyakov
Top 10 SSIS Best Practices Tim Mitchell Artis Consulting The World’s Largest Community of SQL Server Professionals.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
SQL Server 2005 Integration Services Mike Taulty Developer & Platform Group Microsoft Ltd
ETL By Dr. Gabriel.
Chapter 5 Using SAS ® ETL Studio. Section 5.1 SAS ETL Studio Overview.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
SQL Server Integration Services (SSIS) Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server (MVP) Microsoft Certified Technology Specialist.
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
What’s New in SSIS with SQL 2008 Bret Stateham Training Manager Vortex Learning Solutions blogs.netconnex.com.
UNIT TESTING FOR SQL Prepared for SUGSA CodeLabs Alain King Paul Johnson.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Effectively Validate Query/Report: Strategy and Tool Steven Luo Sr. System Analyst Barnes & Noble Session id:
Instrumenting, Monitoring and Auditing of SSIS ETL Solutions SQL Bits Manchester Davide Mauri
SEATTLE BI MEETUP BI & BIG FISH April 2 nd, 2014 Emre Motan.
DTS Conversion to SSIS Conversion Best Practices Mike Davis
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Cleansing Ola Ekdahl IT Mentors 9/12/08.
Database Unit Test MSSQL 2008 & VS 2010 Aung Kyaw Myo.
Oracle Data Integrator Procedures, Advanced Workflows.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Integration Services in SQL Server 2008 Allan Mitchell SQL Server MVP.
Oracle Data Integrator Data Quality (Integrity Control)
6 Copyright © 2009, Oracle. All rights reserved. Using the Data Transformation Operators.
Introduction Selenium IDE is a Firefox extension that allows you to record, edit, and debug tests for HTML Easy record and playback Intelligent field selection.
XmlBlackBox The presentation Alexander Crea June the 15st 2010 The presentation Alexander Crea June the 15st 2010
RoOUG Iunie Bucuresti, 26 Iunie Agenda Inregistrarea participantilor ODI – Common Use Cases 2Iunie 2013.
SSIS – Deep Dive Praveen Srivatsa Director, Asthrasoft Consulting Microsoft Regional Director | MVP.
Scripting Just Enough SSIS to be Dangerous. 6/13/2015 Visit the Sponsor tables to enter their end of day raffles. Turn in your completed Event Evaluation.
Explore engage elevate Data Migration Without Tears Mike Feingold Empoint Ltd Tuesday 10th November 2015.
Jemini Joseph. About me Working in Microsoft BI field since Mostly consulting in SSIS Worked as programmer in Visual Basic before moving to BI
Helping Your Data Warehouse Succeed: 10 Mistakes to Avoid in Data Integration Rafael Salas w:
Easy ETL with Andrzej Kukuła – Marcin Szeliga –
Pulling Data into the Model. Agenda Overview BI Development Studio Integration Services Solutions Integration Services Packages DTS to SSIS.
Dynamic SQL Writing Efficient Queries on the Fly ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Biml Recipes: Automatically Create T-SQL Scripts for Common Tasks
Azure ML in SSIS An introduction to Azure Machine Learning Through the eyes of an SSIS developer David Söderlund – SolidQ Nordic
Get testing with tSQLt Practical examples and automation Steve Jones SQLServerCentral Red Gate Software.
John Lloyd, Edgewater Fullscope
Building Your ETL Framework with Biml Meagan Longoria March 19, 2016.
Pass Implementing a Data Warehouse with Microsoft SQL Server 2012 exam in just 24 HOURS! 100% REAL EXAM QUESTIONS ANSWERS Implementing a.
Advanced BIML topics Be a W.I.S.E. A.S.S. Me ! Self-employed BI consultant Author Trainer MCT
An Introduction to the magical world of BIML!
Building Enterprise Applications Using Visual Studio®
SSIS Templates, Configurations & Variables
BIML: Step by Step Julie Smith.
Incrementally Moving to the Cloud Using Biml
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Orchestration and data movement with Azure Data Factory v2
Populating a Data Warehouse
ETL Automation using Biml
Start testing your SSIS packages with ssisUnit
SSIS Data Integration Data Warehouse Acceleration
SSIS Data Integration Data Warehouse Acceleration
SSIS Data Integration Data Warehouse Acceleration
Optimizing the ETL Development process using BIML
Presentation transcript:

Copyright 2015 Varigence, Inc. Unit and Integration Testing in SSIS A New Approach Scott @varigence

Copyright 2015 Varigence, Inc. About us Scott Currie CEO Varigence Creator of #biml Biml User Group – LinkedIn

Copyright 2015 Varigence, Inc.

Agenda Learn how to build a system that makes authoring and management of tests so easy and reliable that non-technical users can provide test logic Overview of Testing Strategies Current Approaches to SSIS Testing The New Approach

Test a feature Tell me WHAT is broken Must be run in context of whole job Only pass after feature is complete “My car broke down…” Integration tests tell riddles Integration TestsUnit Tests Test a task, component, or sequence Tell me WHERE it’s broken Isolate individual bits of business logic Pass as soon as component is done “…because the alternator failed” Unit tests lie Type of Tests

For Fact Sales Table: The sales for 2013 for widgets should be $129,320 Output of test shows that sales are $98,275 Find the N reason(s) for this failure. Example of “Riddle” in Integration Test: Example of “Lie” in Unit Test: For Fact Sales Table: The unit tests of derived column, row count, lookups, etc. all pass. We have several unit tests, but not enough to show where the problem is.

Hand Rolled: Current Approaches to SSIS Testing

xUnit, NUnit, MSTest ( Simple Smalltalk Testing: With Patterns (Kent Beck) Each framework uses a slightly different approach to best integrate with the target language and runtime. Some or declarative, some are procedural, some are hybrids. All follow the same basic philosophy. Assemble, Act, Assert Aka Setup, Test, Teardown Current Approaches to Unit Testing

ssisUnit XML specification of Tests with ability to run EXEs, check variable values, etc. Lends itself to integration test scenarios. VSDT Focused on database unit tests, but can also be used for SSIS integration testing SSIS Testing Frameworks

Copyright 2015 Varigence, Inc. Very Briefly Biml BIDS Helper Developer Code Shared Scripts Biml BimlScript Biml Engine Database & Schema (T-SQL) ETL (SSIS) All generated artifacts: 1.Open in BIDS and appear to be hand built 2.Deploy and run on unmodified SQL Server

Copyright 2015 Varigence, Inc. Biml:

Copyright 2015 Varigence, Inc. Biml:

Asserts Simple way to specify test logic Specify two expressions that should be equal Special asserts to quickly specify test logic that conform to patterns Specifying a Test

Copyright 2015 Varigence, Inc. Three Ways to Run These 1.Event Handler call to auto-generated package –No reverse-engineering into Biml –You never have to look at Biml 2.Inject Tests into Biml generated packages –You already use Biml to create your packages 3.Use a propriety tool to do Test injection –Biml power user

Copyright 2015 Varigence, Inc. INTEGRATION TESTS Patterns in Action

Row Count Validation Duplicate Business Keys Foreign Key Null Checks Business Logic Validation CheckExample Functional test of: Load process Select count(*) from Source Compared to Select count(*) from Destination Integration Test Patterns

Row Count Validation Duplicate Business Keys Foreign Key Null Checks Business Logic Validation CheckExample Functional test of: upsert mechanism SELECT D.DealHashId,COUNT(D.DealId) AS DuplicateCNT FROM _ODS.ODS.Deal AS D WHERE ActiveFlag = 1 GROUP BY D.DealHashId HAVING COUNT(D.DealId) > 1 Expected result: 0 (or eyeballing) Integration Test Patterns

Row Count Validation Duplicate Business Keys Foreign Key Null Checks Business Logic Validation CheckExample Functional test of: Lookup of FKs SELECT * FROM Table WHERE ForeignKey IS NULL Expected result: proper results. 0 records or not If there are results, check the lookup attribute in source. Integration Test Patterns

Row Count Validation Duplicate Business Keys Foreign Key Null Checks Business Logic Validation CheckExample Functional test of: Formulas, “recipes” CALC_Paid_Sev = Claim_Paid_Amt / Num_Clm_Paid SELECT AS Claim_Paid_Amt, 12.0 AS Num_Clm_Paid, / 12.0 AS CALC_Paid_Severity_CRE FROM CreditFileLoad Expected result: 3997 Integration Test Patterns Claim_Paid_AmtNum_Clm_PaidCALC_Paid_Severity_CRE

Copyright 2015 Varigence, Inc. DEMO Integration Test Patterns

Copyright 2015 Varigence, Inc. UNIT TESTS Patterns in Action

Row Count Validation Duplicate Business Keys Foreign Key Null Checks Business Logic Validation CheckNOTE: You can do all of the same types of checks within your data flows for validating the business logic for individual components. Just change your “Target” attribute to match the refId of the dataflow component.refId Unit Test Patterns

Copyright 2015 Varigence, Inc. Wait! Do I have to test the WHOLE package? –It’s big –It contains private information –It takes many long steps to generate it –Developers can’t access or change it for debugging –It doesn’t include all possible corner cases –Accessing it might have side-effects –Doesn’t test contract (do you call expensive stored proc too many times?)

Copyright 2015 Varigence, Inc. Stub Objects –Sample data used only for tests –How to do stubs? o Tear target component out of dataflow o Create new dataflow using the stub as a source o Insert target component into the dataflow o Add assert checks after target component –Asserts customized for stubbed test data

Copyright 2015 Varigence, Inc. Stubbing Illustrated OLE DB Source OLE DB Dest Derived Columns Lookup Derived Columns Union All Derived Columns Stub Source Assert 1 Assert 2 Assert 3

Copyright 2015 Varigence, Inc. DEMO Stubbing

Copyright 2015 Varigence, Inc.