The Artima Developer Community
Sponsored Link

.NET Buzz Forum
TDD and VS Test System

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Robert Hurlbut

Posts: 547
Nickname: rhurlbut
Registered: Mar, 2004

Robert Hurlbut is a Principal Consultant with Hurlbut Consulting
TDD and VS Test System Posted: May 28, 2004 7:31 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Robert Hurlbut.
Original Post: TDD and VS Test System
Feed Title: Robert Hurlbut's .Net Blog
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/rhurlbut/Rss.aspx
Feed Description: Development with .Net, Rotor, Distributed Architectures, Security, Extreme Programming, and Databases
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Robert Hurlbut
Latest Posts From Robert Hurlbut's .Net Blog

Advertisement

Benjamin blogs about Jim Newkirk's excellent talk on Test Driven Development this past week at TechEd.  In particular, Jim talked about his use of the new unit testing features of the Visual Studio 2005 Team System.

The most interesting items, which Benjamin summarizes, are these:

The Two Tenets of Test Driven Development:

  • Never write a single line of code unless you have a failing unit test.  The goal is to take requirements and express them as test
  • Eliminate duplication

How to do TDD
Jim starts by blocking out 4 - 8 hour sessions of development. He spends 15 - 20 minutes at the start of each session thinking about what he is going to do and brainstorming a list of unit tests.

A key part is not to get hung up on completeness, you can always add more later. The purpose of the tests is to describe completion requirements.

The flow of a TDD session: Red, Green, Refactor
The process is:

  • Start by writing a test for a new capability
  • Compile
  • Fix any compile errors
  • Run the test and see it fail
  • Write the code to make the test pass
  • Refactor as needed (clean up any duplication)

The purpose is about how to use the functionality, not how to implement it! The process allows you to build confidence through having a set of tests that pass.

The most successful way to do test is to do it before the development. If you start it first then you need to think about how to test.

It's always good to have a quick refresher of basic TDD operation and thinking.

One of the coolest things about the new unit testing sysem is this:

... writing a class name followed by a method name that didn't exist yet. After compiling, Jim used a 'smart tag' to choose to create the method stub inside the target class. It wrote this stub and had a 'NotImplementedException' inside it. This is functionality similar to Eclipse and is good to see.

That's great!  This can only help .Net developers use TDD more by following the “write the tests first” rule.  Very exciting!

Read: TDD and VS Test System

Topic: Zip up solutions inside Visual Studio Previous Topic   Next Topic Topic: VS2005 Team System Guides on MSDN

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use