MAP-Coverage: A Novel Coverage Criterion for Testing Thread-Safe Classes

Concurrent programs must be thoroughly tested, as concurrency bugs are notoriously hard to detect. Code coverage criteria can be used to quantify the richness of a test suite (e.g., whether a program has been tested sufficiently) or provide practical guidelines on test case generation (e.g., as objective functions used in program fuzzing engines). Traditional code coverage criteria are, however, designed for sequential programs and thus ineffective for concurrent programs. In this work, we introduce a novel code coverage criterion for testing thread-safe classes called MAP-coverage (short for memory-access patterns). The motivation is that concurrency bugs are often correlated with certain memory-access patterns, and thus it is desirable to comprehensively cover all memory-access patterns. Furthermore, we propose a testing method for maximizing MAP-coverage. Our method has been implemented as a self-contained toolkit, and the experimental results on 20 benchmark programs show that our toolkit outperforms existing testing methods. Lastly, we show empirically that there exists positive correlation between MAP-coverage and the effectiveness of a set of test executions.

[1]  Shan Lu,et al.  Efficient Detection of Thread Safety Violations via Coverage-Guided Generation of Concurrent Tests , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[2]  Serdar Tasiran,et al.  Precise Race Detection and Efficient Model Checking Using Locksets , 2006 .

[3]  Jun Sun,et al.  PFix: Fixing Concurrency Bugs Based on Memory Access Patterns , 2018, 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE).

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

[5]  Peter J. Keleher,et al.  Online data-race detection via coherency guarantees , 1996, OSDI '96.

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

[7]  Jun Sun,et al.  Towards Using Concurrent Java API Correctly , 2016, 2016 21st International Conference on Engineering of Complex Computer Systems (ICECCS).

[8]  Mauro Pezzè,et al.  A Survey of Recent Trends in Testing Concurrent Software Systems , 2018, IEEE Transactions on Software Engineering.

[9]  Dawson R. Engler,et al.  RacerX: effective, static detection of race conditions and deadlocks , 2003, SOSP '03.

[10]  Eitan Farchi,et al.  Applications of synchronization coverage , 2005, PPoPP.

[11]  Assaf Schuster,et al.  MultiRace: efficient on‐the‐fly data race detection in multithreaded C++ programs , 2007, Concurr. Comput. Pract. Exp..

[12]  Reid Holmes,et al.  Coverage is not strongly correlated with test suite effectiveness , 2014, ICSE.

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

[14]  Koushik Sen,et al.  A randomized dynamic program analysis technique for detecting real deadlocks , 2009, PLDI '09.

[15]  Richard W. Vuduc,et al.  A Unified Approach for Localizing Non-deadlock Concurrency Bugs , 2012, 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation.

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

[17]  Thomas R. Gross,et al.  Static conflict analysis for multi-threaded object-oriented programs , 2003, PLDI '03.

[18]  Ajitha Rajan,et al.  Coverage Metrics for Requirements-Based Testing: Evaluation of Effectiveness , 2010, NASA Formal Methods.

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

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

[21]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[22]  Koushik Sen,et al.  Randomized active atomicity violation detection in concurrent programs , 2008, SIGSOFT '08/FSE-16.

[23]  Koushik Sen,et al.  Race directed random testing of concurrent programs , 2008, PLDI '08.

[24]  Mark Lillibridge,et al.  Extended static checking for Java , 2002, PLDI '02.

[25]  M. Kendall A NEW MEASURE OF RANK CORRELATION , 1938 .

[26]  Jong-Deok Choi,et al.  Efficient and precise datarace detection for multithreaded object-oriented programs , 2002, PLDI '02.

[27]  Richard N. Taylor,et al.  Structural Testing of Concurrent Programs , 1992, IEEE Trans. Software Eng..

[28]  Xu Zhou,et al.  RaceChecker: Efficient Identification of Harmful Data Races , 2015, 2015 23rd Euromicro International Conference on Parallel, Distributed, and Network-Based Processing.

[29]  K. Pearson NOTES ON THE HISTORY OF CORRELATION , 1920 .

[30]  Hiroyasu Nishiyama,et al.  Detecting Data Races Using Dynamic Escape Analysis Based on Read Barrier , 2004, Virtual Machine Research and Technology Symposium.

[31]  Alex Groce,et al.  Guidelines for Coverage-Based Comparisons of Non-Adequate Test Suites , 2015, ACM Trans. Softw. Eng. Methodol..

[32]  Koushik Sen,et al.  Effective random testing of concurrent programs , 2007, ASE.

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

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

[35]  Serdar Tasiran,et al.  Goldilocks: a race and transaction-aware java runtime , 2007, PLDI '07.

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

[37]  Thomas R. Gross,et al.  Object race detection , 2001, OOPSLA '01.

[38]  Shing-Chi Cheung,et al.  Coverage-Driven Test Code Generation for Concurrent Classes , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[39]  Tomás Vojnar,et al.  Coverage Metrics for Saturation-Based and Search-Based Testing of Concurrent Software , 2011, RV.

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

[41]  Hong Zhu,et al.  Software unit test coverage and adequacy , 1997, ACM Comput. Surv..

[42]  W. Holtzman Fundamental statistics in psychology and education. , 1951 .

[43]  Jeff Huang,et al.  Debugging Concurrent Software: Advances and Challenges , 2016, Journal of Computer Science and Technology.

[44]  Pravesh Kothari,et al.  A randomized scheduler with probabilistic guarantees of finding bugs , 2010, ASPLOS XV.