Database Unit Testing Team Edition for Database Professionals Sachin Rekhi Program Manager Microsoft Corporation

Slides:



Advertisements
Similar presentations
Black marble the strategic IT asset for your organisation DEVELOPMENT LIFE CYCLE USING VISUAL STUDIO TEAM EDITION FOR DB PROFESSIONALS Richard Fennell.
Advertisements

Development Life Cycle using Visual Studio Team Edition for DB Professionals Richard Fennell Engineering Director SQLBits II Birmingham 1 st March 2008.
SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
Basel · Baden · Bern · Lausanne · Zürich · Düsseldorf · Frankfurt/M. · Freiburg i. Br. · Hamburg · München · Stuttgart Visual Studio for Database Professionals.
ERWin Template Overview By: Dave Wentzel. Agenda u Overview of Templates/Macros u Template editor u Available templates u Independent column browser u.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
The Microsoft Technical Roadshow 2006 Welcome and Introduction Kevin McDaniel Developer & Platform Evangelism Group Microsoft Ltd
DEV365 Visual Studio Team Edition for Software Architects: Overview Alex Torone Lead Program Manager Enterprise Tools Microsoft Corporation.
2 DAT320 Testing and Refactoring Your Database with Visual Studio Team Edition for Database Professionals.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
DEV217 Introducing Visual Studio Team Edition for Database Professionals Thomas Murphy Group Program Manager.
MSDN TechTalk Agenda Visual Studio Team Edition for Database Professionals 08:30 – 09:00 Registration 09: :15 (Roger Boesch, Microsoft Schweiz) Einbindung.
(code name: Data Dude) Josh Robinson Aculix.
Creating a SharePoint App with Microsoft Access Services
René Balzano Technology Solution Professional Data Platform Microsoft Switzerland Database Development with SQL Server Data Tools (SSDT)
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
 Gert E.R. Drapers Group Engineering Manager Microsoft Corporation TL45.
Team System Adoption Martin Woodward Teamprise. Visual Studio Editions Easy to use, easy to learn, easy to acquire tools for hobbyists, enthusiasts, and.
04 | Customize Team Foundation Server for Team Use Anthony Borton | ALM Consultant, Enhance ALM Steven Borg | Co-founder & Strategist, Northwest Cadence.
DAT312 Managing and Deploying your SQL Server schemas with Visual Studio Team Edition for Database Professionals Richard Waymire PM Architect Microsoft.
1 Adopting Visual Studio Team System Bindia Hallauer Product Management, Visual Studio Team System Microsoft Corporation.
Brian Keller Technical Evangelist
Introducing Microsoft® Visual Studio® 2005 Team Edition for Database Professionals Andy Cheung ISV Developer Evangelist Microsoft Hong Kong.
Development Best Practices Concepts & Microsoft’s Approach.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Bill Wolohan Bennett Adelson
Copyright  Oracle Corporation, All rights reserved. 4 CMIS Powell Oracle Designer: Creating the Database Design CMIS Powell.
Tom Castiglia Hershey Technologies
Managing the Database Lifecycle using Team Edition for Database Professionals Randy Pagels Developer Technology Specialist Microsoft Corporation.
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
Database Unit Test MSSQL 2008 & VS 2010 Aung Kyaw Myo.
Visual Studio 2005 Team System Winning the testing space with advanced testing tools Eric Adams Program Manager Visual Studio 2005 Team System Microsoft.
Sudesh Krishnamoorthy Developer Technology Specialist | Microsoft |
Visual Studio 2005 Team Edition for Software Architects: Developing Service-Oriented Systems Bill Gibson Senior Program Manager Enterprise Tools Microsoft.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Master Data Management & Microsoft Master Data Services Presented By: Jeff Prom Data Architect MCTS - Business Intelligence (2008), Admin (2008), Developer.
Data Modeling Creating E/R Diagrams SoftUni Team Technical Trainers Software University
Visual Studio Team System overview Pierre Greborio Software Architect – PEWay Microsoft MVP – Solutions Architect.
Visual Studio 2005 Team System: Enabling Better Software Through Testing Tejasvi Kumar Technology Specialist - VSTS Microsoft Corporation
DEV311 Delving into Visual Studio 2005 Team Edition for Software Testers Ed Glas Group Manager, Web and Load Testing Microsoft Corporation.
Visual Studio 2005 C#VBC++J#WebExpress Visual Studio Standard Edition Visual Studio Professional Edition Novices Enthusiasts Students Hobbyists Part-Timers.
Neil Kidd Developer Tools Technical Specialist Microsoft UK.
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
Connect with life Tejasvi Kumar Developer Technology Specialist | Microsoft India
YOUR LOGO Phase 2 International Providing critical business software solutions at affordable prices.
Get testing with tSQLt Practical examples and automation Steve Jones SQLServerCentral Red Gate Software.
Introduction ITEC 420.
Building Enterprise Applications Using Visual Studio®
CompSci 280 S Introduction to Software Development
Visual Studio Database Tools (aka SQL Server Data Tools)
MIX 09 6/5/2018 9:14 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Lecture 6 Data Model Design (continued)
Visual Studio Tools for Office 2005
SQL Server Data Tools for Visual Studio Part I: Core SQL Server Tools
Team Edition for Database Professionals
SQL Server Data Tools Gert Drapers
Populating a Data Warehouse
Visual Studio 2005 “Personalized productivity”
Populating a Data Warehouse
Visual Studio Database Tools (aka SQL Server Data Tools)
CIS16 Application Programming with Visual Basic
DAT381 Team Development with SQL Server 2005
Jochen Seemann Program Manager Enterprise Tools Microsoft Corporation
Introduction to VSTS Database Professional
Windows Forms in Visual Studio 2005: An in-depth look at key features
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

