SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Testing Challenges and How To
Overcome Them
Ike Ellis, MVP, Crafting Bytes
Testing in an
Enterprise Data
Architecture
Please silence
cell phones
Free online webinar
events
Free 1-day local
training events
Local user groups
around the world
Online special
interest user groups
Business analytics
training
Get involved
Explore
everything
PASS has
to offer
Free Online Resources
Newsletters
PASS.org
Download the GuideBook App
and search: PASS Summit 2018
Follow the QR code link displayed on session
signage throughout the conference venue and
in the program guide
Session
evaluations
Your feedback is
important and valuable.
Go to passSummit.com
3 Ways to Access:
Submit by 5pm Friday, November 16th to win prizes.
Ike Ellis
MVP & Partner, Crafting
Bytes
Author of Developing Azure Solutions
MVP for 8 years
Speaker at PASS Summit, SQL Bits,
Redgate SQL in the City, and many
other events
@ike_ellis
Teach courses on SQL Server, SQL
Development, Business
Intelligence, Azure Cloud, and
Power BI
Agenda
• Why do we test? What’s the purpose?
• What is an Enterprise Data Architecture?
• Why are the challenges of testing in an EDA?
• What solutions are exist for those challenges?
• What challenges will likely always be there?
• What are some best practices in general to work within the
constraints we have?
Purpose of automatic testing
• To verify that changes to a production system do not break
earlier expected work
• To preserve intent and self-document functionality
• To automatically deploy a system once all tests successfully
pass
• To increase our rate of change and match the pace the
business expects from us
• To test things unattended so the QA department is not a
bottleneck for product delivery
7
Testing: The epicenter of a deployment
pipeline
8
What’s better at preserving intent?
Comments, Source Control Comments, or
Tests?
• Source control comments are done AFTER the changes, not
before or with the changes
• Comments are often outdated, ignored, and can’t be
reviewed at compilation
• Tests fail when intent is violated, pointing to the code that
failed, making it inviolate
9
Testing: Rate of change
10
Time it takes
to make a
change
Time since project began
QA Dept as Bottleneck
• Overtime, developers can outpace a QA team. More
application surface area is built, there will be more to
completely test to see the impact.
• Even the smallest changes begin having the largest impact
11
Enterprise Data Architecture
• Data Mart/Data Warehouse ODS
• Data Lake Architecture
• Lambda Architecture
• Kappa Architecture
• IoT Architecture
12
Data Mart/Data Warehouse/ODS
13
Data Lake Architecture on Azure
14
Lambda Architecture
15
Kappa Architecture
16
IoT Architecture
17
What do all of these architectures have in
common?
• Some move data more than others, but there is always an
element of moving data from one place to the other
• They have processes that drastically change the data so that
it doesn’t resemble what it originally looked like
• They store the exact same data several time. I’ve seen
company EDAs that store the same source data seven times
before it arrives at the final destination
• I’ve seen companies that store different views of the same
aggregation: Weekly, Monthly, Quarterly, MTD, YTD, YOY
18
What are the common challenges of
testing these environments?
Why do so many companies fail at automated testing and give
up?
19
Well, it’s not their fault, and it’s not yours
either
• EDAs have some insane complexity
• Most EDAs have all the things that software developers
avoid when writing code
20
Problem #1: Testing the weather
21
Problem #2: Side-Effects
Stored procedures always violate the DRY
principle: Don’t repeat yourself
They do this for a variety of reasons:
• It is difficult to pass tables of data between
procedures
• It is easy to load a temp table up and
perform 100s of operations against it
• Stored procedures don’t have any of the
components necessary to avoid repetition
like inheritance, encapsulation,
polymorphism, arrays, foreach loops, etc.
All of this means we end up getting very large
stored procedures with 1000s of lines that
comprise a lot of our ETL
22
Problem #3: Queries take a long time to run
• If a suite of tests take hours to
run, then we can’t run them very
often.
• We will never have good test
coverage of our architecture if
we can’t run the tests in between
changes to the system
• Queries timeout
• Queries against source systems
are a bad idea, meaning we can’t
tell if we got all the data with
100% accuracy
23
Problem #4: Source systems don’t really want
us there
If we’re pulling data from transactional systems, testing against
the OLTP database creates a load. Create too much, and we’ll
get kicked off the source, pronto.
Problem #5: All of these EDAs have a lot of
repetitive data. Where do we test?
• Do we test data from source to staging? From staging to
ODS? From source to ODS? From source to DW?
• With all the repetition, we might have the manufacturing
problem that Taichi Ohno railed against while inventing lean
manufacturing and Just-in-Time
25
Problem #6: Accuracy is deadly important
• Test data is not always available
• Production data must be 100% reconciled and accurate
• Cash flow statements, reports to the board, SEC filings,
auditing records, etc.
• No mistakes, means no mistakes
26
Remember our goals with testing
• Did a change break the system?
• Are we preserving existing, needed functionality?
• Can we deploy automatically when our tests run?
27
OK, that’s the bad news, now what can we
do about it?
• Testing Strategies
• Testing Tools
• Testing Best Practices
28
Testing Strategies
• Are we all looking at the same requirements?
• Write a test plan, execute it!
• 100% test coverage is impossible, so what will we test?
• Where will we test?
• Where does it tend to break? Are we recording our outages
and bugs?
• Stay focused
29
It’s not a perfect world, but here are some
things we can do
• tSQLt
• Approval Tests
• Except Query Replacement Testing
• QueryApprovals
30
31
Demo: tSQLt
32
Demo: ApprovalTests
33
Demo: QueryApprovals
No logo yet….we need one…send it over and we’ll put it on our
GitHub and give you credit!
34
Demo: Except
35
Demo: CI/CD tests
36
3rd Party Products (you need $$$)
37
Best practices for data testing
• Test row counts
• Test random and sampled data elements
• Start with thorough manual testing and then slowly
automate that
• Alert in your audit log
• Test records are streaming
• Make testing fast!
• Deleting tests is essential!
• It’s absolutely ok to delete tests that aren’t working for you. It is not
OK to give up on testing.
38
Report Testing
• SSRS Testing
• Power BI Testing
• Push logic into the database
• Push coloring into the database
• Test at the database
• JPG/PDF testing is still not mature enough to use
• Test report data sizes and subscription dates
39
Develop a culture of testing
There are teams that talk about testing in every sentence
There are teams that treat testing as a burden or someone
else’s problem
Guess who write better products, has happy users, and enjoys
making changes to their own system?
Remember change lock. It will make you want to quit your job.
Write tests to avoid change lock
40
Resources
• QueryApproval Source Code:
• https://github.com/CraftingBytes/QueryApprovals
• tSQLt
• www.tsqlt.org
• Approval Test Demo Code
•https://github.com/IkeEllis/democode/tree/master/ApprovalDemo
41
Contact Me!
http://www.craftingbytes.com
http://blog.ikeellis.com
http://www.ikeellis.com
YouTube
http://www.youtube.com/user/IkeEllisData
San Diego Tech Immersion Group
http://www.sdtig.com
Twitter: @ike_ellis
ike@craftingbytes.com

Weitere ähnliche Inhalte

Mehr von Ike Ellis

Power bi premium
Power bi premiumPower bi premium
Power bi premiumIke Ellis
 
Move a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudMove a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudIke Ellis
 
Azure Databricks is Easier Than You Think
Azure Databricks is Easier Than You ThinkAzure Databricks is Easier Than You Think
Azure Databricks is Easier Than You ThinkIke Ellis
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to daxIke Ellis
 
Pass the Power BI Exam
Pass the Power BI ExamPass the Power BI Exam
Pass the Power BI ExamIke Ellis
 
Slides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATESlides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATEIke Ellis
 
Introduction to DAX
Introduction to DAXIntroduction to DAX
Introduction to DAXIke Ellis
 
60 reporting tips in 60 minutes - SQLBits 2018
60 reporting tips in 60 minutes - SQLBits 201860 reporting tips in 60 minutes - SQLBits 2018
60 reporting tips in 60 minutes - SQLBits 2018Ike Ellis
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL DevelopersIke Ellis
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL DevelopersIke Ellis
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Ike Ellis
 
A lap around microsofts business intelligence platform
A lap around microsofts business intelligence platformA lap around microsofts business intelligence platform
A lap around microsofts business intelligence platformIke Ellis
 
Survey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeSurvey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeIke Ellis
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL DevelopersIke Ellis
 
SQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutesSQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutesIke Ellis
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBIke Ellis
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101Ike Ellis
 
Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014Ike Ellis
 
Hadoop for the Absolute Beginner
Hadoop for the Absolute BeginnerHadoop for the Absolute Beginner
Hadoop for the Absolute BeginnerIke Ellis
 
SQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksSQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksIke Ellis
 

Mehr von Ike Ellis (20)

Power bi premium
Power bi premiumPower bi premium
Power bi premium
 
Move a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudMove a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloud
 
Azure Databricks is Easier Than You Think
Azure Databricks is Easier Than You ThinkAzure Databricks is Easier Than You Think
Azure Databricks is Easier Than You Think
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to dax
 
Pass the Power BI Exam
Pass the Power BI ExamPass the Power BI Exam
Pass the Power BI Exam
 
Slides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATESlides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATE
 
Introduction to DAX
Introduction to DAXIntroduction to DAX
Introduction to DAX
 
60 reporting tips in 60 minutes - SQLBits 2018
60 reporting tips in 60 minutes - SQLBits 201860 reporting tips in 60 minutes - SQLBits 2018
60 reporting tips in 60 minutes - SQLBits 2018
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017
 
A lap around microsofts business intelligence platform
A lap around microsofts business intelligence platformA lap around microsofts business intelligence platform
A lap around microsofts business intelligence platform
 
Survey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeSurvey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data Landscape
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
 
SQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutesSQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutes
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014
 
Hadoop for the Absolute Beginner
Hadoop for the Absolute BeginnerHadoop for the Absolute Beginner
Hadoop for the Absolute Beginner
 
SQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksSQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & Tricks
 

