Bita: Coverage-guided, automatic testing of actor programs

Samira Tasharofi, Michael Pradel, Yu Lin, Ralph Johnson
2013 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE)  
Actor programs are concurrent programs where concurrent entities communicate asynchronously by exchanging messages. Testing actor programs is challenging because the order of message receives depends on the non-deterministic scheduler and because exploring all schedules does not scale to large programs. This paper presents Bita, a scalable, automatic approach for testing non-deterministic behavior of actor programs. The key idea is to generate and explore schedules that are likely to reveal
more » ... ikely to reveal concurrency bugs because these schedules increase the schedule coverage. We present three schedule coverage criteria for actor programs, an algorithm to generate feasible schedules that increase coverage, and a technique to force a program to comply with a schedule. Applying Bita to real-world actor programs implemented in Scala reveals eight previously unknown concurrency bugs, of which six have already been fixed by the developers. Furthermore, we show our approach to find bugs 122x faster than random scheduling, on average. 1 Bita in Persian means "unique". 1 class Writer extends Actor { 2 var results = ArrayBuffer[String]() 3 def receive() = { // called when a message is removed from the mail box 4 case Write(result:String) => // if the message is Write(result) 5 results.append(result) 6 case Flush => { // if the message is Flush 7 writeToExternal(results) // write the results into the external storage 8 results = null 9 sender ! Flushed // send message Flushed to the sender 10
doi:10.1109/ase.2013.6693072 dblp:conf/kbse/TasharofiPLJ13 fatcat:dsp3r27qnrclzalmjjoyurcrju