Wednesday, February 3, 2010

Test-driven development options

Yes, I know, this topic doesn't contain any information related to Oracle, but in my opinion it also very important part of development.

This goes against traditional programming; instead of writing functional code and then testing code as an afterthought (if testing is performed at all), you start with the test code.


You make sure the test is correct according to the necessary logic. With the test complete, it is available when the code is ready, and you quickly know if the code performs as desired. Basically, you develop code that will pass the test.

Visual Studio add-ons

There are a few Visual Studio add-ons that make it easier to use the various testing frameworks within the IDE. One of the more popular products is TestDriven.NET; however, unlike the testing frameworks, it is not free. TestDriven.NET allows you to use the features of the testing framework from within Visual Studio via one click of the mouse. It works with all versions of Visual Studio.

A key part of test-driven development is the automated unit test that properly tests code functionality. Testing frameworks provide a vehicle for creating and running these tests. Various frameworks exist for .NET developers, including the following:

QuickUnit.net: A simple testing framework written in C# for .NET applications. It is a minimalist approach to testing for developers who ignore writing unit tests and test-driven development. It can be used as a first step to become familiar with testing.
NUnit: An open source unit-testing framework for the .NET platform. It is the leader in this category, as it mimics the JUnit Java offering for the .NET platform; that is, it brings test-driven development to .NET. NUnit provides both a GUI and command-line interface. It also promotes unit testing your .NET code after coding is complete or using the test-driven approach to development. (Learn more about this framework by reading my article, “NUnit allows effective unit testing with .NET applications.”)
MbUnit: MbUnit or the Generative Unit Test Framework for the .NET Framework is offered free of charge. It was built using the .NET Framework, and it promotes test-driven development. It offers both command-line and GUI interfaces along the lines of the same features available in NUnit.
xUnit.net: A freely available testing framework available via Microsoft’s version of open source with the CodePlex site. It was designed with a goal of closely aligning itself with the .NET Framework. (One of the developers of xUnit.net originally worked on NUnit.) xUnit.net was built using .NET Framework 2.0; it does not require any installation, and it offers better integration with source control tools. xUnit.net focuses heavily on test-driven development as opposed to just testing, so there are some differences with NUnit. xUnit.net is the latest to join the pool of testing frameworks.
csUnit: A freely available testing framework that promotes test-driven development. It offers a graphical interface and easy integration with Visual Studio 2005/2008.

No comments:

Post a Comment