Tuesday, December 23, 2008

Interfaces, TDD and Visual Studio

One of the problems that we were having in an agile programming environment is that while we want to incorporate TDD we are having a problem transitioning into it. We have flushed out our C# development standards and while doing so I realized that, noting that one of our standards is that classes derive from an interface which defines it, we could easily use VS interfaces and the class design wizard to force us into TDD panacea or at least some semblance thereof. The idea is to create a class development workflow following these steps. Keep in mind that this is still in the idea phase and we are going to start using it soon, once we do the steps could change or you could adapt the changes to meet your needs. This was done using Visual Studio 2008

1. Create a new class design diagram in your project.
2. Create a new interface in the class diagram; populate properties, methods, etc.
3. Create a new class in the class diagram and have it inherit from the interface.
4. Using VS features implement the interface on the class.
5. Add a unit test project to the solution.
6. Create tests for the methods you want to develop.
7. Test, code, fix.....test, code, fix until you are done.
8. Rinse and repeat

Happy coding!

1 comment:

  1. Simple and to the point, keep these tips coming! Cheerio!!!

    ReplyDelete