Thursday, December 4, 2008

VS.NET 2010 - the illusion of the built-in TDD support.

TDD means Test Driven Development. Every person involved in the software development used it or at least heard about that. VS.NET 2010 "what's new" documentation has the "TDD support" item in the list of the new features. What would it mean? How did they make the support of software development philosophy in IDE? I tried to figure it out and was totally disappointed...
Well, there is the new Project Template in VS.NET 2010. It is called "Test Project" and it's description is "The project that contains the test":) In reality this is the Class Library Project that has the reference to the new MS assembly that contains classic "TestFixture", "Test" attributes, assertion methods and so on. Also, the newly created project contains the class with the test methods and text file with the brief description of TDD concept.
So, once you start the development keeping TDD in mind you should start with writing the new test. The test typically consists of creating the new instance of some type, invoking this type methods and compare the real results of something with the expected result. You write the code that creates the new instance of non-existing type. Visual Studio IDE reports about the error. You click on the smart tag near the code that creates the instance of the non-existing type and IDE creates the new type for you. Then you can run the tests, see if they fail, fix the code, run the tests again and so on.
So, what actually MS did for "TDD support"?
  • They created VS.NET add-in that allows to automatically create the new classes, methods, properties, indexers and so on by clicking on the smart tags near the piece of the code. Frankly, it can be done for a couple of days by every programmer who intimate with VS add-in development.
  • They created the new assembly that actually copies NUnut.Framework assembly. Yeah, I bet no one will want to re-write tons of unit tests created using NUnit or MBUnit using this new library.
  • They added the tools that allow to run the unit tests that created using the MS unit tests library.(Resharper has the tools that allow to run NUnit tests from IDE:))
  • They added the new Project Template which is actually not new.
  • They called all these stuff "built-in TDD support".
And I am ready to hear the words like "TDD makes your business flow easier and VS.NET 2010 has the TDD support!" in MS sessions.
So, what is conclusion? The conclusion is - MS developed the pretty simple and useless feature, packed it to the nice wrappers and called it "TDD support!"
Everyone knows what would be result if pack the useless feature to the nice wrappers.


2 comments:

  1. What I'd like to see is the VS team take the approach that the ASP.NET MVC team did, provide out of the box support for MS Test but create hooks for other unit testing libraries as well.

    The stuff ASP.NET MVC does for testing is very rudimentary, but if they bake all of the support they're giving MS Test into the platform they can vastly improve the experience for everyone.

    Imagine having TDD support for not just C# and VB.NET but also, IronRuby and native C++ code. Each with your unit testing library of choice.

    ReplyDelete
  2. Actually I believe that TDD is philosophy of writing the code. It is in your mind and not in the tools that just help you to follow TDD. This is why I consider "TDD support" in VS as useless feature.

    ReplyDelete