SlideShare a Scribd company logo
1 of 13
Preventing Plan Regressions
During Testing
Richie Lee
Software Testers Are…
Question: Why do bugs make their way into Production?
Answer: Because we were too busy testing for bugs that aren’t there…
Pop Quiz
Find More Bugs with This Simple Trick…
• Bugs are most likely in two places:
• In New Features
• In Old Features
Finding Bugs
• New Features are the most likely place to find bugs as test coverage is
theoretically zero.
• New features that interface with old features may create/uncover bugs
previously undiscovered
• Need to test new features, and then verify old features work and work well.
Regression Testing
• Ensuring that any change has not negatively impacted the functional and non
functional aspects of the application; that it works, and that it works well.
The Testing Triangle
UI
Acceptance
Integration
Unit
Manual
Database Test Driven Development
Frameworks
• tSQLt
• SSDT Unit Tests
• DBFit
• MSTest
Testing Challenge
• Verify that Query Plans Matched
• Test large databases (in terms of data volume) on a build server ideally using
only LocalDB
Testing Challenge
• Query Optimizer uses the following to generate a query plan:
• The database metadata
• The hardware environment
• The database session state
Test Database To Test The Test
Framework
• Scenario One: Verify that a certain index on table is searched using an index
seek and not a scan
• Scenario Two: Make a Change and Verify that there are no negative changes
to the query plan
• Scenario Three: Use DBCC OPTIMIZER_WHATIF to mock the hardware
environment
• Scenario Four: Verify that the same query plan is used when changing the
compatibility level from 2012 to 2014.
Future Changes
• Remove XPath
?

More Related Content

What's hot

JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyAlexandr Skachkov
 
Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"Fwdays
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven developmentStephen Fuqua
 
Intro to TDD and BDD
Intro to TDD and BDDIntro to TDD and BDD
Intro to TDD and BDDJason Noble
 
TestWorks Conf Performance testing made easy with gatling - Guillaume Corré
TestWorks Conf Performance testing made easy with gatling - Guillaume CorréTestWorks Conf Performance testing made easy with gatling - Guillaume Corré
TestWorks Conf Performance testing made easy with gatling - Guillaume CorréXebia Nederland BV
 
Resource Leaks in Java
Resource Leaks in JavaResource Leaks in Java
Resource Leaks in JavaCoverity
 
Exploratory and Unit Testing
Exploratory and Unit TestingExploratory and Unit Testing
Exploratory and Unit TestingLlewellyn Falco
 
Example of TAF with batch execution of test cases
 Example of TAF with batch execution of test cases  Example of TAF with batch execution of test cases
Example of TAF with batch execution of test cases COMAQA.BY
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentConsulthinkspa
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)Foyzul Karim
 
Automated testing of ASP .Net Core applications
Automated testing of ASP .Net Core applications Automated testing of ASP .Net Core applications
Automated testing of ASP .Net Core applications nispas
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the UntestableMark Baker
 
TDD - Test Driven Dvelopment | Test First Design
TDD -  Test Driven Dvelopment | Test First DesignTDD -  Test Driven Dvelopment | Test First Design
TDD - Test Driven Dvelopment | Test First DesignQuang Nguyễn Bá
 
Continuous delivery in practice (public)
Continuous delivery in practice (public)Continuous delivery in practice (public)
Continuous delivery in practice (public)Tzach Zohar
 
8th Alg--Dec14
8th Alg--Dec148th Alg--Dec14
8th Alg--Dec14jdurst65
 

What's hot (20)

JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 Proxy
 
Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven development
 
Php tests tips
Php tests tipsPhp tests tips
Php tests tips
 
Intro to TDD and BDD
Intro to TDD and BDDIntro to TDD and BDD
Intro to TDD and BDD
 
