Advertisement

A comparison of tree- and line-oriented observational slicing

  • David BinkleyEmail author
  • Nicolas Gold
  • Syed Islam
  • Jens Krinke
  • Shin Yoo
Article
  • 29 Downloads

Abstract

Observation-based slicing and its generalization observational slicing are recently-introduced, language-independent dynamic slicing techniques. They both construct slices based on the dependencies observed during program execution, rather than static or dynamic dependence analysis. The original implementation of the observation-based slicing algorithm used lines of source code as its program representation. A recent variation, developed to slice modelling languages (such as Simulink), used an XML representation of an executable model. We ported the XML slicer to source code by constructing a tree representation of traditional source code through the use of srcML. This work compares the tree- and line-based slicers using four experiments involving twenty different programs, ranging from classic benchmarks to million-line production systems. The resulting slices are essentially the same size for the majority of the programs and are often identical. However, structural constraints imposed by the tree representation sometimes force the slicer to retain enclosing control structures. It can also “bog down” trying to delete single-token subtrees. This occasionally makes the tree-based slices larger and the tree-based slicer slower than a parallelised version of the line-based slicer. In addition, a Java versus C comparison finds that the two languages lead to similar slices, but Java code takes noticeably longer to slice. The initial experiments suggest two improvements to the tree-based slicer: the addition of a size threshold, for ignoring small subtrees, and subtree replacement. The former enables the slicer to run 3.4 times faster while producing slices that are only about 9% larger. At the same time the subtree replacement reduces size by about 8–12% and allows the tree-based slicer to produce more natural slices.

Keywords

Program slicing Observational slicing ORBS XML 

Notes

Acknowledgements

A special thanks to Mark Harman for many interesting conversations on the use of observational slicing. Dave Binkley is supported by NSF grant 1626262. Shin Yoo is supported by Next- Generation Information Computing Development Program through the National Research Foundation of Korea(NRF) funded by the Ministry of Science, ICT (No. 2017M3C4A7068179) and the National Research Foundation of Korea (NRF) grant funded by the Korea government (MEST) (Grant No. NRF-2016R1C1B1011042). The authors acknowledge the use of the UCL Legion High Performance Computing Facility (Legion@UCL), and associated support services, in the completion of this work. They also thank the Software Infrastructure Repository for the provision of subject programs.

