cs.SEAug 23, 2026

Learning from the Test: Self-Referential Differential Testing for Deep RL Agents

Authors: Junda He, Jieke Shi, Zhou Yang, Mingfei Cheng, David Lo

Organizations: Singapore Management University, Singapore · University of Alberta, Edmonton, Canada and Canada CIFAR AI Chair, Amii, Edmonton, Canada

Abstract

Deep Reinforcement Learning (DRL) has achieved significant success in complex decision-making problems. As DRL systems are increasingly deployed in real-world applications, ensuring their quality and reliability is paramount. Current works primarily focus on detecting safety-critical failures, often neglecting policy optimality, which can lead to reduced efficiency, user distrust, and economic losses. This oversight, compounded by the inherent "testing oracle problem" for optimality, leaves a significant gap in comprehensively evaluating DRL systems. To address this gap, we propose Delta (Differential Testing for DRL Agents), a novel and comprehensive framework that automatically identifies both safety-critical and optimality bugs in DRL agents. Delta employs a two-phase approach: (1) Safety Testing, where the Agent Under Test (AUT) is evaluated for catastrophic failures while collecting data from its decision-making policy, and (2) Optimality Testing, where this collected data from the prior phase is used to train a challenger agent via Offline Reinforcement Learning. Differential testing is then performed by comparing the challenger agent against the AUT; instances where the challenger achieves higher cumulative rewards indicate optimality issues in the AUT. We demonstrate Delta's effectiveness across five environments. We investigate the effectiveness of three offline RL algorithms (BC, BCQ, and CQL) in generating challenger agents. Experimental results demonstrate that safety testing datasets are valuable for training competent DRL agents. Challenger agents trained with BCQ proved most effective for identifying optimality issues within the framework of Delta. Across the five environments, Delta uncovered an average of 2,518 optimality issues, outperforming the baseline methods by 50.2%.

Figures & tables

Explore similar work

CardsList
  1. DreamTest: World-Model Surrogates for Search-Based Testing of Deep Reinforcement Learning Agents

    Oct 3, 2026Qinghua Xu, Guancheng Wang, Boxi Yu +2Automated Software TestingNeural Surrogate Modeling

  2. Analyzing Symbolic Properties for DRL Agents in Systems and Networking

    Apr 6, 2026Mohammad Zangooei, Jannis Weil, Amr Rizk +2Reinforcement LearningNeural Network Verification

  3. Robust Policy Optimization via Adversarial Importance Sampling

    Sep 11, 2026Amine Andam, Jamal Bentahar, Mustapha HedabouRobust RLPolicy Learning