A Scala Library for Testing Student Assignments on Concurrent Programming

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.


Editor(s):
Biboudis, A
Jonnalagedda, M
Stucki, S
Ureche, V
Published in:
Scala'16: Proceedings Of The 2016 7Th Acm Sigplan Symposium On Scala, 1-10
Presented at:
7th ACM SIGPLAN Symposium on Scala, Amsterdam, NETHERLANDS, OCT 30-31, 2016
Year:
2016
Publisher:
New York, Assoc Computing Machinery
ISBN:
978-1-4503-4648-1
Keywords:
Laboratories:




 Record created 2017-01-24, last modified 2018-03-17


Rate this document:

Rate this document:
1
2
3
 
(Not yet reviewed)