Teaching practical realistic verification of distributed algorithms in Erlang with TLA+

Peter Zeller, Annette Bieniusa, Carla Ferreira
{"title":"Teaching practical realistic verification of distributed algorithms in Erlang with TLA+","authors":"Peter Zeller, Annette Bieniusa, Carla Ferreira","doi":"10.1145/3406085.3409009","DOIUrl":null,"url":null,"abstract":"Distributed systems are inherently complex as they need to address the interplay between features like communication, concurrency, and failure. Due to the inherent complexity of these interacting features, it is typically not possible to systematically test these kind of systems; yet, unexpected and unlikely combinations of events might cause corner cases that are hard to find. But since these systems are running typically for long durations, these events are likely to materialize eventually and must be handled correctly. Caught in such a dilemma, students are able to experience the benefits of applying verification tools to check their own algorithms and implementations. Having executable models with automatically generated executions allows them to experiment with different solutions by iteratively adapting and refining their algorithms. In this experience report, we report on our experience of teaching verification in a (hands-on) distributed systems course. We argue that broadcast algorithms provide a sweet spot in design and verification complexity. To this end, we give an implementation of these algorithms in Erlang and derive a TLA+ specification. TLA+ is a formal language for describing and reasoning about distributed and concurrent systems and provides a model checker, TLC, among other things. Our study reveals interesting parallels between the Erlang and TLA+ code, while exposing the challenges of formally modeling communication and parallelism in distributed systems. Presenting selected aspects of our course design, we aim to motivate the feasibility and need for introducing verification in close correspondence to programming tasks.","PeriodicalId":202303,"journal":{"name":"Proceedings of the 19th ACM SIGPLAN International Workshop on Erlang","volume":"11 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-08-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 19th ACM SIGPLAN International Workshop on Erlang","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3406085.3409009","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Distributed systems are inherently complex as they need to address the interplay between features like communication, concurrency, and failure. Due to the inherent complexity of these interacting features, it is typically not possible to systematically test these kind of systems; yet, unexpected and unlikely combinations of events might cause corner cases that are hard to find. But since these systems are running typically for long durations, these events are likely to materialize eventually and must be handled correctly. Caught in such a dilemma, students are able to experience the benefits of applying verification tools to check their own algorithms and implementations. Having executable models with automatically generated executions allows them to experiment with different solutions by iteratively adapting and refining their algorithms. In this experience report, we report on our experience of teaching verification in a (hands-on) distributed systems course. We argue that broadcast algorithms provide a sweet spot in design and verification complexity. To this end, we give an implementation of these algorithms in Erlang and derive a TLA+ specification. TLA+ is a formal language for describing and reasoning about distributed and concurrent systems and provides a model checker, TLC, among other things. Our study reveals interesting parallels between the Erlang and TLA+ code, while exposing the challenges of formally modeling communication and parallelism in distributed systems. Presenting selected aspects of our course design, we aim to motivate the feasibility and need for introducing verification in close correspondence to programming tasks.
用TLA+教学Erlang分布式算法的实训验证
分布式系统本质上是复杂的,因为它们需要处理通信、并发性和故障等特性之间的相互作用。由于这些交互功能的内在复杂性,通常不可能系统地测试这类系统;然而,意外的和不太可能的事件组合可能会导致难以发现的极端情况。但是,由于这些系统通常要长时间运行,因此这些事件最终可能会出现,必须正确处理。陷入这样的困境,学生们能够体验到应用验证工具来检查他们自己的算法和实现的好处。具有自动生成执行的可执行模型允许他们通过迭代地调整和改进算法来试验不同的解决方案。在这份经验报告中,我们报告了我们在分布式系统课程(动手)中教学验证的经验。我们认为广播算法在设计和验证复杂性方面提供了一个最佳点。为此,我们在Erlang中给出了这些算法的实现,并推导了TLA+规范。TLA+是一种用于描述和推理分布式和并发系统的正式语言,并提供了模型检查器TLC等功能。我们的研究揭示了Erlang和TLA+代码之间有趣的相似之处,同时也揭示了在分布式系统中形式化建模通信和并行性的挑战。介绍我们课程设计的选定方面,我们的目标是激发在编程任务中引入验证的可行性和必要性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信