Abstract
Testing concurrent programs that accept data inputs is notoriously hard because, besides the large number of possible data inputs, nondeterminism results in an exponentially large number of interleavings of concurrent events. In order to efficiently test shared-memory multi-threaded programs, we develop an algorithm based on race-detection and flipping and illustrate how it can be combined with concolic execution (a simultaneous symbolic and concrete execution method) to test multi-threaded programs with data inputs. The goal of our algorithm is to minimize redundant executions while ensuring that all reachable statements in a program are executed. To achieve this, our algorithm explores all distinct causal structures of a multi-threaded program (i.e., the partial order among events generated during an execution). Because our algorithm is based on race-detection, it enables us to report potential data races and deadlocks. We have implemented our algorithm in a tool called jCUTE. We describe the results of applying jCUTE to real-world multi-threaded Java applications and libraries. In particular, we discovered several undocumented potential concurrency-related bugs in the widely used Java collection framework distributed with the Sun Microsystems’ JDK 1.4.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Bruening, D.: Systematic testing of multithreaded Java programs. Master’s thesis, MIT (1999)
Carver, R.H., Lei, Y.: A general model for reachability testing of concurrent programs. In: Davies, J., Schulte, W., Barnett, M. (eds.) ICFEM 2004. LNCS, vol. 3308, pp. 76–98. Springer, Heidelberg (2004)
Corbett, J., et al.: Bandera: Extracting Finite-state Models from Java Source Code. In: Proc. of ICSE’00: International Conference on Software Engineering, Limerich, Ireland, June 2000, ACM Press, New York (2000)
Flanagan, C., Godefroid, P.: Dynamic partial-order reduction for model checking software. In: Proc. of the 32nd Symposium on Principles of Programming Languages (POPL’05), pp. 110–121 (2005)
Godefroid, P. (ed.): Partial-Order Methods for the Verification of Concurrent Systems. LNCS, vol. 1032. Springer, Heidelberg (1996)
Godefroid, P.: Model Checking for Programming Languages using VeriSoft. In: 24th ACM Symposium on Principles of Programming Languages, pp. 174–186. ACM Press, New York (1997)
Godefroid, P., Klarlund, N., Sen, K.: DART: Directed automated random testing. In: Proc. of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation (PLDI), ACM Press, New York (2005)
Khurshid, S., Pasareanu, C.S., Visser, W.: Generalized symbolic execution for model checking and testing. In: Garavel, H., Hatcliff, J. (eds.) ETAPS 2003 and TACAS 2003. LNCS, vol. 2619, pp. 553–568. Springer, Heidelberg (2003)
King, J.C.: Symbolic Execution and Program Testing. Communications of the ACM 19(7), 385–394 (1976)
Pasareanu, C.S., Dwyer, M.B., Visser, W.: Finding feasible abstract counter-examples. International Journal on Software Tools for Technology Transfer (STTT’03) 5(1), 34–48 (2003)
Peled, D.: All from one, one for all: on model checking using representatives. In: Courcoubetis, C. (ed.) CAV 1993. LNCS, vol. 697, pp. 409–423. Springer, Heidelberg (1993)
Sen, K.: Scalable Automated Methods for Dynamic Program Analysis. PhD thesis, University of Illinois at Urbana-Champaign (June 2006)
Sen, K., Agha, G.: Automated systematic testing of open distributed programs. In: Baresi, L., Heckel, R. (eds.) FASE 2006 and ETAPS 2006. LNCS, vol. 3922, Springer, Heidelberg (2006)
Sen, K., Agha, G.: CUTE and jCUTE. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, Springer, Heidelberg (2006)
Sen, K., Marinov, D., Agha, G.: CUTE: A concolic unit testing engine for C. In: 5th joint meeting of the European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE’05), ACM Press, New York (2005)
Sen, K., Roşu, G., Agha, G.: Runtime Safety Analysis of Multithreaded Programs. In: 9th European Software Engineering Conference and 11th ACM SIGSOFT International Symposium on the Foundations of Software Engineering (ESEC/FSE’03), pp. 337–346. ACM Press, New York (2003)
Sen, K., RoĹźu, G., Agha, G.: Online efficient predictive safety analysis of multithreaded programs. International Journal on Software Technology and Tools Transfer (2006)
Siegel, S.F., et al.: Using model checking with symbolic execution to verify parallel numerical programs. Technical Report UM-CS-2005-15, University of Massachusetts Department of Computer Science (2005)
Stoller, S.D.: Model-Checking Multi-Threaded Distributed Java Programs. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN Model Checking and Software Verification. LNCS, vol. 1885, pp. 224–244. Springer, Heidelberg (2000)
Valmari, A.: Stubborn sets for reduced state space generation. In: 10th Conference on Applications and Theory of Petri Nets, pp. 491–515 (1991)
Visser, W., Pasareanu, C., Khurshid, S.: Test Input Generation with Java PathFinder. In: Proceedings of ACM SIGSOFT ISSTA’04, pp. 97–107. ACM Press, New York (2004)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Sen, K., Agha, G. (2007). A Race-Detection and Flipping Algorithm for Automated Testing of Multi-threaded Programs. In: Bin, E., Ziv, A., Ur, S. (eds) Hardware and Software, Verification and Testing. HVC 2006. Lecture Notes in Computer Science, vol 4383. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-70889-6_13
Download citation
DOI: https://doi.org/10.1007/978-3-540-70889-6_13
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-70888-9
Online ISBN: 978-3-540-70889-6
eBook Packages: Computer ScienceComputer Science (R0)