Precise slicing of concurrent programs

An Evaluation of static slicing algorithms for concurrent programs


While there exist efficient algorithms to slice sequential programs precisely, there are only two algorithms for precise slicing of concurrent interprocedural programs with recursive procedures (Krinke in Proc. ESEC/FSE’03, pp. 178–187, 2003; Nanda and Ramesh in ACM Toplas. 28(6):1088–1144, 2006). We present an empirical evaluation of both algorithms for Java. We demonstrate that both algorithms provide the same precision up to the model of concurrency in use and show that the concurrency model has strong impact on slice precision and computation costs. Furthermore, we extend both algorithms to support dynamic thread creation both in loops and recursion—a feature that the original algorithms could not fully handle. The worst case complexity of the algorithms being exponential, we developed several optimizations and compared these with each other and with algorithms that trade precision for speed. Finally, we show that one algorithm may produce incorrect slices and present a remedy.


Slicing Program analysis Concurrency Threads 


  1. Bates, S., Horwitz, S.: Incremental program testing using program dependence graphs. In: Proc. POPL ’93, pp. 384–396. ACM, New York (1993) CrossRefGoogle Scholar
  2. Binkley, D., Harman, M.: A survey of empirical results on program slicing. In: Zelkowitz, M. (ed.) Advances in Computers, vol. 62, pp. 105–178. Academic Press, San Diego (2004) Google Scholar
  3. Binkley, D., Harman, M., Krinke, J.: Empirical study of optimization techniques for massive slicing. ACM Trans. Program. Lang. Syst. 30(1), 3 (2007) CrossRefGoogle Scholar
  4. Chen, Z., Xu, B.: Slicing concurrent Java programs. ACM SIGPLAN Not. 36(4), 41–47 (2001) CrossRefGoogle Scholar
  5. Chen, Z., Xu, B., Yang, H., Liu, K., Zhang, J.: An approach to analyzing dependency of concurrent programs. In: APAQS ’00: Proceedings of the First Asia-Pacific Conference on Quality Software, pp. 39–43 (2000) Google Scholar
  6. Cheng, J.: Slicing concurrent programs. In: Automated and Algorithmic Debugging. Lecture Notes in Computer Science, vol. 749, pp. 223–240. Springer, Berlin (1993) CrossRefGoogle Scholar
  7. Cheng, J.: Dependence analysis of parallel and distributed programs and its applications. In: International Conference on Advances in Parallel and Distributed Computing, pp. 395–404 (1997) Google Scholar
  8. Giffhorn, D., Hammer, C.: An evaluation of slicing algorithms for concurrent programs. In: 7th IEEE Int. Work. Conf. on Source Code Analysis and Manipulation, pp. 17–26 (2007) Google Scholar
  9. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Addison Wesley, Reading (2005). Google Scholar
  10. Hammer, C., Snelting, G.: An improved slicer for Java. In: Workshop on Program Analysis for Software Tools and Engineering (PASTE’04), pp. 17–22 (2004) Google Scholar
  11. Hammer, C., Snelting, G.: Flow sensitive, context sensitive, and object sensitive information flow control based on program dependence graphs. Technical Report 2008-16, November 2008, Fakultät für Informatik, Universität Karlsruhe (TH), Germany.
  12. Hatcliff, J., Corbett, J.C., Dwyer, M.B., Sokolowski, S., Zheng, H.: A formal study of slicing for multi-threaded programs with JVM primitives. In: Static Analysis Symposium. Lecture Notes in Computer Science, vol. 1694, pp. 1–18. Springer, Berlin (1999) CrossRefGoogle Scholar
  13. Horwitz, S.B., Reps, T.W., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12(1), 26–60 (1990) CrossRefGoogle Scholar
  14. Kamkar, M., Shahmehri, N., Fritzson, P.: Bug localization by algorithmic debugging and program slicing. In: Proceedings of International Workshop on Programming Language Implementation and Logic Programming. Lecture Notes in Computer Science, vol. 456, pp. 60–74. Springer, Berlin (1990) CrossRefGoogle Scholar
  15. Krinke, J.: Static slicing of threaded programs. In: PASTE ’98, pp. 35–42 (1998) Google Scholar
  16. Krinke, J.: Evaluating context-sensitive slicing and chopping. In: International Conference on Software Maintenance, pp. 22–31 (2002) Google Scholar
  17. Krinke, J.: Context-sensitive slicing of concurrent programs. In: Proc. ESEC/FSE’03, pp. 178–187 (2003) Google Scholar
  18. Müller-Olm, M., Seidl, H.: On optimal slicing of parallel programs. In: STOC 2001 (33th ACM Symposium on Theory of Computing), pp. 647–656 (2001) Google Scholar
  19. Nanda, M.G., Ramesh, S.: Slicing concurrent programs. In: ISSTA 2000, pp. 180–190 (2000) Google Scholar
  20. Nanda, M.G., Ramesh, S.: Interprocedural slicing of multithreaded programs with applications to Java. ACM Toplas. 28(6), 1088–1144 (2006) CrossRefGoogle Scholar
  21. Naumovich, G., Avrunin, G.S., Clarke, L.A.: An efficient algorithm for computing MHP information for concurrent Java programs. In: Proc. ESEC/FSE ’99, pp. 338–354. Springer, Berlin (1999) Google Scholar
  22. Ottenstein, K.J., Ottenstein, L.M.: The program dependence graph in a software development environment. In: ACM Symposium on Practical Software Development Environments, pp. 177–184 (1984) Google Scholar
  23. Ramalingam, G.: Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22(2), 416–430 (2000) CrossRefGoogle Scholar
  24. Ruf, E.: Effective synchronization removal for Java. In: Programming Language Design and Implementation (PLDI), pp. 208–218 (2000) Google Scholar
  25. Sharir, M., Pnueli, A.: Two approaches to interprocedural data flow analysis. In: Program Flow Analysis: Theory and Applications (1981) Google Scholar
  26. Sridharan, M., Fink, S., Bodik, R.: Thin slicing. ACM SIGPLAN Not. 42(6), 112–122 (2007) CrossRefGoogle Scholar
  27. Tip, F.: A survey of program slicing techniques. J. Program. Lang. 3(3), 121–189 (1995) Google Scholar
  28. Weiser, M.: Program slicing. IEEE Trans. Softw. Eng. 10(4), 352–357 (1984) CrossRefGoogle Scholar
  29. Zhao, J.: Slicing concurrent Java programs. In: Proceedings of the 7th IEEE International Workshop on Program Comprehension, pp. 126–133 (1999) Google Scholar

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  1. 1.Universität Karlsruhe (TH)KarlsruheGermany

Personalised recommendations