Program Slicing: SPL-1 Project Report, 2019
Program Slicing: SPL-1 Project Report, 2019
Program Slicing: SPL-1 Project Report, 2019
Program Slicing
Submitted by
Md. Mehedi Hasan
BSSE Roll No. : 1037
Supervised by
Abdus Sattar
Designation: Lecturer
Institute of Information Technology
University of Dhaka
[29-05-2019]
2
Table of Contents
1. Introduction ...................................................................................................................................................... 3
3. User Manual………………………………………………………………………………………………….5-10
4. Conclusion ....................................................................................................................................................... 11
5.References ......................................................................................................................................................... 12
3
1. Introduction
Program slicing is a methodology that omits program modules that are irrelevant to a particular
computation process based on a criterion known as the slicing criterion. Using this methodology
we can automatically determine the relevance of a module in a particular computation. Once
such modules are found, the testing process takes considerably less effort and time because
testing phase generally accounts for more than one third of time during the software development
cycle.
In my project, I have implemented static slicing methodology to find the relevant parts of slicing
criterion & then used tree data structure to store the hierarchy of relevant statements and finally
printing them into an output file.
Slicing Criterion
• The pair <s,v> is known as Slicing Criterion where ‘s’ is a program point of interest and ‘v’ is a
variable used or defined
Static Slicing
Static slicing may be used to identify these parts of the program that potentially contribute to the
computation of the selected function for all possible programs inputs. Static slicing is helpful to
gain a general understanding of these parts of the program that contribute to the computation to
the selected function. Although static slicing has many advantages in the process of program
understanding, static slices are frequently still large subprograms because of the imprecise
computation of these slices. In addition, static slices cannot be used in the process of
understanding of program execution.
4
Dynamic Slicing
Dynamic slicing is used to identify these parts of the program that contribute to the computation
of the selected function for a given program execution (program input). Dynamic slicing may
help to narrow down this part of the program that contributes to the computation of the function
of interest for particular program input. Dynamic slices are frequently much smaller than static
slices. Moreover, dynamic slicing may be used to understand program execution.
Forward Slicing
Forward slices contain all parts of the program that might be influenced by the variable.
Backward Slicing
Backward slices contain all parts of the program that might have influenced the variable at the
statement under consideration.
1.2. Challenges
During implementing this project, I have faced so many challenges and some of them are
mentioned here:
Understanding & implementing the algorithm for the very first time.
Parsing each statement and then comparing the data to find dependencies.
Storing & handling a large size of data.
Finally, making the sliced program executable.
2. Project Overview
The whole project is the combination of all of the following steps that I have done :
3. User Manual
I am going to slice this program on slicing criterion <11,num1>
6
5.Conclusion
I have developed an algorithm for computing forward static slices of simple programs which derives
the slices which are affected by the variable. This slicing technique has various uses like analyzing
and reusing the code which makes the task of the programmer easier. While implementing this
project, I have learnt how to handle large size of code, different operations on strings, how to extract
or parse data, how to compare, how to find out direct or indirect dependencies, how to implement
tree data structure and such more topics which has improved my programming skill and I hope that
this will help me in future works.
12
6.References
[1] https://en.wikipedia.org/wiki/Program_slicing
[2] http://www0.cs.ucl.ac.uk/staff/M.Harman/exe1.html
[3]
https://people.eecs.ku.edu/~hossein/Teaching/Fa14/814/.../program-slicing-purvi.ppt
[4]
https://www.researchgate.net/publication/2390528_An_Overview_of_Program_Slicing
[5]
www.cs.loyola.edu/~binkley/papers/fosm08-slicing.pdf
[6] A survey of program slicing techniques, Frank Tip, IBM T.J. Watson Research
Center, PO Box 704, Yorktown Heights, NY 10598, USA