一句话:提出基于奖励增强的强化学习随机测试方法,通过衰减探索奖励与语义路标引导,显著提升分布式协议实现的覆盖率和缺陷发现。
分布式协议实现中的缺陷常导致互联网服务宕机,而随机测试因奖励信号稀疏难以有效探索。本文提出一种基于强化学习的随机测试方法,核心是奖励增强。作者给出两种相互递进的技术:一是基于发现新状态的衰减探索奖励,奖励随同一状态被重复访问而衰减,并取奖励与 Q 值的最大值,从而比其它方案更有效地探索;二是以谓词序列形式提供的路标(waypoints),刻画有意义的语义场景,利用设计者对协议的洞察将探索导向状态空间中有趣的部分。该奖励结构保证新回合即使没有执行缓存也能可靠到达深层有趣状态。作者用 Go 实现算法,并在 RedisRaft、Etcd 和 RSL 三个大规模基准上评估,结果显示在覆盖率和缺陷发现方面显著优于基线方法。
Bugs in popular distributed protocol implementations have been the source of many downtimes in popular internet services. We describe a randomized testing approach for distributed protocol implementations based on reinforcement learning. Since the natural reward structure is very sparse, the key to successful exploration in reinforcement learning is reward augmentation. We show two different techniques that build on one another. First, we provide a decaying exploration bonus based on the discovery of new states—the reward decays as the same state is visited multiple times. The exploration bonus captures the intuition from coverage-guided fuzzing of prioritizing new coverage points; in contrast to other schemes, we show that taking the maximum of the bonus and the Q-value leads to more effective exploration. Second, we provide waypoints to the algorithm as a sequence of predicates that capture interesting semantic scenarios. Waypoints exploit designer insight about the protocol and guide the exploration to “interesting” parts of the state space. Our reward structure ensures that new episodes can reliably get to deep interesting states even without execution caching. We have implemented our algorithm in Go. Our evaluation on three large benchmarks (RedisRaft, Etcd, and RSL) shows that our algorithm can significantly outperform baseline approaches in terms of coverage and bug finding.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{BorgarelliEMN24,
title = {Reward Augmentation in Reinforcement Learning for Testing Distributed Systems},
author = {Andrea Borgarelli and Constantin Enea and Rupak Majumdar and Srinidhi Nagendra},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {OOPSLA2},
year = {2024},
doi = {10.1145/3689779}
}