Test-Driving Your Database

Slides:



Advertisements
Similar presentations
Using xUnit as a Swiss-Army Testing Toolkit (Does Unit Size Matter?) ACCU Conference 2011 Chris Oldwood
Advertisements

Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
XUnit Style Database Unit Testing ACCU London – 20 th January 2011 Chris Oldwood
2010 User Conference April 23 rd – 25 th, Philadelphia, PA 2010 User Conference Enterprise Version Round Table Discussion: Earth Sun Moon Presentation.
Platinum Gold Silver Group BY: [Food and Drink at Reading Bowl, see you there!] Feedback Forms: [Voucher for £30 book on return of Form]
#sqlsatPordenone #sqlsat367 February 28, 2015 Testing your databases Alessandro
SOUL INSTALLATION Step-1 For this Please Install the Version 7.0 or SQL Server 2000 or onwards.
Jennifer Widom SQL Introduction. Jennifer Widom SQL: Intro  “S.Q.L.” or “sequel”  Supported by all major commercial database systems  Standardized.
Database Development Using TDD Chris Oldwood ACCU Conference /
By John Boal  Continuous Integration [CI] ◦ Automating the build process ◦ Build the entire system each time any new.
IS 426: Information Systems Construction in Modern Society Downloading and exploring oracle development environments.
Build Robust Web Apps in the Real WakeUpAndCode.com.
Craig Berntson
UNIT TESTING FOR SQL Prepared for SUGSA CodeLabs Alain King Paul Johnson.
Databases in Visual Studio. Database in VisualStudio An MS SQL database are built in Visual studio The Name can be something like ”(localdb)\Projects”
Test Driven Development Arrange, Act, Assert… Awesome Jason Offutt Software Engineer Central Christian Church
SQL Schemas DATA SCIENCE BOOTCAMP. Schema The structure of the database (relationships between tables)
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 11-1 David M. Kroenke’s Chapter Eleven: Managing Databases with SQL Server.
Effective Test Driven Database Development Gojko Adzic
Effective Test Driven Database Development Gojko Adzic
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur.
 Wes McClure  
1 Presentation Title Test-driven development (TDD) Overview David Wu.
Implementing Multicurrency in an Existing Dynamics GP Environment Rod O’Connor 20-NOV-2014.
Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software.
Unit Testing with tSQLt
Beginning Software Craftsmanship Brendan Enrick Steve Smith
1 Punishment Through Continuous Delivery If it hurts, do it more often…
BASIC ERP ARCHITECTURE Skorkovský, KPH, ESF MU,Brno.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
Get testing with tSQLt Practical examples and automation Steve Jones SQLServerCentral Red Gate Software.
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Darren Thayre, AWS Professional Services Succeeding with AWS by delivering high.
1 © Agitar Software, 2007 Automated Unit Testing with AgitarOne Presented by Eamon McCormick Senior Solutions Consultant, Agitar Software Inc. Presented.
How to tune your applications before moving your database to Microsoft Azure SQL Database (MASD) OK, you've jumped into your Azure journey by creating.
Data Virtualization Demoette… ODBC Clients
SA Capstone Requirements and Design Week 10 SYST Winter 2016
TESTING TEST DRIVEN DEVELOPMENT
Making Your List and Checking It Twice
Introduction to Unit Testing in JavaScript
CS422 Principles of Database Systems Course Overview
Getting Started With SQL Server Replication
Developing Production Quality SQL Code
Unit Testing & Test-Driven Development for Mere Mortals
Testing Database Code with tSQLt
Download Microsoft Exam - Valid Question Answers - Realexamdumps.com
DBM 380 AID Perfect Education/ dbm380aid.com.
DBM 380 EDU Perfect Education/ dbm380edu.com.
DBM 380 HELP Perfect Education/ dbm380help.com.
Unit Testing & Test-Driven Development for Mere Mortals
SQL Introduction.
Motivation and overview
Continuous Integration For Databases
Prove to your boss your database is sound - Unit Testing with tSQLt
Intro to Unit Testing with tSQLt
Unit Testing with xUnit.net-Part-2
نصب نرم افزار Oracle 11 R2 database
Testing a persistence layer
Unit Testing & Test-Driven Development for Mere Mortals
Your code is not just…your code
Interrogating the Transaction Log
SQL Tables and Constraints Example
MIS2502: Data Analytics Relational Data Modeling
NoSQL Overview + Elasticsearch Quick Dive
MIS2502: Data Analytics MySQL and MySQL Workbench
Access ProQuest Searchware
THANK YOU, SPONSORS! Rockstar Sponsors!.
Database 2.
Your code is not just…your code
Cosmic DBA Cosmos DB for SQL Server Admins and Developers
Presentation transcript:

Test-Driving Your Database Adventures in relational agility @alastairs #tddatabases Who is this guy? Application developer: C# my forté, T-SQL not so much. Not “the database guy” Founder of CSCrafters The last barrier between you and your lunch  https://www.flickr.com/photos/reiterlied/15668379793/

Why Bother? Early bug notification Confidence to refactor Verifiable documentation Ok, but how does it work? https://www.flickr.com/photos/shindotv/3835365695/

Perfect is a verb Make it work, then make it right. Can apply this to our SPROCS and functions with tSQLt Unit testing framework for T-SQL Runs each test in isolation – separate SQL Server transactions Groups tests in schemas (“test classes”) for better organisation and shared setup. - Creating a test class will overwrite it if it already exists Can fake tables and views, and spy on sprocs https://www.flickr.com/photos/pmillera4/9380481028/

Recommendations DO test Sprocs Functions Triggers Views Constraints DON’T test Schema, table structure – brittle tests

SPROCS, Constraints Show me teh codez!!!11 https://www.flickr.com/photos/reiterlied/15668379793/

[Fact] public void Placing_An_Order_Adds_The_Order_To_The_Customers_Account() { // Arrange var customer = new Customer( 1, // Id "Joe", "Bloggs", // Name "10 City Road", "Staines", "Middlesex", "AB1 2CD" // Address ); var order = new Order(1, customer); // Act, Assert: not interesting for this example }

[Fact] public void Placing_An_Order_Adds_The_Order_To_The_Customers_Account() { // Arrange var customer = ACustomer() .WithGivenName("Joe") .WithFamilyName("Bloggs") .Build(); var order = new Order(1, customer); // Act, Assert: not interesting for this example } https://www.flickr.com/photos/reiterlied/15668379793/

SQL Test Data Builders Show me teh codez!!!11 https://www.flickr.com/photos/reiterlied/15668379793/

What about CI? A tsqlt runner from a guy called Christian Prieto plus a bunch of sqlcmd calls https://www.flickr.com/photos/pennstatelive/6859199341/

Questions? https://www.flickr.com/photos/uk_parliament/6546233741/