TestWorks Conf Performance testing made easy with gatling - Guillaume Corré
TestWorks Conf Performance testing made easy with gatling - Guillaume CorréTestWorks Conf Performance testing made easy with gatling - Guillaume Corré
TestWorks Conf Performance testing made easy with gatling - Guillaume Corré
 
Resource Leaks in Java
Resource Leaks in JavaResource Leaks in Java
Resource Leaks in Java
 
Exploratory and Unit Testing
Exploratory and Unit TestingExploratory and Unit Testing
Exploratory and Unit Testing
 
Example of TAF with batch execution of test cases
 Example of TAF with batch execution of test cases  Example of TAF with batch execution of test cases
Example of TAF with batch execution of test cases
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Integration testing
Integration testingIntegration testing
Integration testing
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)
 
Automated testing of ASP .Net Core applications
Automated testing of ASP .Net Core applications Automated testing of ASP .Net Core applications
Automated testing of ASP .Net Core applications
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the Untestable
 
TDD - Test Driven Dvelopment | Test First Design
TDD -  Test Driven Dvelopment | Test First DesignTDD -  Test Driven Dvelopment | Test First Design
TDD - Test Driven Dvelopment | Test First Design
 
Continuous delivery in practice (public)
Continuous delivery in practice (public)Continuous delivery in practice (public)
Continuous delivery in practice (public)
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
8th Alg--Dec14
8th Alg--Dec148th Alg--Dec14
8th Alg--Dec14
 

Viewers also liked

見守りサービスMiimaミーマ 資料
見守りサービスMiimaミーマ 資料見守りサービスMiimaミーマ 資料
見守りサービスMiimaミーマ 資料kaisya_account
 
Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Peter Kofler
 
Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...
Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...
Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...Yavor Nikolov
 
Hands on training on DbFit Part-II
Hands on training on DbFit Part-IIHands on training on DbFit Part-II
Hands on training on DbFit Part-IIBabul Mirdha
 
Open Source BI Overview
Open Source BI Overview Open Source BI Overview
Open Source BI Overview Alex Meadows
 
Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...
Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...
Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...Trivadis
 
Hands on training on DbFit Part-I
Hands on training on DbFit Part-IHands on training on DbFit Part-I
Hands on training on DbFit Part-IBabul Mirdha
 
Lynn Winterboer : Test automation
Lynn Winterboer : Test automation Lynn Winterboer : Test automation
Lynn Winterboer : Test automation AgileDenver
 
Agile Methods and Data Warehousing (2016 update)
Agile Methods and Data Warehousing (2016 update)Agile Methods and Data Warehousing (2016 update)
Agile Methods and Data Warehousing (2016 update)Kent Graziano
 

Viewers also liked (11)

見守りサービスMiimaミーマ 資料
見守りサービスMiimaミーマ 資料見守りサービスMiimaミーマ 資料
見守りサービスMiimaミーマ 資料
 
Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)
 
Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...
Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...
Test-Driven Development with DbFit and Oracle database, BGOUG Conference, 201...
 
Hands on training on DbFit Part-II
Hands on training on DbFit Part-IIHands on training on DbFit Part-II
Hands on training on DbFit Part-II
 
Open Source BI Overview
Open Source BI Overview Open Source BI Overview
Open Source BI Overview
 
Sigist Presentation 091208 V2.0
Sigist Presentation 091208 V2.0Sigist Presentation 091208 V2.0
Sigist Presentation 091208 V2.0
 
Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...
Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...
Trivadis TechEvent 2016 A few thoughts on the subject Continuous integration ...
 
Agile WTF
Agile WTFAgile WTF
Agile WTF
 
Hands on training on DbFit Part-I
Hands on training on DbFit Part-IHands on training on DbFit Part-I
Hands on training on DbFit Part-I
 
Lynn Winterboer : Test automation
Lynn Winterboer : Test automation Lynn Winterboer : Test automation
Lynn Winterboer : Test automation
 
