views:

296

answers:

5

I have used a bit of MS VS2008 integrated Unit Testing framework for writing unit test, but not that extensive, any suggestions which framework will work best for web based applications developed using ASP.NET.

+1  A: 

I use the VS integrated framework with an MVP pattern. The web tests of vs are fine for me too.

Pablo Castilla
So are you testing your business logic separately, and front end separately, or you just test the ASP.NET pages which in turns validate the correctness of your business and data logic?
BT
Well, the UI logic is tested using the mvp pattern. http://msdn.microsoft.com/en-us/magazine/cc188690.aspx For load testing I use web tests too.
Pablo Castilla
+1  A: 

Pretty much any framework will work for you so long as you have some separation of concerns such that your asp.net code is testable. There is a comparison matrix here:

http://xunit.codeplex.com/wikipage?title=Comparisons&referringTitle=Home

probably a bit xunit biased. I actually really like xunit after having used it on the subsonic project. You can get tight visual studio integration using testdriven.net

If you're looking to do functional testing then look at http://stackoverflow.com/questions/91703/end-to-end-application-testing-from-a-users-standpoint

stimms
+1  A: 

For web tests I use Selenium, and then for testing the "backend" I will use nUnit/MbUnit. Selenium allows you to either record scripts via a browser plugin or create the tests as a set of methods much the same as standard nUnit unit tests with some specific syntax for driving selenium.

Selenium - Tutorials and downloads

simon_bellis
I'm pretty comfortable with MS VS2008 integrated unit test environment for business and data logic, i haven't worked with nUnit so not sure about its integration with VS. Selenium is also a new tool for me, never heard of it before, so i'll give it a try and see if it can help me with front end.. Thanks!
BT
If you are comfortable with the MS test environment the nUnit framework is fairly similar some attibutes have slightly different names etc. You need to reference the nUnit dll and use the NUnit.Framework namespace
simon_bellis
A: 

MS's unit testing framework is not far from being a direct copy of NUnit 2.2 - semantic differences only. NUnit has probably had more support since then, so I'd give it a small edge. But only a small one.

pdr
+1  A: 

I've played with Telerik's new WebUITest studio and it does look pretty slick for UI testing. However, it is very expensive and Selenium is pretty attractive for free. If you are in a large organization with a distinct QA group doing testing then I'd check out Telerik. Otherwise, Selenium.

BTW: I have to second stimmms' point about having a proper separation of concerns for your application unit testing - it makes all the difference.

Mark Brittingham