Coverage-Driven Test Code Generation for Concurrent Classes

Previous techniques on concurrency testing have mainly focused on exploring the interleaving space of manually written test code to expose faulty interleavings of shared memory accesses. These techniques assume the availability of failure-inducing tests. In this paper, we present AutoConTest, a coverage-driven approach to generate effective concurrent test code that achieve high interleaving coverage. AutoConTest consists of three components. First, it computes the coverage requirements dynamically and iteratively during sequential test code generation, using a coverage metric that captures the execution context of shared memory accesses. Second, it smartly selects these sequential codes based on the computed result and assembles them for concurrent tests, achieving increased context-sensitive interleaving coverage. Third, it explores the newly covered interleavings. We have implemented AutoConTest as an automated tool and evaluated it using 6 real-world concurrent Java subjects. The results show that AutoConTest is able to generate effective concurrent tests that achieve high interleaving coverage and expose concurrency faults quickly. AutoConTest took less than 65 seconds (including program analysis, test generation and execution) to expose the faults in the program subjects.

[1]  Gordon Fraser,et al.  Whole Test Suite Generation , 2013, IEEE Transactions on Software Engineering.

[2]  Gordon Fraser,et al.  EvoSuite: automatic test suite generation for object-oriented software , 2011, ESEC/FSE '11.

[3]  Gordon Fraser,et al.  Generating Unit Tests for Concurrent Classes , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[4]  Yannis Smaragdakis,et al.  JCrasher: an automatic robustness tester for Java , 2004, Softw. Pract. Exp..

[5]  Vineet Kahlon,et al.  Concurrent Test Generation Using Concolic Multi-trace Analysis , 2012, APLAS.

[6]  Lori L. Pollock,et al.  All-du-path coverage for parallel programs , 1998, ISSTA '98.

[7]  James C. King,et al.  Symbolic execution and program testing , 1976, CACM.

[8]  Koushik Sen,et al.  DART: directed automated random testing , 2005, PLDI '05.

[9]  Yuanyuan Zhou,et al.  Finding Atomicity-Violation Bugs through Unserializable Interleaving Testing , 2012, IEEE Transactions on Software Engineering.

[10]  David Notkin,et al.  Rostra: a framework for detecting redundant object-oriented unit tests , 2004, Proceedings. 19th International Conference on Automated Software Engineering, 2004..

[11]  Michael D. Ernst,et al.  Improving test suites via operational abstraction , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[12]  Murali Krishna Ramanathan,et al.  Multithreaded test synthesis for deadlock detection , 2014, OOPSLA.

[13]  References , 1971 .

[14]  Koushik Sen,et al.  Detecting Errors in Multithreaded Programs by Generalized Predictive Analysis of Executions , 2005, FMOODS.

