Skip to main content

A Race-Detection and Flipping Algorithm for Automated Testing of Multi-threaded Programs

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4383))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bruening, D.: Systematic testing of multithreaded Java programs. Master’s thesis, MIT (1999)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. Godefroid, P. (ed.): Partial-Order Methods for the Verification of Concurrent Systems. LNCS, vol. 1032. Springer, Heidelberg (1996)

    Google Scholar 

  6. 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)

    Chapter  Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. King, J.C.: Symbolic Execution and Program Testing. Communications of the ACM 19(7), 385–394 (1976)

    Article  MATH  Google Scholar 

  10. 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)

    Article  Google Scholar 

  11. 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)

    Google Scholar 

  12. Sen, K.: Scalable Automated Methods for Dynamic Program Analysis. PhD thesis, University of Illinois at Urbana-Champaign (June 2006)

    Google Scholar 

  13. 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)

    Chapter  Google Scholar 

  14. Sen, K., Agha, G.: CUTE and jCUTE. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, Springer, Heidelberg (2006)

    Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Chapter  Google Scholar 

  17. Sen, K., Roşu, G., Agha, G.: Online efficient predictive safety analysis of multithreaded programs. International Journal on Software Technology and Tools Transfer (2006)

    Google Scholar 

  18. 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)

    Google Scholar 

  19. 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)

    Chapter  Google Scholar 

  20. Valmari, A.: Stubborn sets for reduced state space generation. In: 10th Conference on Applications and Theory of Petri Nets, pp. 491–515 (1991)

    Google Scholar 

  21. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Eyal Bin Avi Ziv Shmuel Ur

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics