You are on page 1of 28

Test Driven Development using Visual Studio Team System

Ariel Gur-Arieh VP R&D MCD Software Solutions http://blogs.microsoft.co.il/blogs/arielga

Agenda
Challenges we deal today Unit Testing Database can be Unit Tested! Be Agile - Test Driven Development Q&A Summary

Challenges we deal today


Does our code do what we intended? Documentation is it updated? Debug again? Change Request no sleep, again!?! Customers speak Gibberish, translation please.

Unit Test
Parts of the code behaves as intended.

DEMO
Unit Test using Visual Studio.

Code Coverage
Which code has been touched by a test.

DEMO
Code Coverage Using Team System.

Database can be Unit Tested!


User Interface

Application Code

Data Access Layer

Unit Tests

Stored Procedures

DEMO
Database Unit Testing.

Get Agile Test Driven Development


Practices

Tools
Tools For Agility, Kent Beck

Test Driven Development


The motto "Red, Green, Refactor."

DEMO
Changing code in TDD.

TDD in Action: Active Bug


Bug: Expired Credit Cards are being Credited

DEMO
Adding code in TDD.

TDD in Action: New Requirement


Requirement: Add Bonuses to special customers.

Quality Indicators
91 80

76
71

60

51

56

40 32.5

20

19 18 12

9 8

Iteration 1

Iteration 2

Iteration 3

Iteration 4

Iteration 5

Benefits of Test Driven Development

Benefits of Test Driven Development

$59,000,000,000

TDD - Application Lifecycle


Development Development
Testing & Bug Fixing Testing & Bug Fixing UAT UAT

Development and testing/bug fixing take about the same amount of time Development takes more time than testing, and testing time is reduced Overall lifecycle is shortened

Unit testing is a learned skill that can only be honed with experience.

Starting Test Driven Development


Creating a cultural change is hard .. and it can be done.

Q&A

Summary
Development becomes more challenging. Unit Test create a safety net. Database can be Unit Tested! Documentation is the best side effect ever! Development is Faster using TDD. VSTS is a great tool for UT and TDD.

THANK YOU

Additional Resources
Visual Studio Team System 2008 - Trial Software
http://msdn.microsoft.com/en-gb/vsts2008/products/cc268310.aspx

MSDN - Working with Unit Tests


http://msdn.microsoft.com/en-us/library/ms182515.aspx

Guidelines for Test-Driven Development


http://msdn.microsoft.com/en-us/library/aa730844.aspx

Related Sessions
ALM301: Web Sites Testing with Visual Studio Team System Shai Raiten 10:50-12:00 Arava Hall

ALM303: Professional Developer Tools in Visual Studio Maor David 10:50-12:00 Tavor Hall

DEV314: Design Patterns Learn From the Experience Avi Roth 14:30-15:40 Galil Hall

2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

You might also like