Database Unit Testing Team Edition for Database Professionals Sachin Rekhi Program Manager Microsoft Corporation

Agenda Team Data Overview Data Generation Database Unit Testing ● Overview ● Designer Experience ● Test Validation ● Test Execution ● Exploring the Generated Code ● Data-driven Testing ● Custom Verification Logic ● Transaction Support ● Negative Testing ● Custom Test Conditions ● Integration with Application Unit Tests

3 Incorporate the Database Professional into the software lifecycle and provide them with a foundation for change management and process integration. Change Management ● Project Based Development Project Model that represents schema as objects providing a “personal sandbox” for offline development that lives within a Visual Studio Solution Team Collaboration with Work Item and Process Integration with Team Foundation Server ● Automated Change Support Rename Refactoring with the ability to preview pending changes prior to execution Comparison Tools (Schema & Data Compare) allow comparisons & synchronization of schema and data with design/test/production databases Version Control of all database objects with the ability to reverse engineer a database to bring it under Source Control ● Database Unit Testing Database Unit Testing ensures iterative changes don’t break existing functionality Data Generator provides Repetitive Dataset Generation for tests based on saved settings Build / Deployment ● MSBuild Integration for Database Deployments/Builds based on Projects ● Either Create a new Database at the target location or Update an Existing Schema

4 Visual Studio Team System Visual Studio Team Suite MSF Process and Guidance Visual Studio Team Foundation Server Visual Studio Industry Partners Software Architects Software Developers Software Testers Database Professionals Visual Studio Team Explorer Application Modeling Infrastructure and Deployment Modeling Code Analysis Performance Tuning Security Analysis Database Build & Deployment Database Change Management Database Testing Performance Testing Manual Testing Test Case Management Visual Studio Professional Edition Change Management Work Item Tracking Reporting Project Site Integration Services Project Management Load Test Agent Visio and UML Modeling Class Modeling Unit Testing Code Coverage New!

5 Database Projects Overview Team Data

6 To create a solid foundation for testing we support data generation Deterministic – always generate the same layout Matched to your schema and very customizable Easily update generation plan to reflect schema changes Bottom Line: Realistic values with representative distributions Data Generation Overview

Data Generation Design Time Setting up Data Generation implies defining: ● Which generator to use ● Which distribution to attach to the generator ● Changing setting on the generator & distribution ● The numbers of rows to generate ● Optionally defining ratios between related tables By default: ● Each column is bound to the generator matching the column data type FK columns are mapped to the Foreign Key generator Uniqueness is inferred from PK, UC constraints and indexes Using the Uniform distribution when not unique

Data Generation Design Time Value generators Simple generators for each data type ● Strings: ASCII and Unicode ((var)char, n(var)char, (n)text) ● Numbers: tinyint, smallint, int, bigint, real, float, decimal, numeric, money ● Binary ((var)binary, image) ● Date and Time ● UniqueIdentifier (GUID) ● Bit Complex generators ● Foreign Key, Regular Expression, Data Bound Distributions ● Uniform, Normal, Inverse Normal, Exponential, Inverse Exponential

Data Generation Work

Data Generation Design Time Understand domain constraints ● Check constraints (min/max) Table cardinality ● Enforce table ratios ● Ex) Orders \ OrderDetails

Data Generation Executing a Data Generation Plan Validation of ● Security requirements Fails when security requirements are not met! ● Target schema against DGEN definitions Fails the generation when bindings do not match! Optionally purge tables ● Required to guarantee repeatable data generation Spin up parallel streams of INSERT statements ● Based on relationships between tables ● Number of connections used is currently gated by the schema relationships Configurable Error Thresholds

Data Generation Customization & Extensibility Customization of value generation ● Regular Expression Generator ● Data Bound Generator Extensibility ● Custom Generator ● Custom Distribution

13 Creating & Configuring a Generation Plan Data Generation

Ensures that database changes do not break existing codeEnsures that database changes do not break existing code Generate automated tests for programmability objectsGenerate automated tests for programmability objects Develop a battery of tests to run with every database buildDevelop a battery of tests to run with every database build Design & customize your tests in the language of your choiceDesign & customize your tests in the language of your choice ● T-SQL, VB.NET\C# Builds on existing Team Test unit testing functionalityBuilds on existing Team Test unit testing functionality Integrate your database tests along side your application unit testsIntegrate your database tests along side your application unit tests Database Unit Testing Overview

Develop your database unit test through an easy to use database test designer Test Script Generation ● Automatically generate test script stub for Stored Procedures, Functions, Triggers Test Script ● SQL to exercise the object under test Pre\Post Test Scripts ● SQL executed prior to and after test script to setup & cleanup test Test Initialize\Cleanup Scripts ● Common SQL executed prior to and after every test Database Unit Testing Designer Experience

Two primary methods of validating database unit tests ● T-SQL Assertions RAISERROR ● Test Conditions Easily configured UI-based client side assertions Supported types –Empty ResultSet –Not Empty ResultSet –Row Count –Scalar Value –Execution Time –Inconclusive Database Unit Testing Test Validation

Automatic Deployment Integration ● Automatically deploy database project prior to running tests Data Generation Integration ● Automatically generate data based on generation plan prior to running tests Execution & Validation connection strings ● Validation connection can be higher privileged account Database Unit Testing Test Execution

Ways to execute database tests ● From Visual Studio Test Menu \ Test View \ Test Manager \ Test Results F5 Experience ● Command-line Mstest.exe ● Team Build Execute tests post Team Build Database Unit Testing Test Execution

19 Creating a database unit test Database Unit Testing

Database unit test designer round-trips generated VB.NET\C# code ADO.NET code to ● Execute SQL against target ● Validate test conditions Exposed code enables variety of customization scenarios Database Unit Testing Exploring the Generated Code

Have the ability to parameterize inputs in test script Feed inputs from a database table Easily test a variety of inputs in a single test case Requires customization of VB.NET\C# code Database Unit Testing Data-driven Testing

Add custom verification logic in VB.NET\C# Exposed ExecutionResult object ● Exposes resultset data returned from test script ● Exposes execution time & rows affected info Take advantage of Classic Team Test Assertions Database Unit Testing Custom Verification Logic

Data Generation ● Used to ensure consistent database state prior to test run Transaction Support ● Ensures consistent state during test run ● Two Methods Transactions in T-SQL System.Transactions in VB.NET\C# Database Unit Testing Transaction Support

Expected error cases are as important to test as main success scenarios 3 methods ● SQL – Try\Catch ● VB.NET\C# - Try\Catch ● VB.NET\C# - Expected Exception Attribute Database Unit Testing Negative Testing

Create re-usable advanced verification logic Fully supports test condition extensibility Author a new test condition that derives from TestCondition base class in any.NET language Complete integrated UI experience Database Unit Testing Custom Test Conditions

Create VS solution containing both app & db projects Support for heterogeneous test lists Run application & database tests side-by-side Ensure database changes don’t break data access through app tests Database Unit Testing Integration with Application Tests

Database Unit Testing ensures quality in the data tierDatabase Unit Testing ensures quality in the data tier Data Generation to support repeatable data generation for testingData Generation to support repeatable data generation for testing First class unit testing framework for database developersFirst class unit testing framework for database developers Integrate your database tests along side your application testsIntegrate your database tests along side your application tests Database Unit Testing Wrap Up

28 Pricing, Licensing and Availability Included in Team Suite at No Extra Cost Purchase as an individual Edition ● Same pricing as other Team System Editions Availability ● CTP 7 Available Today ● RTM by the end of 2006

29 Resources Product Website & CTP7 Download ● fault.aspx fault.aspx Product MSDN Forums ● 25&SiteID=1 25&SiteID=1 Blogs ● Wealth of blog posts, videos, and web casts on database unit testing tips, tricks, and best practices ● ●

30