[15]  Michael D. Ernst,et al.  Feedback-Directed Random Test Generation , 2007, 29th International Conference on Software Engineering (ICSE'07).

[16]  Matthew B. Dwyer,et al.  Saturation-based testing of concurrent programs , 2009, ESEC/FSE '09.

[17]  Jeff Huang,et al.  Persuasive prediction of concurrency access anomalies , 2011, ISSTA '11.

[18]  Murali Krishna Ramanathan,et al.  Omen: a tool for synthesizing tests for deadlock detection , 2014, SPLASH '14.

[19]  Yuanyuan Zhou,et al.  CTrigger: exposing atomicity violation bugs from their hiding places , 2009, ASPLOS.

[20]  Rupak Majumdar,et al.  Hybrid Concolic Testing , 2007, 29th International Conference on Software Engineering (ICSE'07).

[21]  Sebastian Burckhardt,et al.  Line-up: a complete and automatic linearizability checker , 2010, PLDI '10.

[22]  Serdar Tasiran,et al.  Location pairs: a test coverage metric for shared-memory concurrent programs , 2011, Empirical Software Engineering.

[23]  Paolo Tonella,et al.  Evolutionary testing of classes , 2004, ISSTA '04.

[24]  Yu Lin,et al.  CHECK-THEN-ACT Misuse of Java Concurrent Collections , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[25]  Satish Narayanasamy,et al.  Maple: a coverage-driven testing tool for multithreaded programs , 2012, OOPSLA '12.

[26]  Shan Lu,et al.  A study of interleaving coverage criteria , 2007, ESEC-FSE companion '07.

[27]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multithreaded programs , 1997, TOCS.

[28]  Gordon Fraser,et al.  CrowdOracles: Can the Crowd Solve the Oracle Problem? , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[29]  Nikolai Tillmann,et al.  Pex-White Box Test Generation for .NET , 2008, TAP.

[30]  G. Ramalingam,et al.  Context-sensitive synchronization-sensitive analysis is undecidable , 2000, TOPL.

[31]  Stephen N. Freund,et al.  FastTrack: efficient and precise dynamic race detection , 2009, PLDI '09.

[32]  Michael D. Ernst,et al.  Finding the needles in the haystack: Generating legal test inputs for object-oriented programs , 2006 .

[33]  Yuanyuan Zhou,et al.  Bug characteristics in open source software , 2013, Empirical Software Engineering.

[34]  Chao Wang,et al.  Coverage guided systematic concurrency testing , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[35]  Sarfraz Khurshid,et al.  Korat: automated testing based on Java predicates , 2002, ISSTA '02.

[36]  Thomas R. Gross,et al.  FULLY AUTOMATIC AND PRECISE DETECTION OF THREAD SAFETY VIOLATIONS PLDI 2012 , 2013 .

[37]  Koushik Sen,et al.  A Race-Detection and Flipping Algorithm for Automated Testing of Multi-threaded Programs , 2006, Haifa Verification Conference.

[38]  Danny Dig,et al.  How do developers use parallel libraries? , 2012, SIGSOFT FSE.

[39]  Yuanyuan Zhou,et al.  Have things changed now?: an empirical study of bug characteristics in modern open source software , 2006, ASID '06.

[40]  Gordon Fraser,et al.  Does automated white-box test generation really help software testers? , 2013, ISSTA.

[41]  Yuanyuan Zhou,et al.  Learning from mistakes: a comprehensive study on real world concurrency bug characteristics , 2008, ASPLOS.

[42]  Gordon Fraser,et al.  Redundancy Based Test-Suite Reduction , 2007, FASE.

[43]  David Holmes,et al.  Java Concurrency in Practice , 2006 .

[44]  Frank Tip,et al.  Associating synchronization constraints with data in an object-oriented language , 2006, POPL '06.

[45]  Gregg Rothermel,et al.  An empirical comparison of the fault-detection capabilities of internal oracles , 2013, 2013 IEEE 24th International Symposium on Software Reliability Engineering (ISSRE).

[46]  Thomas R. Gross,et al.  Ballerina: Automatic generation and clustering of efficient random unit tests for multithreaded code , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[47]  Suresh Jagannathan,et al.  Synthesizing racy tests , 2015, PLDI.

[48]  Alessandra Gorla,et al.  Cross-checking oracles from intrinsic software redundancy , 2014, ICSE.

[49]  Corina S. Pasareanu,et al.  Test input generation for java containers using state matching , 2006, ISSTA '06.

[50]  Chao Wang,et al.  Predicting Concurrency Failures in the Generalized Execution Traces of x86 Executables , 2011, RV.

[51]  Francesco Sorrentino,et al.  PENELOPE: weaving threads to expose atomicity violations , 2010, FSE '10.

[52]  Shing-Chi Cheung,et al.  Detecting atomic-set serializability violations in multithreaded programs through active randomized testing , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[53]  Charles Zhang,et al.  Finding incorrect compositions of atomicity , 2013, ESEC/FSE 2013.

[54]  Murali Krishna Ramanathan,et al.  Omen+: a precise dynamic deadlock detector for multithreaded Java libraries , 2014, SIGSOFT FSE.

[55]  Koushik Sen,et al.  CUTE and jCUTE: Concolic Unit Testing and Explicit Path Model-Checking Tools , 2006, CAV.

[56]  Shin Hong,et al.  Testing concurrent programs to achieve high synchronization coverage , 2012, ISSTA 2012.

[57]  Thomas Ball,et al.  Finding and Reproducing Heisenbugs in Concurrent Programs , 2008, OSDI.

[58]  Sarfraz Khurshid,et al.  TestEra: a novel framework for automated testing of Java programs , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[59]  Helmut Veith,et al.  Con2colic testing , 2013, ESEC/FSE 2013.

[60]  Stephen N. Freund,et al.  Atomizer: a dynamic atomicity checker for multithreaded programs , 2004, 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings..