Thursday, May 8, 2008

Unit Testing

In the couple of projects i worked on, i tried to use nunit but failed miserably. All the applications i tried were typical asp.net applications (3-tier) and i had a lot of difficulty in writing test cases to test the methods which return collections and in testing UI events. UI events include checking whether a particular field/set of fileds are updated and with correct data upon some action by user. I thought it has something to do my knowledge of using nunit OR nunit supports testing of components and not UI events or methods returning collections.

The problems i faced (in testing methods that return collections based on filter criteria)
1) I have to write the data retrieval methods to fetch data from DB to check against the method being tested. So, there could be error in writing the code to fetch data directly from DB.
2) Once a method is tested, i have to restore the data to previous state to test the same method again. i think this is necessary for repetitive testing.

I discussed the same with my colleagues but didn't get a satisfied answer. Thanks in advance for providing me any links to useful posts on the topic.

1 comment:

Anonymous said...

konni nijalu

http://dedicatedtocpbrown.wordpress.com/2009/12/28/%E0%B0%9A%E0%B1%87%E0%B0%A6%E0%B1%81-%E0%B0%A8%E0%B0%BF%E0%B0%9C%E0%B0%82-%E0%B0%95%E0%B0%BE%E0%B0%A8%E0%B1%80-%E0%B0%A8%E0%B0%BF%E0%B0%9C%E0%B0%82-%E0%B0%92%E0%B0%95%E0%B1%8D%E0%B0%95/