DreamTest: World-Model Surrogates for Search-Based Testing of Deep Reinforcement Learning Agents
Organizations: Lero Research Centre, University of Limerick, Ireland · University of Ottawa, Canada
Abstract
Testing deep reinforcement learning (DRL) agents in cyber-physical systems aims to uncover diverse failures before deployment, but each execution can be expensive. Surrogate-assisted testing reduces this cost by learning to predict which test configurations are likely to fail. Prior surrogates treat the system as a black box and predict pass or fail outcomes directly; we instead model how a test unfolds and estimate failure from an imagined episode. We introduce DreamTest, a world-model surrogate for testing DRL agents. DreamTest adapts a recurrent state-space model to learn agent behaviour and environment dynamics from the agent's training log. Given a candidate configuration, imagined rollouts produce a failure score that guides search without executing every candidate in a simulator or real system. We evaluate DreamTest for failure prediction, test generation, and failure diversity on Parking, Humanoid, and DonkeyCar. Mean area under the precision-recall curve (AUPRC) exceeds the strongest baseline by 97%, 12%, and 39%, respectively, and gains on five out-of-distribution test sets reach 145%, 29%, and 44%. Under the same simulator-validation budget, the best "DreamTest + search" combinations find 29%, 22%, and 79% more novel failures on average. Across clusterings with k = 2-40, failures generated with DreamTest cover the most behavioural clusters for almost all k, indicating that DreamTest consistently discovers behaviourally diverse failures.
Figures & tables
| Benchmark | DreamTest | MLP | Regressor | Polynomial | Kriging | RBF network |
|---|---|---|---|---|---|---|
| Parking | overshoot =0 ov_starts =8 free bits | hidden units epochs fail_frac batch | hidden max_iter patience | degree class_weight =none | constant subsample | n_centers |
| Humanoid | overshoot =12 ov_starts =16 free bits | hidden units epochs fail_frac batch | hidden max_iter patience | degree class_weight =none | constant subsample | n_centers |
| DonkeyCar | overshoot =5 ov_starts =8 free bits | hidden units epochs fail_frac batch | hidden max_iter patience | degree class_weight =balanced | constant subsample | n_centers |
| AUPRC | AUROC | ||||
|---|---|---|---|---|---|
| Benchmark | Surrogate | hist. | fresh | hist. | fresh |
| Parking | DreamTest | 0.156 0.035 | 0.120 0.063 | 0.832 0.040 | 0.817 0.071 |
| MLP | 0.074 0.028 ∗ | 0.061 0.041 ∗ | 0.648 0.050 ∗ | 0.684 0.116 ∗ | |
| Regressor | 0.048 0.025 ∗ | 0.030 0.034 ∗ | 0.567 0.060 ∗ | 0.527 0.076 ∗ | |
| Kriging | 0.058 0.018 ∗ | 0.048 0.037 ∗ | 0.703 0.034 ∗ | 0.674 0.072 ∗ | |
| Polynomial | 0.058 0.018 ∗ | 0.049 0.039 ∗ | 0.708 0.029 ∗ | 0.683 0.069 ∗ | |
| AUPRC | AUROC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Surrogate | unseen slots | extrapolated poses | torso 20% | torso 5% | severe 20% | unseen slots | extrapolated poses | torso 20% | torso 5% | severe 20% |
| DreamTest | 0.067 0.016 | 0.203 0.037 | 0.298 0.046 | 0.327 0.031 | 0.475 0.050 | 0.63 | 0.81 | 0.78 | 0.77 | 0.75 |
| MLP | 0.039 0.012 ∗ | 0.066 0.010 ∗ | 0.221 0.015 ∗ | 0.230 0.026 ∗ | 0.299 0.015 ∗ | 0.43 | 0.58 | 0.67 | 0.64 | 0.60 |
| Regressor | 0.045 0.006 ∗ | 0.061 0.013 ∗ | 0.207 0.012 ∗ | 0.246 0.023 ∗ | 0.263 0.010 ∗ | 0.51 | 0.54 | 0.65 | 0.67 | 0.57 |
| Kriging | 0.051 0.008 ∗ | 0.079 0.012 ∗ | 0.182 0.008 ∗ | 0.207 0.011 ∗ | 0.287 0.009 ∗ | 0.60 | 0.64 | 0.64 | 0.62 | 0.59 |
| Polynomial | 0.047 0.000 ∗ | 0.083 0.000 ∗ | 0.231 0.000 ∗ | 0.303 0.000 | 0.329 0.000 ∗ | 0.59 | 0.67 | 0.69 | 0.69 | 0.63 |
| Parking | Humanoid | DonkeyCar | ||||||||
| Type | Method | Rank | GA | HC | Rank | GA | HC | Rank | GA | HC |
| Ensembled surrogate | DreamTest | 6.6 1.8 | 10.1 3.2 | 14.5 2.9 | 21.5 3.5 | 21.4 3.5 | 19.9 2.4 | 12.2 3.0 | 3.8 3.5 | 4.7 1.7 |
| MLP | 2.7 1.8 ∗ | 11.2 2.8 | 5.7 1.6 ∗ | 14.3 2.3 ∗ | 13.4 2.4 ∗ | 17.6 3.8 | 6.4 2.1 ∗ | 5.5 1.6 | 4.6 2.0 | |
| Regressor | 1.0 0.9 ∗ | 2.6 1.5 ∗ | — | 14.5 3.0 ∗ | 13.7 2.5 ∗ | — | 4.3 2.4 ∗ | 6.7 2.3 | — | |
| Kriging | 1.3 0.8 ∗ | 1.4 1.3 ∗ | — | 7.6 2.5 ∗ | 3.1 2.4 ∗ | — | 6.7 1.3 ∗ | 1.5 1.0 | — | |
| Polynomial | 1.6 1.0 ∗ | 1.5 1.2 ∗ | — | 13.1 3.2 ∗ | 10.1 2.3 ∗ | — | 5.4 2.8 ∗ | 1.6 1.8 | — | |
| Component | Variant | Parking | Humanoid | DonkeyCar |
|---|---|---|---|---|
| Full model | DreamTest | 0.156 0.035 | 0.210 0.030 | 0.393 0.037 |
| Without imagination | direct classifier on RSSM configuration embedding | 0.121 0.037 ∗ | 0.205 0.025 | 0.177 0.019 ∗ |
| Imagination horizon | (no imagined step) | 0.032 0.009 ∗ | 0.073 0.022 ∗ | 0.131 0.021 ∗ |
| step | 0.041 0.012 ∗ | 0.080 0.021 ∗ | 0.111 0.010 ∗ | |
| 0.051 0.010 ∗ | 0.107 0.036 ∗ | 0.154 0.032 ∗ | ||
| 0.126 0.039 ∗ | 0.115 0.033 ∗ | 0.293 0.046 ∗ |
Automated Software Testing
Automated software testing uses tools and algorithms to generate, run, and evaluate tests that find defects and prevent regressions.
See all 135 papers