Agile Methods and Data Warehousing (2016 update)
Agile Methods and Data Warehousing (2016 update)Agile Methods and Data Warehousing (2016 update)
Agile Methods and Data Warehousing (2016 update)
 

Similar to Testing regression

Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseClareMcLennan
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comAviran Mordo
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayBizTalk360
 
Team wide testing
Team wide testingTeam wide testing
Team wide testingEthan Huang
 
Testing without defined requirements
Testing without defined requirementsTesting without defined requirements
Testing without defined requirementsrrice2000
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software TestingMohammed Moishin
 
Test Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s PerspectiveTest Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s PerspectiveMalinda Kapuruge
 
Avoiding test hell
Avoiding test hellAvoiding test hell
Avoiding test hellYun Ki Lee
 
The challenges and pitfalls of database deployment automation
The challenges and pitfalls of database deployment automationThe challenges and pitfalls of database deployment automation
The challenges and pitfalls of database deployment automationDBmaestro - Database DevOps
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalQA or the Highway
 
DBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings RevealedDBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings RevealedDBmaestro - Database DevOps
 
Performance Tuning in the Trenches
Performance Tuning in the TrenchesPerformance Tuning in the Trenches
Performance Tuning in the TrenchesDonald Belcham
 
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Dinis Cruz
 
ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0Samer Desouky
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategiesSHREEHARI WADAWADAGI
 

Similar to Testing regression (20)

Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with Fitnesse
 
Presentation delex
Presentation delexPresentation delex
Presentation delex
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
Bugtracking
BugtrackingBugtracking
Bugtracking
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration Monday
 
Team wide testing
Team wide testingTeam wide testing
Team wide testing
 
Testing without defined requirements
Testing without defined requirementsTesting without defined requirements
Testing without defined requirements
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Test Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s PerspectiveTest Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s Perspective
 
Avoiding test hell
Avoiding test hellAvoiding test hell
Avoiding test hell
 
The challenges and pitfalls of database deployment automation
The challenges and pitfalls of database deployment automationThe challenges and pitfalls of database deployment automation
The challenges and pitfalls of database deployment automation
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
DBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings RevealedDBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
 
Performance Tuning in the Trenches
Performance Tuning in the TrenchesPerformance Tuning in the Trenches
Performance Tuning in the Trenches
 
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
 
ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 

Recently uploaded

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Testing regression

  • 3. Question: Why do bugs make their way into Production? Answer: Because we were too busy testing for bugs that aren’t there… Pop Quiz
  • 4. Find More Bugs with This Simple Trick… • Bugs are most likely in two places: • In New Features • In Old Features
  • 5. Finding Bugs • New Features are the most likely place to find bugs as test coverage is theoretically zero. • New features that interface with old features may create/uncover bugs previously undiscovered • Need to test new features, and then verify old features work and work well.
  • 6. Regression Testing • Ensuring that any change has not negatively impacted the functional and non functional aspects of the application; that it works, and that it works well.
  • 8. Database Test Driven Development Frameworks • tSQLt • SSDT Unit Tests • DBFit • MSTest
  • 9. Testing Challenge • Verify that Query Plans Matched • Test large databases (in terms of data volume) on a build server ideally using only LocalDB
  • 10. Testing Challenge • Query Optimizer uses the following to generate a query plan: • The database metadata • The hardware environment • The database session state
  • 11. Test Database To Test The Test Framework • Scenario One: Verify that a certain index on table is searched using an index seek and not a scan • Scenario Two: Make a Change and Verify that there are no negative changes to the query plan • Scenario Three: Use DBCC OPTIMIZER_WHATIF to mock the hardware environment • Scenario Four: Verify that the same query plan is used when changing the compatibility level from 2012 to 2014.
  • 13. ?

