Friday, April 17, 2009

Agile Development and .NET

As soon as I wrote the title for this blog I knew it would be wrong. It just crossed my mind that it should be agile development and Visual Studio. All the features I love about agile development is really easy to apply in VS. So I'm going to talk about helper applications that I like and all the things you can accomplish.

The first thing I like about agile development is the self documenting code. This is accomplished by use of discriptive function and veriable names. Good comments that are not misleading. Short functions and methods.

All that sounds like a tall measure but it's really not that big. Just consider how easy it is to refactor. I like to refactor as I use some source control system to make my small and well named classes. I also add comments at the end of the code. I use long names for my fuctions.

I wrote a function and I named it PopulateShippingInfomationFields(). This was done after I used the refactor function to remove the code to a function. I also removed the parameter that was passed to it and placed it in the method. So the addition of time to the project was about 5 minutes.

Ok so I created this function and took 5 minutes. The 5 minute part is pushing it. I admired it for a time , I took a swig of Coke and thought about the correct name. This 5 minutes bought me hours later. All the code that I wrote gets redone and changed at some point and later I feel I may need to look for this function and I can find it and it does only one thing. It was also made easy with Visual Studio.

Test Driven Development is also something made easy with Visual studio and a little plug in called. TestDriven.NET is my plug in of choice and my nUnit just fires up in my Visual Studio. I like this I don't have to stop coding to test.

I can make a test project in the same project like eCommerceWebSiteUnitTests. This will get checked into my source control with my main project. I again have a name for this project so I know what it is. It can reference the pieces I need and I can refer back to it months later and make my changes in my code. Test Driven Development is easier with smaller chunks of code. Does this code spit out the bits and pieces I need to fill the shipping information on this page? does this return a valid name. Good stuff there.

I think Agile came from the java world were the tools aren't nice enough so you can be lazy and not factor. Our tools are nice and our GUI is good and we can simply refactor and do something wonderful.

No comments: