Blog / Guide
Monte Carlo testing for robots: what is it, and why does one passing run prove little?
Monte Carlo testing for robots runs the same test many times with the conditions and timing shifted a little each time, and reads the share of runs that failed.
The Digital Twin Security teamPublished Updated 3 min read
Short answer: Monte Carlo testing for robots runs the same test many times, with the conditions and the timing shifted a little at random on each run, and reads the result as the share of runs that failed. One passing run proves little, because a robot near a limit passes on some runs and fails on others. Digital Twin Security runs every test many times in simulation, shifts the conditions and the timing on each run, and reports each failure with the exact run to replay.
Book a demoWhat is Monte Carlo testing for robots?
Monte Carlo testing answers a question with many random trials instead of one calculation. For a robot, a trial is one run of a test. The random part is whatever differs between two days on the same route, such as the second a gust arrives or the spot where a person steps onto the path.
Each run ends in a pass or a failure. The result of the test is the count: how many runs failed, out of how many.
Why does one passing run prove little?
Because near a limit the same test gives different results. A robot far inside its limits passes every run. A robot close to one passes most runs and fails a few, so a single run usually lands on a pass and hides the failure.
Our research on our own test systems found tests that passed their first run and failed a later one, as how many times to run a robot safety test sets out.
What should change from one run to the next?
Whatever would differ on a real day, and nothing else:
- When things happen. A person steps out a second later, or a fault begins a second sooner.
- How strong a condition is. A little more rain or a little less wind, inside the range the test is about.
- Where things are. A parked van stands a meter further along the street.
- How an instruction is worded, for a robot that takes spoken or written orders.
The robot's software and the situation under test stay the same. Each run should be set by a number, so a failed run can be repeated exactly.
How do you read the result of a Monte Carlo test?
As a share of runs, with the number of runs beside it.
| What the runs showed | What it means |
|---|---|
| Every run passed | The robot is inside its limit for this test, as far as these runs reach |
| Most runs passed and a few failed | The robot is near a limit, and the failed runs show which timing breaks it |
| Every run failed | The cause is steady, so it is the first thing to fix |
The number of runs decides how rare a failure the test can find. A failure that happens once in a hundred runs is missed by ten runs about nine times in ten.
How does Digital Twin Security run Monte Carlo tests?
Digital Twin Security runs every test many times in simulation, with the conditions and the timing shifted a little on every run. The robot's own control software makes each decision: ArduPilot connects today, and a team's own software connects through our Python SDK.
The share of runs that passed becomes the safety score. Each failure is graded by severity and kept with the exact run to replay.
Frequently asked questions
What is Monte Carlo testing for robots?
Monte Carlo testing for robots runs one test many times, with the conditions and the timing shifted at random on each run. The result is the share of runs that failed, which says far more than a single pass.
How many runs does a Monte Carlo test of a robot need?
It depends on how rare a failure has to be found: the rarer the failure, the more runs it takes. For a failure that could hurt someone, that means hundreds of runs, which simulation makes cheap.
Can a failed run from a Monte Carlo test be repeated?
Yes, when every run is set by a number. At Digital Twin Security the same number replays the same run exactly.
Who runs Monte Carlo tests on robots?
Digital Twin Security. We run each test many times in simulation on a robot's own control software, and report how many runs failed with a replay of each failure.