Abstract
Program slicing, as a technique of program decomposition, is widely used in the field of program testing, model checking, software verification, symbolic execution and other fields. However, the traditional approaches of program slicing tend to produce too large slices and the static program analyses are hard to be precise enough. Scenario oriented program slicing, which takes the actual usage of software into account, gives a more precise perspective of program slicing. In this paper, we propose an approach of scenario oriented program slicing which combines the constraint logic programming and the program transformation. According to the observation that the output of a program transformation is a semantically equivalent program where the properties of interest are preserved, we can apply a sequence of transformations, more powerful than those needed for program specialization, refining the slicing to the desired degree of precision. And constraint logic programming has been shown to be a powerful, flexible formalism to reason about the correctness of programs. The novel contributions of the paper are as follows. (1) Converting the problem of program slicing into program transformation and retrieval. (2) Presenting a set of constraint handling rules (CHR) for scenario oriented program slicing in CLP (Constraint Logical Programming) programs. (3) Deriving a scenario oriented program slicing algorithm. The method of scenario oriented program slicing has been implemented and we have demonstrated its effectiveness and efficiency on three open source software projects in GitHub.
Funding Information
  • Central South University (2017zzts615)

This publication has 14 references indexed in Scilit: