DocumentCode
2442352
Title
Ballerina: Automatic generation and clustering of efficient random unit tests for multithreaded code
Author
Nistor, Adrian ; Luo, Qingzhou ; Pradel, Michael ; Gross, Thomas R. ; Marinov, Darko
Author_Institution
Dept. of Comput. Sci., Univ. of Illinois at Urbana-Champaign, Urbana, IL, USA
fYear
2012
fDate
2-9 June 2012
Firstpage
727
Lastpage
737
Abstract
Testing multithreaded code is hard and expensive. A multithreaded unit test creates two or more threads, each executing one or more methods on shared objects of the class under test. Such unit tests can be generated at random, but basic random generation produces tests that are either slow or do not trigger concurrency bugs. Worse, such tests have many false alarms, which require human effort to filter out. We present Ballerina, a novel technique for automated random generation of efficient multithreaded tests that effectively trigger concurrency bugs. Ballerina makes tests efficient by having only two threads, each executing a single, randomly selected method. Ballerina increases chances that such simple parallel code finds bugs by appending it to more complex, randomly generated sequential code. We also propose a clustering technique to reduce the manual effort in inspecting failures of automatically generated multithreaded tests. We evaluate Ballerina on 14 real-world bugs from six popular codebases: Groovy, JDK, JFreeChart, Apache Log4j, Apache Lucene, and Apache Pool. The experiments show that tests generated by Ballerina find bugs on average 2×-10× faster than basic random generation, and our clustering technique reduces the number of inspected failures on average 4×-8×. Using Ballerina, we found three previously unknown bugs, two of which were already confirmed and fixed.
Keywords
multi-threading; pattern clustering; program compilers; program debugging; program testing; Apache Log4j codebase; Apache Lucene codebase; Apache Pool codebase; Ballerina; Groovy codebase; JDK codebase; JFreeChart codebase; concurrency bugs; multithreaded code testing; multithreaded unit test; random unit tests automatic generation; random unit tests clustering; sequential code random generation; Computer bugs; Concurrent computing; Inspection; Instruction sets; Receivers; Testing;
fLanguage
English
Publisher
ieee
Conference_Titel
Software Engineering (ICSE), 2012 34th International Conference on
Conference_Location
Zurich
ISSN
0270-5257
Print_ISBN
978-1-4673-1066-6
Electronic_ISBN
0270-5257
Type
conf
DOI
10.1109/ICSE.2012.6227145
Filename
6227145
Link To Document