2

What I have in mind is something that, when I've got a (unit or component or integration or system) test running, it'll inject random sleeps into each thread, so as to make it easier to find race conditions.

Does anything like this exist for .NET?

Update: I've seen "CHESS", but we need something with support for Visual Studio 2012 (although we're not using .NET 4.5 yet).

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380

2 Answers2

1

Here is an interesting article which may provide you some help with your query.

CHESS Created by Microsoft Research, CHESS is a novel combination of model checking and dynamic analysis (see go.microsoft.com/fwlink/?LinkId=116523). It detects concurrency errors by systematically exploring thread schedules and interleaving. It is capable of finding race conditions, deadlocks, hangs, livelocks, and data corruption issues. To help with debugging, it also provides a fully repeatable execution. Like most model checking, the systematic exploration provides thorough coverage. As a dynamic analysis tool, CHESS runs a regular unit test repeatedly on a specialized scheduler. On every repetition, it chooses a different scheduling order. As a model checker, it controls the specialized scheduler that is capable of creating specific thread interleavings. To control the state space explosion, CHESS applies partial-order reduction and a novel iteration context bounding.

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
1

Microsoft Research has a project called CHESS:

CHESS is a tool for finding and reproducing Heisenbugs in concurrent programs. CHESS repeatedly runs a concurrent test ensuring that every run takes a different interleaving. If an interleaving results in an error, CHESS can reproduce the interleaving for improved debugging. CHESS is available for both managed and native programs.

Note that generally I believe these tools are referred to as "fuzzing tools" (for "fuzz testing").

For what it's worth, it shouldn't matter that you're using the .NET Framework. Any tool that fuzzes threads within a process should do.

That allows you to look at other tools, that aren't specifically tailored to a CLR environment. This article mentions Cuzz, although it would appear to be unreleased.

You may also be interested in this question and its answers.

Community
  • 1
  • 1
ta.speot.is
  • 26,914
  • 8
  • 68
  • 96