Skip to main content
Log in

Automatic Generation of Unit Tests for Correlated Variables in Parallel Programs

  • Published:
International Journal of Parallel Programming Aims and scope Submit manuscript

Abstract

A notorious class of concurrency bugs are race condition related to correlated variables, which make up about 30 % of all non-deadlock concurrency bugs. A solution to prevent this problem is the automatic generation of parallel unit tests. This paper presents an approach to generate parallel unit tests for variable correlations in multithreaded code. We introduce a hybrid approach for identifying correlated variables. Furthermore, we estimate the number of potentially violated correlations for methods executed in parallel. In this way, we are capable of creating unit tests that are suited for race detectors considering correlated variables. We were able to identify more than 85 % of all race conditions on correlated variables in eight applications after applying our parallel unit tests. At the same time, we reduced the number of unnecessary generated unit tests. In comparison to a test generator unaware of variable correlations, redundant unit tests are reduced by up to 50 %, while maintaining the same precision and accuracy in terms of the number of detected races.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

Similar content being viewed by others

References

  1. Lu, S., Park, S., Seo, E., Zhou, Y.: Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In: ASPLOS XIII: Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 329–339. ACM, New York, NY (2008)

  2. Schimmel, J., Molitorisz, K., Jannesari, A., Tichy, W.F.: Automatic generation of parallel unit tests. In: 8th IEEE/ACM International Workshop on Automation of Software Test (AST) (2013)

  3. Jannesari, A., Westphal-Furuya, M., Tichy, W.F.: Dynamic data race detection for correlated variables. In: Proceedings of the 11th International Conference on Algorithms and Architectures for Parallel Processing, vol. Part I. ICA3PP’11, pp. 14–26. Springer, Berlin (2011)

  4. Lu, S., Park, S., Hu, C., Ma, X., Jiang, W., Li, Z., Popa, R.A., Zhou, Y.: MUVI: automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In: SOSP ’07: Proceedings of Twenty-First ACM SIGOPS Symposium on Operating Systems Principles, pp. 103–116. ACM, New York, NY (2007)

  5. Jannesari, A., Tichy, W.F.: Library-independent data race detection. IEEE Transactions on Parallel and Distributed Systems (TPDS), pp. 1–11 (2013)

  6. Jannesari, A., Tichy, W.F.: Identifying ad-hoc synchronization for enhanced race detection. In: IEEE International Symposium on Parallel Distributed Processing (IPDPS), pp. 1–10 (2010)

  7. Jannesari, A., Bao, K., Pankratius, V., Tichy, W.F.: Helgrind+: an efficient dynamic race detector. In: IEEE International Symposium on Parallel Distributed Processing (IPDPS), pp. 1–13 (2009)

  8. Jannesari, A., Tichy, W.F.: On-the-fly race detection in multi-threaded programs. In: Proceedings of the 6th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging. PADTAD ’08, pp. 6:1–6:10. ACM, New York, NY (2008)

  9. Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. Sigplan Not. 42, 89–100 (2007)

    Article  Google Scholar 

  10. Luo, Q., Zhang, S., Zhao, J., Hu, M.: A lightweight and portable approach to making concurrent failures reproducible. In: Proceedings of the 13th International Conference on Fundamental Approaches to Software Engineering. FASE’10, pp. 323–337. Springer, Berlin (2010)

  11. Katayama, T., Itoh, E., Ushijima, K., Furukawa, Z.: Test-case generation for concurrent programs with the testing criteria using interaction sequences. In: Proceedings of the Sixth Asia Pacific Software Engineering Conference (APSEC ’99). IEEE Computer Society, Washington, DC (1999)

  12. Wong, W.E., Lei, Y., Ma, Y.: Effective generation of test sequences for structural testing of concurrent programs. In: 10th IEEE International Conference on Engineering of Complex Computer Systems (ICECCS 2005), pp. 539–548. IEEE Computer Society, Richardson, TX (2005)

  13. Nistor, A., Luo, Q., Pradel, M., Gross, T.R., Marinov, D.: Ballerina: automatic generation and clustering of efficient random unit tests for multithreaded code. In: Proceedings of the 2012 International Conference on Software Engineering (ICSE 2012), pp. 727–737. IEEE Press, Piscataway, NJ (2012)

  14. Cooper, K.D., Harvey, T.J., Kennedy, K.: A Simple, Fast Dominance Algorithm. Technical Report TR06-38870, Computer Science Department, Rice University, Houston, TX (2006)

  15. Musuvathi, M., Qadeer, S.: Chess: systematic stress testing of concurrent software. In: Puebla, G. (ed.) Logic-Based Program Synthesis and Transformation. Lecture Notes in Computer Science, vol. 4407, pp. 15–16. Springer, Berlin (2007)

    Chapter  Google Scholar 

  16. Musuvathi, M., Qadeer, S., Ball, T., Basler, G., Nainar, P.A., Neamtiu, I.: Finding and reproducing heisenbugs in concurrent programs. In: Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation. OSDI’08, pp. 267–280. USENIX Association, Berkeley, CA (2008)

  17. Microsoft Code gallery for parallel programs. http://code.msdn.microsoft.com/Samples-for-Parallel-b4b76364

  18. Butler, N.: Petridish: multi-threading for performance in c#. http://www.codeproject.com/Articles/26453/

  19. Reichl, D.: Keepass password safe. http://keepass.info/

  20. Smart thread pool. http://smartthreadpool.codeplex.com/

  21. Xu, M., Bodík, R., Hill, M.D.: A serializability violation detector for shared-memory server programs. Sigplan Not. 40, 1–14 (2005)

    Google Scholar 

  22. Vaziri, M., Tip, F., Dolby, J.: Associating synchronization constraints with data in an object-oriented language. In: POPL ’06: Conference Record of the 33rd ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages, pp. 334–345. ACM, New York, NY (2006)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ali Jannesari.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Jannesari, A., Wolf, F. Automatic Generation of Unit Tests for Correlated Variables in Parallel Programs. Int J Parallel Prog 44, 644–662 (2016). https://doi.org/10.1007/s10766-015-0363-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10766-015-0363-8

Keywords

Navigation