liveBook · Manning

Stress test

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

Brute-force testing repeatedly executes software, often under varied or high-load conditions, to expose failures that occur only under particular execution schedules.

Stress testing repeatedly runs code, often with multiple threads, to increase the chance of exposing bugs that depend on a particular scheduling sequence. More runs can increase confidence, especially for fine-grained tests, but cannot guarantee that a problematic schedule will occur. section 11.2.4

Interpret passing results cautiously:

  • A test may never trigger the circumstances needed to reveal a bug, regardless of how often it runs. section 11.2.4
  • Hardware and operating-system behavior may prevent relevant circumstances from occurring on the test system. section 11.2.4
  • Large tests may cover too few of the possible scheduling permutations to provide strong confidence, even after many runs. section 11.2.4

Repeated queue tests

A fine-grained test of a thread-safe queue can be run repeatedly to build confidence; a single successful run provides less reassurance than many successful runs. section 11.2.4

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

How deep it goes
Explains how repetition affects confidence and details limits from test design, scheduling coverage, and platform behavior.
Examples
Uses repeated runs and fine-grained thread-safe queue tests as concrete illustrations.
What it assumes
Assumes a defined test scenario and code that exercises the functions under test.
What you can do after
Apply repeated test runs to seek scheduling-dependent bugs while judging confidence against test scope and platform limits.
How it connects
Connects multithreaded testing with thread scheduling and fine-grained tests of thread-safe queues.

Also explained in

Compare how 4 books explain stress test →

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.