concurrency - Unit testing concurrent software - what do you do? -


As the software becomes evenly concurrent, how do you test the main behavior of this type < / Em> with its unit tests (not parallel behavior, just main behavior)?

In the good old days, you had a type of what you said, and you have returned it and / or what others called it things to say.

Nowadays, you call a method and the actual work is determined to run on the next available thread; You do not know when it will actually start and call other things - and what's more, these other things can also be together.

How do you deal with this? Do you summarize / inject the concurrent scheduler (for example providing duplicate / duplicate work parallel libraries and unit tests)?

The resources you have helped have helped you?


Edit

I have edited the question to emphasize on this kind of general behavior (multi-core advantage) Is used to ignore parallel mechanisms to take, eg TPL)

The unit tests for race conditions and deadlock The area is relativly new and lacking good equipment.

I know about two such tools that are in initial alpha / beta steps:

  • Another option is to try and write "stress test" which can cause deadlock / race condition on the surface, can create multiples examples / threads and run them on the shoulder side, the negative side of this approach If the test fails then it will be very difficult to regenerate it. I suggest using logs in both test and production codes so that you can understand what happened.


    Comments

    Popular posts from this blog

    paypal - How to know the URL referrer in PHP? -

    oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

    wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -