Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS CHESS is outdated?

I have a class, which works with string dictionary. One method is for initializing dictionary, another one is for adding new pair to dictionary and third method is for concatenating dictionary into string.

I'd like to unit-test if its thread-safe, by running init-adding-adding-*-adding-finalizing methods in different threads simultaneously. A new instance of the class is created before usage, dictionary is not static. So i'd like to know for sure, if its safe.

Afaik, testing threads in unit-tests is not that good idea. Instead, i had found a CHESS, which is designed with exactly the same purpose: http://blog.decarufel.net/2009/05/how-to-test-your-multi-threaded-code.html

However, looking like its outdated. Any modern alternatives/suggestions on this field?

like image 416
Vitalii Vasylenko Avatar asked Mar 21 '13 15:03

Vitalii Vasylenko


2 Answers

As an alternative, you could take a look at using the ConcurrentDictionary type, which would abstract away these particular multithreading worries.

However, if you want to continue using your own mechanism (or if you want a general answer to the question of how to test multi-threaded code), it looks from this post that CHESS is by no means obsolete. The underlying technology - multithreading - has not changed at all to my knowledge since this tool was first released, so unless you have a specific problem using it, it's perfectly reasonable to go ahead.

like image 126
Steve Westbrook Avatar answered Sep 24 '22 23:09

Steve Westbrook


The last checkin to the project was in October of 2012. I wouldn't say it's all that outdated.

http://chesstool.codeplex.com/SourceControl/list/changesets

like image 42
Erik Funkenbusch Avatar answered Sep 25 '22 23:09

Erik Funkenbusch