Software Engineering
New Techniques Help Developers Debug Flaky Tests in Autonomous Systems
Researchers introduce statistical delta debugging methods to isolate failures in cyber-physical systems despite unpredictable simulator behavior.
When testing autonomous systems like robots and elevators, engineers rely heavily on computer simulations. The problem: these simulators often behave unpredictably, with the same test producing different outcomes each time—a phenomenon known as "flaky" test failures. This randomness makes it nearly impossible to identify what actually caused a system to malfunction.
A new research paper from arXiv presents three novel delta debugging algorithms designed specifically to handle this challenge in cyber-physical systems (CPSs). Rather than abandoning traditional debugging approaches, the researchers combined statistical analysis of failures, multiple test reruns, and smart reduction of test inputs to pinpoint the true causes of failures—even in stochastic environments.
How the approach works#
Delta debugging typically works by progressively removing portions of a failing test case until only the minimal conditions needed to trigger the failure remain. The challenge with flaky systems is that randomness can mask or reveal failures unpredictably. The new methods account for this by:
- Running tests repeatedly to build statistical confidence about whether a failure is genuine
- Reducing test inputs while monitoring how the removal affects failure rates
- Identifying and eliminating segments that introduce incidental randomness rather than core failure conditions
Real-world validation#
The team tested their techniques on three different systems:
- Elevator dispatching system: An industrial implementation that uses randomized optimization algorithms
- Autonomous mobile robot: A platform exhibiting non-deterministic behavior introduced by simulator quirks
- Robotic arm with AI policy: A vision-language-augmented manipulation system generating stochastic actions during machine learning inference
Key finding: Reducing flakiness#
The results revealed an unexpected benefit. By stripping away test segments that introduce random noise, the reduced test cases not only became simpler to analyze but also reproduced failures more reliably than the original tests. This happens because minimizing a test removes accidental sources of randomness, leaving only the conditions that actually cause the failure. This improvement in reproducibility transforms debugging from an exercise in frustration into a practical process.