Abstract
Slicing is a well-known program reduction technique where for a given program P and a variable of interest v at some statement P in the program, a program slice contains those set of statements belonging to P that affect v. This article presents two algorithms for interprocedural slicing of concurrent programs--a context-insensitive algorithm and a context-sensitive algorithm. The context-insensitive algorithm is efficient and correct (it includes every statement that may affect the slicing criterion) but is imprecise since it may include certain extra statements that are unnecessary. Precise slicing has been shown to be undecidable for concurrent programs. However, the context-sensitive algorithm computes correct and reasonably precise slices, but has a worst-case exponential-time complexity. Our context-sensitive algorithm computes a closure of dependencies while ensuring that statements sliced in each thread belong to a realizable path in that thread.A realizable path in a thread with procedure calls is one that reflects the fact that when a procedure finishes, execution returns to the site of the most recently executed call in that thread. One of the novelties of this article is a practical solution to determine whether a given set of statements in a thread may belong to a realizable path. This solution is precise even in the presence of recursion and long call chains in the flow graph.The slicing algorithms are applicable to concurrent programs with shared memory, interleaving semantics, explicit wait/notify synchronization and monitors. We first give a solution for a simple model of concurrency and later show how to extend the solution to the Java concurrency model. We have implemented the algorithms for Java bytecode and give experimental results.
- Agrawal, H., Demillo, R., and Spafford, E. 1993. Debugging with dynamic slicing and backtracking. Softw.---Pract. Exper. 23, 6, 589--616.]] Google Scholar
- Aho, A., Sethi, R., and Ullman, J. 1986. Compilers: Principles, Techniques and Tools. Addison-Wesley, Reading, MA.]] Google Scholar
- Beck, J. and Eichmann, D. 1993. Program and interface slicing for reverse engineering. In Proceedings of the 15th International Conference on Software Engineering. IEEE Computer Society Press, Los Alamitos, CA, 509--518.]] Google Scholar
- Binkley, D. and Gallagher, K. 1996. Program slicing. Advances in Computers 43.]]Google Scholar
- Binkley, D., Horwitz, S., and Reps, T. 1995. Program integration for languages with procedure calls. ACM Trans. Softw. Eng. Meth. 4, 1 (Jan.), 3--35.]] Google Scholar
- Burke, M. 1990. An interval-based approach to exhaustive and incremental interprocedural data-flow analysis. ACM Trans. Prog. Lang. Syst. 12, 3 (July).]] Google Scholar
- Callahan, D. 1988. The program summary graph and flow-sensitive interprocedural data flow analysis. In Proceedings of the Conference on Programming Language Design and Implementation.]] Google Scholar
- Chen, Z. and Xu, B. 2001. Slicing concurrent Java programs. ACM SIGPLAN Notices 36, 4 (Apr.), 41--47.]] Google Scholar
- Cheng, J. 1993. Slicing concurrent programs. In Automated and Algorithmic Debugging 1st International Workshop. Lecture Notes in Computer Science, vol 749. Springer-Verlag, New York.]] Google Scholar
- Choi, J.-D., Gupta, M., Sreedhar, V. C., and Midkiff, S. 1999. Escape analysis for Java. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications. ACM, New York.]] Google Scholar
- Cormen, T. H., Leiserson, C. E., and Rivest, R. L. 1990. Introduction to algorithms. MIT press, Cambridge MA.]] Google Scholar
- Dijkstra, E. W. 1968. Programming Languages. Academic Press, London, England.]]Google Scholar
- Gallagher, K. B. and Lyle, J. R. 1991. Using program slicing in software maintenance. IEEE Trans. Softw. Eng. 17, 8, 751--761.]] Google Scholar
- Harman, M., Binkley, D., and Danicic, S. 2003. Amorphous program slicing. J. Syst. Softw. 68, 1, 45--64.]] Google Scholar
- Harman, M. and Danicic, S. 1995. Using program slicing to simplify testing. Softw. Test. Verifi. Reliab., 143--162.]]Google Scholar
- Harrold, M. J., Rothermel, G., and Sinha, S. 1998. Computation of interprocedural control dependence. In Proceedings of ACM SIGSOFT International Symposium on Software Testing and Analysis. ACM, New York. 11--20.]] Google Scholar
- Hatcliff, J., Corbett, J., Dwyer, M., Sokolowski, S., and Zheng, H. 1999. A formal study of slicing for multi-threaded programs with JVM concurrency primitives. In Proceedings of the Conference on International Static Analysis Symposium.]] Google Scholar
- Horwitz, S., Prins, J., and Reps, T. 1989. Integrating noninterfering versions of programs. ACM Trans. Prog. Lang. Syst. 11, 3, 345--387.]] Google Scholar
- Horwitz, S., Reps, T., and Binkley, D. 1990. Interprocedural slicing using dependence graphs. ACM Trans. Prog. Lang. Syst. 12, 26--60.]] Google Scholar
- JavaGrand. Benchmark suite---thread version 1.0. URL http://www.epcc.ed.ac.uk/computing/research_activities/java_grande/.]]Google Scholar
- Johnson, R. and Pingali, K. 1993. Dependence based program analysis. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York. 78--89.]] Google Scholar
- Krinke, J. 1998. Static slicing of threaded programs. In Proceedings of the Conference on Program Analysis for Software Tools and Engineering (PASTE 98). 35--42.]] Google Scholar
- Krinke, J. 2003. Context-sensitive slicing of concurrent programs. In Proceedings of the ACM Symposium on the Foundations of Software Engineering. ACM, New York.]] Google Scholar
- Krishnamurthy, A. and Yelick, K. 1995. Optimizing parallel programs with explicit synchronization. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York. 196--204.]] Google Scholar
- Mü-Olm, M. and Seidl, H. 2001. On optimal slicing of concurrent programs. In Proceedings of the ACM Symposium on Theory of Computing (STOC 2001). ACM, New York. 647--656.]] Google Scholar
- Millet, L. and Teitelbaum, T. 1998. Slicing Promela and its application to model checking, simulation, and protocol understanding. In Proceedings of the 4th Workshop on Automata Theoretic Verification with the SPIN Model Checker.]]Google Scholar
- Millet, L. and Teitelbaum, T. 1999. A case for channel dependence analysis: Slicing Promela. In Proceedings of the 1999 International Symposium on Software Engineering for Parallel and Distributed Systems (PDSE'99).]] Google Scholar
- Nanda, M. G. 2001. Slicing concurrent Java programs: Issues and solutions. Ph.D. thesis, Department of Computer Science and Engineering, Indian Institute of Technology, Bombay. http://www.cse.iitb.ernet.in/~ramesh/gow-thesis.ps.gz; Examiners: Dr. Frank Tip, IBM T. J. Watson Research Center and Prof. R. Mall, Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur.]]Google Scholar
- Nanda, M. G., Bhaduri, P., Oberoi, S., and Sanyal, A. 1999. An application of compiler technology to the year 2000 problem. Softw.---Pract. Exper.]] Google Scholar
- Nanda, M. G. and Ramesh, S. 2000. Slicing concurrent programs. In Proceedings of the International Symposium on Software Testing and Analysis.]] Google Scholar
- Nanda, M. G. and Ramesh, S. 2003. Pointer analysis of multithreaded Java programs. In Proceedings of the ACM Symposium on Applied Computing. ACM, New York.]] Google Scholar
- Novillo, D., Unrau, R., and Schaeffer, J. 1998. Concurrent SSA form in the presence of mutual exclusion. In Proceedings of the International Conference on Parallel Processing.]] Google Scholar
- Ottenstein, K. and Ottenstein, L. 1984. The program dependence graph in a software development environment. In Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments. ACM, New York. 177--184.]] Google Scholar
- Ramalingam, G. 2000. Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22, 2, 416--430.]] Google Scholar
- Ranganath, V. P. and Hatcliff, J. 2004. Pruning interference and ready dependence for slicing concurrent java. In Proceedings of the 13th International Conference on Compiler Construction (CC).]]Google Scholar
- Reps, T., Horwitz, S., Sagiv, M., and Rosay, G. 1994. Speeding up slicing. In Proceedings of the ACM Symposium on the Foundations of Software Engineering (New Orleans, LA). ACM, New York. 11--20.]] Google Scholar
- Ruf, E. 2000. Effective synchronization removal for Java. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York. 208--218.]] Google Scholar
- Rugina, R. and Rinard, M. 1999. Pointer analysis for multithreaded programs. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York.]] Google Scholar
- Salcianu, A. and Rinard, M. 2001. Pointer and escape analysis for multithreaded programs. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. ACM, New York.]] Google Scholar
- Sarkar, V. 1991. Automatic partitioning of a program dependence graph into parallel tasks. IBM J. Res. Devel. 35, 779--804.]] Google Scholar
- Sharir, M. and Pnueli, A. 1981. Two approaches to interprocedural data flow analysis. In Program Flow Analysis: Theory and Applications, S. S. Muchnick and N. D. Jones, Eds. Prentice-Hall, Englewood Cliffs, NJ, 189--233.]]Google Scholar
- Sinha, S., Harrold, M. J., and Rothermel, G. 1999. System-dependence-graph-based slicing of programs with arbitrary interprocedural control flow. In Proceedings of the International Conference on Software Engineering. 432--441.]] Google Scholar
- Tip, F. 1995. A survey of program slicing techniques. J. Prog. Lang. 3, 121--181.]]Google Scholar
- Venkatesh, R. 1991. The semantic approach to program slicing. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York.]] Google Scholar
- Weiser, M. 1984. Program slicing. IEEE Trans. Softw. Eng. 10, 352--357.]]Google Scholar
- Whaley, J. and Rinard, M. 1999. Compositional pointer and escape analysis for Java programs. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications. ACM, New York.]] Google Scholar
- Yang, W., Horwitz, S., and Reps, T. 1992. A program integration algorithm that accommodates semantics-preserving transformations. ACM Trans. Softw. Eng. Method. 1, 3 (July), 310--354.]] Google Scholar
- Zhao, J. 1999. Slicing concurrent Java programs. In Proceedings of the IEEE International Workshop on Program Comprehension. IEEE Computer Society Press, Los Alamitos, CA.]] Google Scholar
Index Terms
Interprocedural slicing of multithreaded programs with applications to Java
Recommendations
Context-sensitive slicing of concurrent programs
ESEC/FSE-11: Proceedings of the 9th European software engineering conference held jointly with 11th ACM SIGSOFT international symposium on Foundations of software engineeringProgram slicing is a technique to identify statements that may influence the computations at other statements. Precise slicing has been shown to be undecidable for concurrent programs. This work presents the first context-sensitive approach to slice ...
Slicing concurrent programs
ISSTA '00: Proceedings of the 2000 ACM SIGSOFT international symposium on Software testing and analysisSlicing is a well-known program analysis technique for analyzing sequential programs and found useful in debugging, testing and reverse engineering. This paper extends the notion of slicing to concurrent programs with shared memory, interleaving ...
Precise slicing of interprocedural concurrent programs
Program slicing is an effective technique for analyzing concurrent programs. However, when a conventional closure-based slicing algorithmfor sequential programs is applied to a concurrent interprocedural program, the slice is usually imprecise owing to ...






Comments