Skip to main content
Log in

Precise slicing of concurrent programs

An Evaluation of static slicing algorithms for concurrent programs

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

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.

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.

Similar content being viewed by others

References

  • Bates, S., Horwitz, S.: Incremental program testing using program dependence graphs. In: Proc. POPL ’93, pp. 384–396. ACM, New York (1993)

    Chapter  Google Scholar 

  • 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 

  • Binkley, D., Harman, M., Krinke, J.: Empirical study of optimization techniques for massive slicing. ACM Trans. Program. Lang. Syst. 30(1), 3 (2007)

    Article  Google Scholar 

  • Chen, Z., Xu, B.: Slicing concurrent Java programs. ACM SIGPLAN Not. 36(4), 41–47 (2001)

    Article  Google Scholar 

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

  • Cheng, J.: Slicing concurrent programs. In: Automated and Algorithmic Debugging. Lecture Notes in Computer Science, vol. 749, pp. 223–240. Springer, Berlin (1993)

    Chapter  Google Scholar 

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

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

  • Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Addison Wesley, Reading (2005). http://java.sun.com/docs/books/jls/

    Google Scholar 

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

  • 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. http://digbib.ubka.uni-karlsruhe.de/volltexte/1000009849

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

    Chapter  Google Scholar 

  • Horwitz, S.B., Reps, T.W., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12(1), 26–60 (1990)

    Article  Google Scholar 

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

    Chapter  Google Scholar 

  • Krinke, J.: Static slicing of threaded programs. In: PASTE ’98, pp. 35–42 (1998)

  • Krinke, J.: Evaluating context-sensitive slicing and chopping. In: International Conference on Software Maintenance, pp. 22–31 (2002)

  • Krinke, J.: Context-sensitive slicing of concurrent programs. In: Proc. ESEC/FSE’03, pp. 178–187 (2003)

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

  • Nanda, M.G., Ramesh, S.: Slicing concurrent programs. In: ISSTA 2000, pp. 180–190 (2000)

  • Nanda, M.G., Ramesh, S.: Interprocedural slicing of multithreaded programs with applications to Java. ACM Toplas. 28(6), 1088–1144 (2006)

    Article  Google Scholar 

  • 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 

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

  • Ramalingam, G.: Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22(2), 416–430 (2000)

    Article  Google Scholar 

  • Ruf, E.: Effective synchronization removal for Java. In: Programming Language Design and Implementation (PLDI), pp. 208–218 (2000)

  • Sharir, M., Pnueli, A.: Two approaches to interprocedural data flow analysis. In: Program Flow Analysis: Theory and Applications (1981)

  • Sridharan, M., Fink, S., Bodik, R.: Thin slicing. ACM SIGPLAN Not. 42(6), 112–122 (2007)

    Article  Google Scholar 

  • Tip, F.: A survey of program slicing techniques. J. Program. Lang. 3(3), 121–189 (1995)

    Google Scholar 

  • Weiser, M.: Program slicing. IEEE Trans. Softw. Eng. 10(4), 352–357 (1984)

    Article  Google Scholar 

  • Zhao, J.: Slicing concurrent Java programs. In: Proceedings of the 7th IEEE International Workshop on Program Comprehension, pp. 126–133 (1999)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dennis Giffhorn.

Additional information

This is an extended version of previous work (Giffhorn and Hammer 2007).

Rights and permissions

Reprints and permissions

About this article

Cite this article

Giffhorn, D., Hammer, C. Precise slicing of concurrent programs. Autom Softw Eng 16, 197–234 (2009). https://doi.org/10.1007/s10515-009-0048-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10515-009-0048-x

Keywords

Navigation