Database unit testing with visual studio 2010

Post on 31-Dec-2015

36 views 0 download

Tags:

description

Database unit testing with visual studio 2010. Anthony Brown anthony@found-it.net. Agenda. What is unit testing What is database unit testing When to use it Demo (that will fail….). Rocket science. In programming. In programming. Why unit test?. - PowerPoint PPT Presentation

transcript

Database unit testing with visual studio 2010

Anthony Brown

anthony@found-it.net

Agenda

• What is unit testing

• What is database unit testing

• When to use it

• Demo (that will fail….)

Rocket science

In programming

Calculate gender

TitleFirstnameLastname

TitleFirstnameLastnameGender

Front end application Database table

Mr John Lennon Male

Title Firstname Lastname Gender

In programming

Calculate gender

TitleFirstnameLastname

TitleFirstnameLastnameGender

Front end application Database table

Mr John Lennon Male

Title Firstname Lastname Gender

Unit test this part

Why unit test?

• Allows you to ensure that individual components do what they are supposed to

• Catch bugs in development cycle rather than test cycle

• Easier to refactor

It is not a substitute

Database unit testing

Stored procedure

TitleFirstnameLastname

Front end application Database table

Mr John Lennon Male

Title Firstname Lastname Gender

Database unit testing

Stored procedure

TitleFirstnameLastname

Front end application Database table

Mr John Lennon Male

Title Firstname Lastname Gender

Unit test this

Prerequisites

• Create database in a consistent state

• Source control database objects

• Test data

Reasons to not write database unit tests

• CRUD operations

• Time

• Management

Visual studio 2010 database unit tests

• Only design in premium & ultimate (run in professional)

• Integrated with visual studio test framework

• Can be run as part of continuous integration build

• Data generator

Demo

Coming up…

#SQLBITS

Speaker Title Room

Stephan Stoltze Writeback-Here Comes the Sun Aintree

James Boother POSH Clustering LancasterKasper de Jonge Building Great Models for Crescent Pearce

Andy Leonard Designing an SSIS Framework BoardroomMilos Radivojevic TSQL Performance Recommendations Empire

Christina E. Leo Working with Server Side Traces Derby

Picture sources• http://www.flickr.com/photos/34388067@N00/150021646/

• http://en.wikipedia.org/wiki/File:Argentina_substitute_bench_%E2%80%93_Portugal_vs._Argentina,_9th_February_2011_%281%29.jpg