一句话:利用纯函数式FRP的引用透明性,为跨平台响应式系统提供断言、记录回放与随机测试结合的运行时验证调试方法。
论文关注硬件响应式系统、交互式物理仿真和游戏等难以测试调试的问题:运行缺乏可复现性,且难以自动生成合适测试数据。作者指出,纯函数式语言中实现的若干函数响应式编程(FRP)变体能在整个程序层面提供引用透明性,从而支持跨平台的综合验证与调试,包括基于时序逻辑的断言、运行记录与回放以及 QuickCheck 自动随机测试。结合允许受限副作用的可扩展 FRP,还可验证软件仿真、分析故障影响、确认容错机制有效性并进行软件/硬件在环测试。作者在多个 FRP 实现构建的非平凡系统上验证了该方法,并借助可控制时间线、定位断言违反的工具调试。
Abstract Many types of interactive applications, including reactive systems implemented in hardware, interactive physics simulations and games, raise particular challenges when it comes to testing and debugging. Reasons include de facto lack of reproducibility and difficulties of automatically generating suitable test data. This paper demonstrates that certain variants of functional reactive programming (FRP) implemented in pure functional languages can mitigate such difficulties by offering referential transparency at the level of whole programs. This opens up for a multi-pronged approach for assisting with testing and debugging that works across platforms, including assertions based on temporal logic, recording and replaying of runs (also from deployed code), and automated random testing using QuickCheck. When combined with extensible forms of FRP that allow for constrained side effects, it allows us to not only validate software simulations but to analyse the effect of faults in reactive systems, confirm the efficacy of fault tolerance mechanisms and perform software- and hardware-in-the-loop testing. The approach has been validated on non-trivial systems implemented in several existing FRP implementations, by means of careful debugging using a tool that allows the test or simulation under scrutiny to be controlled, moving along the execution time line, and pin-pointing of violations of assertions on personal computers as well as external devices.