论文标题
MET:CRDT设计和实现的模型检查驱动的探索性测试
MET: Model Checking-Driven Explorative Testing of CRDT Designs and Implementations
论文作者
论文摘要
互联网规模的分布式系统通常会在多个地理位置复制数据,以提供低延迟和高可用性。无冲突的复制数据类型(CRDT)是一个框架,它提供了一种原则性的方法来维持数据复制品之间最终的一致性。众所周知,CRDT很难正确设计和实施。微妙的深错误在于对所有可能发生冲突的数据更新的复杂而乏味的处理。我们认为,应将CRDT设计正式指定并检查模型以发现深层错误。需要进一步测试实施。一方面,测试需要继承模型检查的详尽性质,并确保测试的覆盖范围。另一方面,预计测试将找到无法通过设计级别验证检测到的编码错误。 面对上面的挑战,我们提出了模型检查驱动的探索性测试(MET)框架。在设计级别,MET使用TLA+来指定和模型检查CRDT设计。在实现级别上,MET进行模型检查驱动的探索性测试,从某种意义上说,测试用例是从模型检查轨迹自动生成的。控制系统执行以确定性地进行,按照模型检查跟踪进行。探索性测试系统地控制并列入所有非确定消息重新排序。 我们将MET应用于CRDT的实际发展。发现了CRDT的设计和实现中的错误。至于可以通过传统测试技术发现的错误大大降低了解决错误的成本。此外,MET可以找到微妙的深错误,而现有技术以合理的成本无法找到。我们进一步讨论了MET如何使我们对CRDT设计和实施的正确性充分信心。
Internet-scale distributed systems often replicate data at multiple geographic locations to provide low latency and high availability. The Conflict-free Replicated Data Type (CRDT) is a framework that provides a principled approach to maintaining eventual consistency among data replicas. CRDTs have been notoriously difficult to design and implement correctly. Subtle deep bugs lie in the complex and tedious handling of all possible cases of conflicting data updates. We argue that the CRDT design should be formally specified and model-checked to uncover deep bugs. The implementation further needs to be systematically tested. On the one hand, the testing needs to inherit the exhaustive nature of the model checking and ensures the coverage of testing. On the other hand, the testing is expected to find coding errors which cannot be detected by design level verification. Towards the challenges above, we propose the Model Checking-driven Explorative Testing (MET) framework. At the design level, MET uses TLA+ to specify and model check CRDT designs. At the implementation level, MET conducts model checking-driven explorative testing, in the sense that the test cases are automatically generated from the model checking traces. The system execution is controlled to proceed deterministically, following the model checking trace. The explorative testing systematically controls and permutes all nondeterministic message reorderings. We apply MET in our practical development of CRDTs. The bugs in both designs and implementations of CRDTs are found. As for bugs which can be found by traditional testing techniques, MET greatly reduces the cost of fixing the bugs. Moreover, MET can find subtle deep bugs which cannot be found by existing techniques at a reasonable cost. We further discuss how MET provides us with sufficient confidence in the correctness of our CRDT designs and implementations.