A Scala library for testing student assignments on concurrent programming

M. Mayer, Ravichandhran Madhavan
{"title":"A Scala library for testing student assignments on concurrent programming","authors":"M. Mayer, Ravichandhran Madhavan","doi":"10.1145/2998392.2998395","DOIUrl":null,"url":null,"abstract":"We present a lightweight library for testing concurrent Scala programs by systematically exploring multiple interleavings between user-specified operations on shared objects. Our library is targeted at beginners of concurrent programming in Scala, runs on a standard JVM, and supports conventional synchronization primitives such as `wait`, `notify`, and `synchronized`. The key component of the library is the trait `SchedulableMonitor` that accepts a thread schedule, and interleaves as per the schedule all user-specified operations invoked through multiple threads on objects implementing the trait. Using our library, we developed a unit test engine that tests concurrent operations on shared objects on thousands of schedules obtained by bounding the number of context-switches. If a unit test fails on a schedule, the test engine offers as feedback the interleaved traces of execution that resulted in the failure. We used our test engine to automatically test and evaluate two assignments: (a) lock-based producer/consumer problem, and (b) lock-free sorted list implementation, offered to a class of 150 under-graduate students of EPFL. Our evaluations show that the system is effective in detecting bugs in students' solutions.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"40 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2998392.2998395","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

We present a lightweight library for testing concurrent Scala programs by systematically exploring multiple interleavings between user-specified operations on shared objects. Our library is targeted at beginners of concurrent programming in Scala, runs on a standard JVM, and supports conventional synchronization primitives such as `wait`, `notify`, and `synchronized`. The key component of the library is the trait `SchedulableMonitor` that accepts a thread schedule, and interleaves as per the schedule all user-specified operations invoked through multiple threads on objects implementing the trait. Using our library, we developed a unit test engine that tests concurrent operations on shared objects on thousands of schedules obtained by bounding the number of context-switches. If a unit test fails on a schedule, the test engine offers as feedback the interleaved traces of execution that resulted in the failure. We used our test engine to automatically test and evaluate two assignments: (a) lock-based producer/consumer problem, and (b) lock-free sorted list implementation, offered to a class of 150 under-graduate students of EPFL. Our evaluations show that the system is effective in detecting bugs in students' solutions.
一个用于测试学生并发编程作业的Scala库
我们提供了一个轻量级库,通过系统地探索共享对象上用户指定操作之间的多个交错,用于测试并发Scala程序。我们的库针对Scala并发编程的初学者,运行在标准JVM上,并支持传统的同步原语,如' wait ', ' notify '和' synchronized '。该库的关键组件是trait ' SchedulableMonitor ',它接受一个线程调度,并按照调度交织所有用户指定的操作,这些操作通过多个线程在实现该trait的对象上调用。使用我们的库,我们开发了一个单元测试引擎,该引擎在通过限制上下文切换的数量获得的数千个调度中测试共享对象上的并发操作。如果单元测试在计划中失败,测试引擎将提供导致失败的交错执行轨迹作为反馈。我们使用我们的测试引擎来自动测试和评估两个任务:(a)基于锁的生产者/消费者问题,(b)无锁排序列表实现,提供给一个150名EPFL本科生的班级。我们的评估表明,该系统在检测学生解决方案中的错误方面是有效的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信