我想到的是,当我运行(单元或组件或集成或系统)测试时,它会将随机 sleep 注入(inject)每个线程,以便更容易找到竞争条件.
.NET 是否存在类似的东西?
更新:我见过“CHESS”,但我们需要一些支持 Visual Studio 2012 的东西(尽管我们还没有使用 .NET 4.5)。
最佳答案
这是一个有趣的 article这可能会为您的查询提供一些帮助。
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.
关于.net - 是否有任何 .NET 测试工具可以更轻松地发现线程问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15459266/