arXiv:2409.02137cs.SEcs.DC2024-09被引 2

用强化学习提升分布式协议测试的漏洞发现能力

Reward Augmentation in Reinforcement Learning for Testing Distributed Systems

  • 通过状态探索奖励与路径引导相结合,增强算法探索深度
  • 在三个真实系统上覆盖范围和缺陷发现率显著优于基线方法
  • 适合需要高可靠性测试的分布式系统开发者

流行分布式协议实现中的缺陷曾导致多个互联网服务中断。本文提出一种基于强化学习的随机化测试方法。由于自然奖励稀疏,成功探索的关键在于奖励增强。我们提出两种相互补充的技术:首先,基于新状态发现提供递减探索奖励——相同状态被多次访问后奖励递减,该机制借鉴了覆盖率导向模糊测试的思想;相比其他方案,我们发现取奖励与Q值的最大值能更有效促进探索。其次,引入一组由谓词构成的“路标”(waypoints),捕捉协议中重要的语义场景,利用设计者对协议的理解引导探索至状态空间中的“有趣”区域。该奖励结构确保新回合可稳定抵达深层有趣状态,无需执行缓存。我们在Go语言中实现该算法,在RedisRaft、Etcd和RSL三个大型基准上评估,结果表明其在覆盖率和缺陷发现方面显著优于基线方法。

原文摘要 · Abstract (English)

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.

强化学习分布式系统测试验证漏洞挖掘

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。