References

  1. Agrawal H, Horgan JR (1990) Dynamic program slicing. In: Proceedings of the ACM SIGPLAN’90 conference on programming language design and implementation (PLDI)Google Scholar
  2. Barpanda SS, Mohapatra DP (2011) Dynamic slicing of distributed object-oriented programs. IET Softw 5(5):425–433Google Scholar
  3. Beszedes A, Gergely T, Szabó ZM, Csirik J, Gyimothy T (2001) Dynamic slicing method for maintenance of large C programs. In: Proceedings of the 5th conference on software maintenance and reengineeringGoogle Scholar
  4. Beszédes Á, Faragó C, Szabó ZM, Csirik J, Gyimóthy T (2002) Union slices for program maintenance. In: Proceedings of the 18th Intl. Conf. on Software Maintenance (ICSM)Google Scholar
  5. Beszedes A, Gergely T, Gyimóthy T (2006) Graph-less dynamic dependence-based dynamic slicing algorithms. In: Intl. workshop on source code analysis and manipulation (SCAM)Google Scholar
  6. Binkley D, Capellini R, Raszewski L, Smith C (2001) An implementation of and experiment with semantic differencing. In: Proceedings of the 2001 IEEE international conference on software maintenance, pp 82–91Google Scholar
  7. Binkley D, Harman M, Hassoun Y, Islam S, Li Z (2009) Assessing the impact of global variables on program dependence and dependence clusters. J Syst Softw 83(1):96–107Google Scholar
  8. Binkley D, Gold N, Harman M, Islam S, Krinke J, Yoo S (2014) ORBS: Language-independent program slicing. In: Proceedings 22nd ACM SIGSOFT Intl. symposium on foundations of software engineeringGoogle Scholar
  9. Binkley D, Gold N, Harman M, Islam S, Krinke J, Yoo S (2015) ORBS and the limits of static slicing. In: Intl. working conference on source code analysis and manipulation (SCAM)Google Scholar
  10. Binkley D, Gold N, Islam S, Krinke J, Yoo S (2017) Tree-oriented vs line-oriented observation-based slicing. In: Intl. workshop on source code analysis and manipulation (SCAM)Google Scholar
  11. Cleve H, Zeller A (2000) Finding failure causes through automated testing. In: Intl. workshop on automated debuggingGoogle Scholar
  12. Collard M (2005) Addressing source code using srcml. In: IEEE international workshop on program comprehension working session (IWPC’05)Google Scholar
  13. Danicic S, Howroyd J (2002) Montréal boat example. In: Source code analysis and manipulation (SCAM 2002) conference resources website. http://www.ieee-scam.org/2002/Slides_ct.html
  14. Danicic S, Harman M, Hierons R, Howroyd J, Laurence M (2004) Applications of linear program schematology in dependence analysis. In: 1st. international workshop on programming language interference and dependence, Verona, Italy. http://profs.sci.univr.it/mastroen/noninterference.html
  15. DeMillo RA, Pan H, Spafford EH (1996) Critical slicing for software fault localization. In: Proceedings of the Intl. symposium on software testing and analysis (ISSTA)Google Scholar
  16. Gallagher KB, Lyle JR (1991) Using program slicing in software maintenance. IEEE Trans Softw Eng 17(8):751–761Google Scholar
  17. Gallagher KB, Binkley D, Harman M (2006) Stop-list slicing. In: Intl. workshop on source code analysis and manipulation (SCAM)Google Scholar
  18. Gold NE, Binkley D, Harman M, Islam S, Krinke J, Yoo S (2017) Generalized observational slicing for tree-represented modelling languages. In: Proceedings 25nd ACM SIGSOFT Intl. symposium on foundations of software engineeringGoogle Scholar
  19. Harman M, Danicic S (1997) Amorphous program slicing. In: 5th IEEE international workshop on program comprenhesion (IWPC)Google Scholar
  20. Harman M, Binkley D, Gallagher K, Gold N, Krinke J (2009) Dependence clusters in source code. ACM Trans Program Lang Syst 32(1):1:1–1:33CrossRefGoogle Scholar
  21. Hodován R, Kiss Á, Gyimóthy T (2017) Coarse hierarchical delta debugging. In: 2017 IEEE international conference on software maintenance and evolution (ICSME), pp 194–203Google Scholar
  22. Horwitz S, Reps T, Binkley DW (1988) Interprocedural slicing using dependence graphs. In: ACM SIGPLAN Conference on programming language design and implementationGoogle Scholar
  23. Horwitz S, Reps T, Binkley DW (1990) Interprocedural slicing using dependence graphs. ACM Trans Program Lang Syst 12(1):26–61Google Scholar
  24. Islam S, Binkley D (2016) PORBS: a parallel observation-based slicer. In: 24Th international conference on program comprehension (ICPC), IEEE, pp 1–3Google Scholar
  25. Jaffar J, Murali V, Navas J, Santosa AE (2012) Path-sensitive backward slicing. In: Proceedings SAS’12, Springer, vol 7460Google Scholar
  26. Jiang S, Santelices R, Grechanik M, Cai H (2014) On the accuracy of forward dynamic slicing and its effects on software maintenance. In: Intl. working conference on source code analysis and manipulation (SCAM)Google Scholar
  27. Korel B, Laski J (1988) Dynamic program slicing. Inf Process Lett 29 (3):155–163CrossRefGoogle Scholar
  28. Korel B, Laski J (1990) Dynamic slicing in computer programs. J Syst Softw 13(3):187–195Google Scholar
  29. Krinke J (2003) Barrier slicing and chopping. In: Intl. workshop on source code analysis and manipulation (SCAM)Google Scholar
  30. Laurence MR (2004) Equivalence of linear, free, liberal program schemas is decidable in polynomial time. PhD thesis, Goldsmiths College, University of LondonGoogle Scholar
  31. De Lucia A, Harman M, Hierons R, Krinke J (2003) Unions of slices are not slices. In: European conference on software maintenance and reengineering (CSMR 2003), pp 363–367Google Scholar
  32. Mamun MAA, Berger C, Hansson J (2017) Correlations of software code metrics: An empirical study. In: Proceedings of the 27th international workshop on software measurement and 12th international conference on software process and product measurement, pp 255–266Google Scholar
  33. McPeak S, Wilkerson DS, Goldsmith S (2006) Delta (http://delta.tigris.org)
  34. Misherghi G, Su Z (2006) HDD: hierarchical delta debugging. In: Proceedings of the 28th Intl. conference on software engineering (ICSE)Google Scholar
  35. Mund G, Mall R (2006) An efficient interprocedural dynamic slicing method. J Syst Softw 79(6):791–806Google Scholar
  36. NASA (2017a) DAIDALUS: Detect and avoid alerting logic for unmanned systems. https://github.com/nasa/WellClear
  37. NASA (2017b) GMAT: Generalised mission analysis tool R2017a. https://sourceforge.net/projects/gmat/files/GMAT/GMAT-R2017a/
  38. Nguyen HV, Kästner C, Nguyen TN (2015) Cross-language program slicing for dynamic web applications. In: Proceedings of the 2015 10th joint meeting on foundations of software engineering, ACM, pp 369–380Google Scholar
  39. Orso A, Sinha S, Harrold MJ (2001) Incremental slicing based on data-dependences types. In: Proceedings of the IEEE Intl. conference on software maintenance (ICSM)Google Scholar
  40. Ottenstein KJ, Ottenstein LM (1984) The program dependence graph in software development environments. In: Proceedings of the ACM SIGSOFT/SIGPLAN software engineering symposium on practical software development environmentGoogle Scholar
  41. Regehr J, Chen Y, Cuoq P, Eide E, Ellison C, Yang X (2012) Test-case reduction for C compiler bugs. In: Proceedings of the ACM SIGPLAN conference on programming language design and implementation (PLDI)Google Scholar
  42. Reps T, Turnidge T, Danvy O, Glück R, Thiemann P (1996) Program specialization via program slicing. In: Dagstuhl seminar on partial evaluation, vol 1110Google Scholar
  43. Sun C, Li Y, Zhang Q, Gu T, Su Z (2018) Perses: Syntax-guided program reduction. In: Proceedings of the 40th Intl. conference on software engineering (ICSE)Google Scholar
  44. Szegedi A, Gyimóthy T (2005) Dynamic slicing of Java bytecode programsGoogle Scholar
  45. Tukey JW (1949) Comparing indirect means in the analysis of variance. Biometrics 5(99):99–114Google Scholar
  46. Ward M (2003) Slicing the SCAM mug: a case study in semantic slicing. In: Intl. workshop on source code analysis and manipulation (SCAM)Google Scholar
  47. Weiser M (1981) Program slicing. In: Proceedings of the 5th Intl. conference on software engineeringGoogle Scholar
  48. Weiser M (1982) Programmers use slices when debugging. Commun ACM 25(7):446–452Google Scholar
  49. Yoo S, Binkley D, Eastman RD (2014) Seeing is slicing: Observation based slicing of picture description languages. In: Intl. workshop on source code analysis and manipulation (SCAM), pp 175–184Google Scholar
  50. Zeller A (1999) Yesterday, my program worked. today it does not. Why?. In: European software engineering conference and foundations of software engineeringGoogle Scholar
  51. Zeller A, Hildebrandt R (2002) Simplifying and isolating failure-inducing input. IEEE Trans Softw Eng 28(2):183–200Google Scholar
  52. Zhang X, Gupta R (2004) Cost effective dynamic program slicing. In: Proceedings of the ACM SIGPLAN 2004 Conference on programming language design and implementationGoogle Scholar
  53. Zhang X, Gupta N, Gupta R (2007) A study of effectiveness of dynamic slicing in locating real faults. Empir Softw Eng 12(2):143–160CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Loyola University MarylandBaltimoreUSA
  2. 2.Department of Computer ScienceUniversity College LondonLondonUK
  3. 3.KAISTDaejeonRepublic of Korea

Personalised recommendations