locked
unit testing for multi threaded application RRS feed

  • Question

  •  

    Hi

    How do i write unit test for a method that uses multi thread in c#.net using test driven approach. I came to know that in a unit-testing context, for instance, running threads on separate application domains can be of great benefit. Is this the correct way of testing ? If so pls help me how to do that otherwise guide me the correct way. 

     

    Regards

    satish

     

    Tuesday, September 30, 2008 1:29 PM

Answers

  • Ahh... okay..., so it works fine to a point.  While we can still help execute the method, we don't actually monitor the background threads... so... if the thread was to throw an exception, we don't trap or handle this causing a failure in the run.

     

    We currently don't have a great story for multi-threaded apps.

     

    Friday, October 3, 2008 11:27 PM

All replies

  • What is the end goal of unit testing by running multiple thread?  Are you looking for deadlocks, or just trying to speed up the testing?

     

    Wednesday, October 1, 2008 11:18 PM
  • Hi Bruce

     

    My application uses multiple threads for processing different tasks. So I want to test this type of methods which invokes multithreads.

     

    Thanks

    satish

     

    Friday, October 3, 2008 11:26 AM
  • Ahh... okay..., so it works fine to a point.  While we can still help execute the method, we don't actually monitor the background threads... so... if the thread was to throw an exception, we don't trap or handle this causing a failure in the run.

     

    We currently don't have a great story for multi-threaded apps.

     

    Friday, October 3, 2008 11:27 PM
  • If you really want to test a multi-thread application here is a good tool

    Thursday, May 7, 2009 1:01 AM