Abstract
Multicore and multi-threaded processors have become the norm for modern processors. Accordingly, concurrent programs have become more and more prevalent despite being difficult to write and understand. Although errors are highly likely to appear in concurrent code, conventional error detection methods such as model checking, theorem proving, and code analysis do not scale smoothly to concurrent programs. Testing is an indispensable technique for detecting concurrency errors, but it involves a great deal of manual work and is inefficient. This paper presents an automatic method for detecting concurrency errors in classes in object-oriented languages. The method uses a heuristic algorithm to automatically generate test cases that can effectively trigger errors. Then, each test case is executed automatically and a fast method is adopted to identify the actual concurrency error from anomalous run results. We have implemented a prototype of the method and applied it to some typical Java classes. Evaluation shows that our method is more effective and faster than previous work.
Similar content being viewed by others
References
Godefroid P, Nagappan N. Concurrency at Microsoft: an exploratory survey. In: Workshop on Exploiting Concurrency Efficiently and Correctly, Princeton, 2008
Poulsen K. Tracking the blackout bug Security Focus. 2004-04-07. http://www.securityfocus.com/news/8412
Leveson N G. SafeWare: System Safety and Computers. Boston: Addison-Wesley Professional, 1995
McDowell C E, Helmbold D P. Debugging concurrent programs. ACM Comput Surv, 1989, 4: 593–622
Musuvathi M, Qadeer S. Iterative context bounding for systematic testing of multithreaded programs. ACM SIGPLAN Not, 2007, 6: 446–455
Flanagan C, Freund S. FastTrack: efficient and precise dynamic race detection. ACM SIGPLAN Not, 2009, 44: 121–133
Park S, Vuduc R W, Harrold M J. Falcon: fault localization in concurrent programs. In: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering, Cape Town, 2010. 245–254
Park S, Lu S, Zhou Y. CTrigger: exposing atomicity violation bugs from their hiding places. ACM SIGPLAN Not, 2009, 44: 25–36
Burckhardt S, Kothari P, Musuvathi M, et al. A randomized scheduler with probabilistic guarantees of finding bugs. ACM SIGPLAN Not, 2010, 45: 167–178
Coons K E, Burckhardt S, Musuvathi M. GAMBIT: effective unit testing for concurrency libraries. ACM SIGPLAN Not, 2010, 45: 15–24
Pradel M, Gross T R. Fully automatic and precise detection of thread safety violations. ACM SIGPLAN Not, 2012, 47: 521–530
Schildt H. Java 7 the Complete Reference. 8th Ed. New York: Mc-Graw Hill, 2011
Lu S, Park S, Seo E, et al. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. ACM SIGPLAN Not, 2008, 43: 329–339
Shacham O, Bronson N, Aiken A, et al. Testing atomicity of composed concurrent operations. ACM SIGPLAN Not, 2011, 46: 51–64
Nistor A, Luo Q, Pradel M, et al. Ballerina: automatic generation and clustering of efficient random unit tests for multithreaded code. In: ICSE 2012 Proceedings of the 2012 International Conference on Software Engineering, Piscataway, 2012. 727–737
Marino D, Musuvathi M, Narayanasamy S. LiteRace: effective sampling for lightweight data-race detection. ACM SIGPLAN Not, 2009, 44: 134–143
Praun C V, Gross T R. Object race detection. ACM SIGPLAN Not, 2001, 36: 70–82
Callahan R O, Choi J D. Hybrid dynamic data race detection. ACM SIGPLAN Not, 2003, 38: 167–178
Flanagan C, Freund S N, Yi J. Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. ACM SIGPLAN Not, 2008, 43: 293–303
Lu S. Finding atomicity-violation bugs through unserializable interleaving testing. IEEE Trans Softw Eng, 2012, 38: 844–860
Naik M, Park C S, Sen K, et al. Effective static deadlock detection. In: ICSE’ 09 Proceedings of the 31st International Conference on Software Engineering, Vancouver, 2009. 386–396
Joshi S, Lahiri S K, Lal A. Underspecified harnesses and interleaved bugs. ACM SIGPLAN Not, 2012, 47: 19–30
Herlihy M, Wing J M. Linearizability: a correctness condition for concurrent objects. ACM Trans Program Lang Syst, 1990, 12: 463–492
Burckhardt S, Dern C, Musuvathi M, et al. Line-Up: a complete and automatic linearizability checker. ACM SIGPLAN Not, 2010, 45: 330–340
Godefroid P, Klarlund N, Sen K. DART: directed automated random testing. ACM SIGPLAN Not, 2005, 40: 213–223
Pacheco C, Lahiri S K, Ernst M D, et al. Feedback-directed random test generation. In: ICSE’ 07 Proceedings of the 29th international conference on Software Engineering, Minneapolis, 2007. 75–84
Krishnamoorthy S, Hsiao M S, Lingappan L. Strategies for scalable symbolic execution-driven test generation for programs. Sci China Inf Sci, 2011, 54: 1797–1812
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
He, Y., Wu, W. & Chen, Y. An efficient method for detecting concurrency errors in object-oriented programs. Sci. China Inf. Sci. 55, 2774–2784 (2012). https://doi.org/10.1007/s11432-012-4751-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11432-012-4751-z