We present a principled automatic testing framework for application-layer protocols. The key innovation is a domain-specific embedded language for writing nondeterministic models of the behavior of networked servers. These models are defined within the Coq interactive theorem prover, supporting a smooth transition from testing to formal verification. Given a server model, we show how to automatically derive a tester that probes the server for unexpected behaviors. We address the uncertainties caused by both the server's internal choices and the network delaying messages nondeterministically. The derived tester accepts server implementations whose possible behaviors are a subset of those allowed by the nondeterministic model. We demonstrate the effectiveness of this framework by using it to specify and test a fragment of the HTTP/1.1 protocol, showing that the automatically derived tester can capture RFC violations in buggy server implementations, including the latest versions of Apache and Nginx.
翻译:我们为应用程序层协议提出了一个有原则的自动测试框架。 关键的创新是用于撰写网络服务器行为非决定性模型的域内嵌入语言。 这些模型在 Coq 互动理论验证器中定义, 支持从测试向正式验证的平稳过渡。 使用服务器模型, 我们展示了如何自动提取检测器, 检测服务器出意外行为。 我们处理服务器内部选择和网络不定期拖延信息造成的不确定性。 衍生的测试器接受服务器实施, 其可能的行为是非定义模型允许的行为的一部分。 我们通过使用这个框架来指定和测试 HTTPP/ 1. 1 协议的碎片, 显示自动衍生的测试器可以捕捉到错误服务器执行过程中的 RFC 违规现象, 包括最新版本的 Apache 和 Nginx 。