Kürzlich hochgeladen

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Kürzlich hochgeladen (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Pass 2018 Testing in the enterprise data architecture

  • 1. Testing Challenges and How To Overcome Them Ike Ellis, MVP, Crafting Bytes Testing in an Enterprise Data Architecture
  • 3. Free online webinar events Free 1-day local training events Local user groups around the world Online special interest user groups Business analytics training Get involved Explore everything PASS has to offer Free Online Resources Newsletters PASS.org
  • 4. Download the GuideBook App and search: PASS Summit 2018 Follow the QR code link displayed on session signage throughout the conference venue and in the program guide Session evaluations Your feedback is important and valuable. Go to passSummit.com 3 Ways to Access: Submit by 5pm Friday, November 16th to win prizes.
  • 5. Ike Ellis MVP & Partner, Crafting Bytes Author of Developing Azure Solutions MVP for 8 years Speaker at PASS Summit, SQL Bits, Redgate SQL in the City, and many other events @ike_ellis Teach courses on SQL Server, SQL Development, Business Intelligence, Azure Cloud, and Power BI
  • 6. Agenda • Why do we test? What’s the purpose? • What is an Enterprise Data Architecture? • Why are the challenges of testing in an EDA? • What solutions are exist for those challenges? • What challenges will likely always be there? • What are some best practices in general to work within the constraints we have?
  • 7. Purpose of automatic testing • To verify that changes to a production system do not break earlier expected work • To preserve intent and self-document functionality • To automatically deploy a system once all tests successfully pass • To increase our rate of change and match the pace the business expects from us • To test things unattended so the QA department is not a bottleneck for product delivery 7
  • 8. Testing: The epicenter of a deployment pipeline 8
  • 9. What’s better at preserving intent? Comments, Source Control Comments, or Tests? • Source control comments are done AFTER the changes, not before or with the changes • Comments are often outdated, ignored, and can’t be reviewed at compilation • Tests fail when intent is violated, pointing to the code that failed, making it inviolate 9
  • 10. Testing: Rate of change 10 Time it takes to make a change Time since project began
  • 11. QA Dept as Bottleneck • Overtime, developers can outpace a QA team. More application surface area is built, there will be more to completely test to see the impact. • Even the smallest changes begin having the largest impact 11
  • 12. Enterprise Data Architecture • Data Mart/Data Warehouse ODS • Data Lake Architecture • Lambda Architecture • Kappa Architecture • IoT Architecture 12
  • 14. Data Lake Architecture on Azure 14
  • 18. What do all of these architectures have in common? • Some move data more than others, but there is always an element of moving data from one place to the other • They have processes that drastically change the data so that it doesn’t resemble what it originally looked like • They store the exact same data several time. I’ve seen company EDAs that store the same source data seven times before it arrives at the final destination • I’ve seen companies that store different views of the same aggregation: Weekly, Monthly, Quarterly, MTD, YTD, YOY 18
  • 19. What are the common challenges of testing these environments? Why do so many companies fail at automated testing and give up? 19
  • 20. Well, it’s not their fault, and it’s not yours either • EDAs have some insane complexity • Most EDAs have all the things that software developers avoid when writing code 20
  • 21. Problem #1: Testing the weather 21
  • 22. Problem #2: Side-Effects Stored procedures always violate the DRY principle: Don’t repeat yourself They do this for a variety of reasons: • It is difficult to pass tables of data between procedures • It is easy to load a temp table up and perform 100s of operations against it • Stored procedures don’t have any of the components necessary to avoid repetition like inheritance, encapsulation, polymorphism, arrays, foreach loops, etc. All of this means we end up getting very large stored procedures with 1000s of lines that comprise a lot of our ETL 22
  • 23. Problem #3: Queries take a long time to run • If a suite of tests take hours to run, then we can’t run them very often. • We will never have good test coverage of our architecture if we can’t run the tests in between changes to the system • Queries timeout • Queries against source systems are a bad idea, meaning we can’t tell if we got all the data with 100% accuracy 23
  • 24. Problem #4: Source systems don’t really want us there If we’re pulling data from transactional systems, testing against the OLTP database creates a load. Create too much, and we’ll get kicked off the source, pronto.
  • 25. Problem #5: All of these EDAs have a lot of repetitive data. Where do we test? • Do we test data from source to staging? From staging to ODS? From source to ODS? From source to DW? • With all the repetition, we might have the manufacturing problem that Taichi Ohno railed against while inventing lean manufacturing and Just-in-Time 25
  • 26. Problem #6: Accuracy is deadly important • Test data is not always available • Production data must be 100% reconciled and accurate • Cash flow statements, reports to the board, SEC filings, auditing records, etc. • No mistakes, means no mistakes 26
  • 27. Remember our goals with testing • Did a change break the system? • Are we preserving existing, needed functionality? • Can we deploy automatically when our tests run? 27
  • 28. OK, that’s the bad news, now what can we do about it? • Testing Strategies • Testing Tools • Testing Best Practices 28
  • 29. Testing Strategies • Are we all looking at the same requirements? • Write a test plan, execute it! • 100% test coverage is impossible, so what will we test? • Where will we test? • Where does it tend to break? Are we recording our outages and bugs? • Stay focused 29
  • 30. It’s not a perfect world, but here are some things we can do • tSQLt • Approval Tests • Except Query Replacement Testing • QueryApprovals 30
  • 31. 31
  • 34. Demo: QueryApprovals No logo yet….we need one…send it over and we’ll put it on our GitHub and give you credit! 34
  • 37. 3rd Party Products (you need $$$) 37
  • 38. Best practices for data testing • Test row counts • Test random and sampled data elements • Start with thorough manual testing and then slowly automate that • Alert in your audit log • Test records are streaming • Make testing fast! • Deleting tests is essential! • It’s absolutely ok to delete tests that aren’t working for you. It is not OK to give up on testing. 38
  • 39. Report Testing • SSRS Testing • Power BI Testing • Push logic into the database • Push coloring into the database • Test at the database • JPG/PDF testing is still not mature enough to use • Test report data sizes and subscription dates 39
  • 40. Develop a culture of testing There are teams that talk about testing in every sentence There are teams that treat testing as a burden or someone else’s problem Guess who write better products, has happy users, and enjoys making changes to their own system? Remember change lock. It will make you want to quit your job. Write tests to avoid change lock 40
  • 41. Resources • QueryApproval Source Code: • https://github.com/CraftingBytes/QueryApprovals • tSQLt • www.tsqlt.org • Approval Test Demo Code •https://github.com/IkeEllis/democode/tree/master/ApprovalDemo 41