A comparison of tree- and line-oriented observational slicing

A comparison of tree- and line-oriented observational slicing
复制标题

面向树和面向线的观察切片的比较

DOI:
--
复制
发表时间:
2019
影响因子:
4.1
通讯作者:
S. Yoo
S. Yoo
中科院分区:
计算机科学2区
文献类型:
--
作者:
D. Binkley;N. Gold;Syed S. Islam;J. Krinke;S. Yoo

文献摘要

被引文献

相似文献

基于观察的切片及其概括性切片是基于在程序执行过程中观察到的依赖性的,而不是静态或动态依赖性分析,它们都是与语言无关的动态切片技术。切片算法使用源代码的线路表示,开发了切片建模语言(例如Simulink),使用了可执行的模型的XML表示。通过使用SRCML来表示传统的源代码。然而,大多数程序是相同的。基于基于线的切片机的切片较大,基于树的切片机慢于基于线的切片机。最初的实验建议对基于树的切片机进行了两个改进:添加尺寸阈值,忽略小子树和子树的替换,使得切片机可以更快地运行3.4倍,同时产生只有9%大约9%的切片。同时,子树更换将尺寸降低了约8-12%,并允许基于树的切片机产生更多的自然切片。
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.