Tuesday, September 26, 2006

Integrating MStests with Nant

Intgrating MSTests with Nant

MSTest.exe is command line utility which can be executed using Exec Task of Nant

MSTest Command Line Options

BeginTag exec
program ="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\MSTest.exe" commandline="/testcontainer:C:\Projects\ProjectName\Build\WebTests\Matrix.WebApplication.Tests.dll /resultsfile:C:\Projects\ProjectName\Build\WebTests\a.trx" basedir="C:\Projects\ProjectName\Build\WebTests" >
EndTag exec

testcontainer: Load a file that contains tests
runconfig: Load a file that contains tests
resultsfile: Save the test run results to the specified file

CruiseControl and MSTests


Running Unit Test on Build Server
In order to run tests during build, Team Edition for Testers must be installed on the build computer. In order to run unit testing, code coverage or code analysis, Team Edition for Developers must be installed on the build computer.


Saturday, September 23, 2006

Design is back. Long live design

It is very encouraging to read from the experiences of agile practitioners that they think up-front design (Architecture and framework) is too important to be left implicit in any methodology. I always believed in up-front design and evolutionary design facilitated by effective refactoring and automated testing, being core parts of any methodology. There are complimentary to each other, rather than forcing a programmer to use one over another. You dismiss one; you have a very lousy software at hand.

Martin Fowler also advocates nicely in making use of best of both worlds. It makes more sense now.

Being an Agile Architect
We found that a year down the road that there was still a lot missing. Too many "infrastructure" or "framework" things were blowing by in this delirious rush to crunch out 100% business functionality every week no matter what. Someone with Architecture experience needs to perform explicitly the role of Agile Architect and restore these capabilities to a team


Sam's post on agile architecture has led to the death of my last vestiges of my denial in regards to a need for some formal recognition of software design on an agile team.

The absence of explicit software design activities on our team has lead to some degradation of software design that is leading the code down the slippery slope to opaqueness and to the initial indications of software entropy. We're trying to add a bit more formality to software design and software design guidance into our process. Recognizing a software designer's role on the team tasked with up-front design and continuous software design quality assurance is part of this effort.

It pays to be a coward Extreme Programmer

Monday, September 18, 2006

Re-read Head First Design Pattern-- my rating -- 5/5

Readability : 5/5
Information about Subject : 5/5

Couple of years back when I was exposed to Design Patterns, I went on buying spree for every computer book with design pattern somewhere in title. In that buying spree, I bought this book as soon as it hit the market. Now I am glad to see that this book is on every Architect’s book shelf. If GOF’s Design Pattern book was a Bible which only high priest(C++ Guys) could read and understand, this book spread the word of Design God to ordinary mortals(vb) and connected the ordinary programmers to OOP.
After reading these books, ordinary mortals could come up with a good or not so good OOP solution but never had they gone back to procedure programming.

After reading first few chapters, I think that Strategy Pattern can very useful.

If you could never understand Command Pattern, try this book.

Tuesday, September 05, 2006

Why do I perfer Custom Collection over Dataset?

I don't like dataset as a mechanism to transfer data between two layers for following reasons

1. Not a true OOP concept
I seriously follow Rockford Lhotka's writing and agree with him on this.

2. Bad Performance.
I did some benchmarking tests on Custom Collections vs. Dataset as being transport mechanism in Web Services Scenario in Net 1.0. Custom collections performed four times better than Dataset. I am sure in remoting scenario , difference would be more dramatic. I am going to perform very soon some benchmarks tests on .Net 2.0

More Details

3. More Code
One ends up writing more code in packaging and unpackaging data in dataset.Remoting and WebServices infrastructure takes care lot of Serialization and Deserialization issue. Before Generics, by getting rid of dataset, I was able to get rid of 1000s line of code and get more performance.
Recently I did some benchmark tests on generics from my office computer (Which has less memory) and got more encouraging results. I will post them very soon on my blog

4. Not SOA friendly
If datasets are exposed through WebSerivecs, only .net Clients can use these Web-Services.

Chirdeep Shetty has very a nice post about problems that he faced to convert C# WebServices to Java WebServices because of dataset and workaround.

Having said that I may use Dataset/DataTable in following situations
1. When I have a situation where columns of a custom collection are variable. DataTable/Dataset IMO offers more clean solution.
2. Disconnected rich client architecture