Abstract
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 the intransitivity of interference dependence. Interference dependence arises when a statement uses a variable defined in another statement executed concurrently. In this study, we propose a global dependence analysis approach based on a program reachability graph, and construct a novel dependence graph calledmarking-statement dependence graph (MSDG), in which each vertex is a 2-tuple of program state and statement. In contrast to the conventional program dependence graph where the vertex is a statement, the dependence relation in MSDG is transitive. When traversing MSDG, a precise slice will be obtained. To enhance the slicing efficiency without loss of precision, our slicing algorithm adopts a hybrid strategy. The procedures containing interaction statements between threads are inlined and sliced by the slicing algorithm based on program reachability graphs while allowing other procedures to be sliced as sequential programs. We have implemented our algorithm and three other representative slicing algorithms, and conducted an empirical study on concurrent Java programs. The experimental results show that our algorithm computes more precise slices than the other algorithms. Using partial-order reduction techniques, which are effective for reducing the size of a program reachability graph without loss of precision, our algorithm is optimized, thereby improving its performance to some extent.
Similar content being viewed by others
References
Burns A, Wellings A. Real-Time Systems and Programming Languages: Ada, Real-Time Java and C/Real-Time POSIX. 4th Ed. Boston: Addison Wesley Longman, 2009
Xu B W, Qian J, Zhang X F, Wu Z Q, Chen L. A brief survey of program slicing. ACM SIGSOFT Software Engineering Notes, 2005, 30(2): 1–36
Silva J. A vocabulary of program slicing-based techniques. ACM Computing Surveys, 2012, 44(3): 12
Horwitz S, Reps T, Binkley D. Inter-procedural slicing using dependence graphs. ACM SIGPLAN Notices, 2004, 39(4): 229–243.
Krinke J. Context-sensitive slicing of concurrent programs. ACM SIGSOFT Software Engineering Notes, 2003, 28(5): 178–187
Nanda M G, Ramesh S. Inter-procedural slicing of multithreaded programs with applications to Java. ACM Transaction on Programming Language Systems, 2006, 28(6): 1088–1144
Giffhorn D, Hammer C. Precise slicing of concurrent programs. Journal of Automated Software Engineering, 2009, 16(2): 197–234
Giffhorn D. Advanced chopping of sequential and concurrent programs. Software Quality Journal, 2011, 19(2): 239–294
Giffhorn D. Slicing of concurrent programs and its application to Information flow control. Dissertation for the Doctoral Degree. Karlsruhe: University of Karlsruhe, 2012
Chen Z Q, Xu BW. Slicing concurrent Java programs. ACMSIGPLAN Notices, 2001, 36(4): 41–47
Qi X F, Zhou X Y, Xu X J, Zhang Y Z. Slicing concurrent programs based on program reachability graph. In: Proceedings of the 10th International Conference on Quality Software. 2010, 248–253
Qi X F, Xu B W, Zhou X Y. An approach to analyzing dependence of concurrent programs based on program reachability graphs. Acta Electronica Sinica, 2007, 35(2): 287–291
Qi X F, Xu X J, Jiang Z L, Wang P. Slicing concurrent programs based on program reachability graphs with partial-order reduction. Chinese Journal of Computer, 2014, 37(3): 568–579
Qi X F, Xu X J, Wang P. Slicing concurrent inter-procedural programs based on program reachability graphs. In: Proceedings of the 24th International Conference on Software Engineering and Knowledge Engineering. 2012, 293–298
Pezze M, Taylor R N, Young M. Graph models for reachability analysis of concurrent programs. ACM Transaction on Software Engineering and Methodology, 1995, 4(2): 171–213
Nielson F, Nielson H R, Hankin C. Principles of Program Analysis. Berlin: Springer, 2015
Godefroid P, Peled D, Staskauskas M. Using partial-order methods in the formal validation of industrial concurrent programs. IEEE Transaction on Software Engineering, 1996, 22(7): 496–507
Jaghoori M M, Sirjani M, Mousavi M R, Khamespanah E, Movaghar A. Symmetry and partial order reduction techniques in model checking Rebeca. Acta Information, 2010, 47(1): 33–66
Zhao J J. Multithreaded dependence graphs for concurrent Java programs. In: Proceedings of International Symposium on Software Engineering for Parallel and Distributed Systems. 1999, 13–23
Cheng J. Task dependence nets for concurrent systems with Ada 95 and its applications. In: Proceedings of ACM TRI-Ada International Conference. 1997, 67–78
Hatcliff J. A formal study of slicing for multi-threaded programs with JVM concurrency primitives. In: Proceedings of International Symposium on Static Analysis. 1999, 1–18
Zhang J, Jin C Z. Control-flow-based static slicing algorithm of threaded programs. Journal of Jilin University, 2003, 41(4): 481–486
Zhang Y Z. Research on program slicing techniques based on modular monadic semantics. Dissertation for the Doctoral Degree. Nanjing: Southeast University, 2006
Ramalingam G. Context-sensitive synchronization-sensitive analysis is undecidable. ACM Transactions on Programming Language Systems, 2000, 22(2): 416–430
Leuschel M, Llorensb M, Oliver J, Silva J, Tamarit S. Static slicing of explicitly synchronized languages. Information and Computation, 2012, 214: 10–46
Acknowledgements
This work was supported by the National Natural Science Foundation of China (Grant Nos. 61472076 and 61472077).
Author information
Authors and Affiliations
Corresponding author
Additional information
Xiaofang Qi received her PhD degree in computer science at Southeast University (SEU), China in 2008. She is an associate professor in the School of Computer Science and Engineering, SEU. Her research interests include program analysis and testing, and software engineering.
Zhenliang Jiang received his MD degree in computer science at Southeast University, China in 2014. He is an engineer in Huawei Technologies Cooperation, China. His research interests include software testing and software engineering.
Electronic supplementary material
Rights and permissions
About this article
Cite this article
Qi, X., Jiang, Z. Precise slicing of interprocedural concurrent programs. Front. Comput. Sci. 11, 971–986 (2017). https://doi.org/10.1007/s11704-017-6189-3
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-017-6189-3