liveBook · Manning

Combination simulation testing

As explained in C++ Concurrency in Action, Second Edition

Combination simulation testing records concurrent operations and systematically explores permitted combinations of those operations to detect concurrency errors.

Combination simulation testing runs concurrent code under software that records each thread’s data accesses, lock operations, and atomic operations. It then repeats the run across combinations permitted by the C++ memory model to detect race conditions and deadlocks. section 11.2.4

The technique can find problems its simulation system is designed to detect, but the number of combinations grows exponentially with thread and operation counts. Reserve it for fine-grained tests, and check that the software supports the operations in the code. section 11.2.4

How C++ Concurrency in Action, Second Edition covers it

How deep it goes
Describes recording accesses, locks, and atomics, then replaying permitted combinations; warns that exhaustive testing scales exponentially.
What it assumes
Applies C++ memory-model rules without explaining their foundations.
What you can do after
Diagnose race conditions and deadlocks with simulation software that replays permitted operation combinations.
How it connects
Connects C++ memory-model rules with race conditions, deadlocks, and brute-force testing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of C++ Concurrency in Action, Second Edition. The section links point to the parts of the book it draws on.