Editor's Notes

  1. Ask if there are developers in the room? If there are any DBA’s in the room? Ask if there are any testers in the room? If there are they may want to look away now.
  2. Started off as a tester, and I found the job pretty tough and thankless. Didn’t sit comfortably with me as the job is to find fault with other peoples work, which in all fairness I couldn’t do. Then I realised that developers are really bad at writing tests, so testers are a necessary evil. One of my quests is to help developers write better tests to catch bugs.
  3. I promise you: this will be the only time that I will ask for audience participation… There are bugs found in test that were fixed, and so we were finding bugs, just not this bug. If I knew where the bugs were, you’d have to question my integrity. None of us are Neo…. So we need to get good at guessing where bugs are going to be. I’m not going to delve into practices like Boundary Value Analysis, or Edge Case/Corner Case Testing. Because we cannot test 100% all scenarios within the timeframe we have for testing, we have to make an educated guess on where to focus my testing to maximise my chances of finding bugs.
  4. Right, so like all clickbait, this is pretty misleading and not very helpful…. So lets expand upon this.
  5. This makes sense: 0 test coverage means that there is more likely of uncovering bugs there. Presuming old features have had tests run on them, these tests may be redundant/require changing/require re-running to verify that the tests passed as expected.
  6. And so as a product grows, unless the duration of our sprints are increasing to accommodate the amount of regression testing required, we need to automate testing. Clearly, unit testing is the easiest to automate.
  7. The testing triangle… and cloud….. A majority of bugs can be uncovered at the point of unit testing: we are able to test the code paths and scenarios quicker and so are more likely to find bugs that will cause a bigger impact. hence it being at the bottom of the triangle not because it is least important but because it takes up a greater surface area than subsequent areas. Story of the pink triangles and colour of the lines…. About UI.
  8. tSQLt: Good: assertions of expected against actual; mocking objects (strips constraints to help isolate testing on single stored procedures), easy to add to builds. Bad: runs within transactions, so can cause issues with nested transactions SSDT Unit Tests Good: assertion testing, checksum checking, pre and post unit test setup for data, easy to add to build. Bad: missing mocking features that makes tSQLt easy to use DBFit Good: uses Fit, a popular test framework, can alter/modify with own fixtures/stored procedures, readable tests, can be expanded to integration testing. Bad: No one has ever heard of it. MSTest Good: writing your own framework means you can do whatever you wish. Which is good if you’re testing something out there. Bad: some assembly required.
  9. My decision was to go down the MSTest route, as I was testing the demos written for SQL Server Training. This included lock escalation, clustered columnstore, in memory oltp, the evils of user defined functions, truncate vs delete, forced parameterisation…. So none of the frameworks available really accommodated this kind of testing. Oh… localdb. Noble ideal but victim to Microsoft marketing.
  10. Instead of mocking the data, if we mocked the database using statistics then we can generate a query plan that closely resembles that of production in our unit testing. Hardware we will come to later Database session state is defined on the connection string; so this must match that used in production. Talk abut how ideally you’d use same code used in production but sometimes not possible as test runs across a single connection whereas the standard is to connect and disconnect per command. Plan is to execute showplan, generate the query plan, and use xpath to assert that the operator expected is the actual operator returned.
  11. My decision was to go down the MSTest route, as I was testing the demos written for SQL Server Training. This included lock escalation, clustered columnstore, in memory oltp, the evils of user defined functions, truncate vs delete, forced parameterisation…. So none of the frameworks available really accommodated this kind of testing. Use DBCC OPTIMIZER_WHATIF to mock the hardware environment
  12. Xpath is the bane of testing because it is time consuming to write and can be flaky. Also we are severely limiting what we can test here: we could be testing just 2/3% of all plan operators out of a large query plan. Also finding xpaths is time consuming. Although there is the argument that a change in structure of the query plan will cause the xpath to fail so we are sort of black box testing the rest of the query plan, a branch could change and not affect the overall structure of the query plan we are testing and so we may still have plan regression. So one idea is to remove strip out everything except the plan operators then maybe create a hash and compare hashes.