International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 9 - Number 6 |
Year of Publication: 2010 |
Authors: Amogh Katti, Sujatha Terdal |
10.5120/1387-1869 |
Amogh Katti, Sujatha Terdal . Article:Program Slicing for Refactoring: Static Slicer using Dynamic Analyser. International Journal of Computer Applications. 9, 6 ( November 2010), 36-43. DOI=10.5120/1387-1869
Refactoring is the process of changing the code of the software such that its internal design is improved without altering its observable behavior. Method Extraction is the process of separating out a subset of method’s statements into another method and replacing their occurrence in the original method with a call to this new method. Method extraction is a classical problem to improve the modularity of the system and is used in extracting methods from long procedural programs. It can also be used in extracting aspects from object oriented code. Thus it makes the software easier to understand, maintain and reusable. In the earlier days of method extraction, programmer selected a random set of statements for extraction which was made more sensible by specifying the variables of interest and separating the statements concerning them into a method. Thus, program slicing became part of method extraction. Many slicing algorithms exist in the literature; they first convert the program into some alternative representation and then apply some correctness preserving transformations on it to produce slice and its complement. This process was identified to be expensive and an algorithm was proposed to act directly on the source code. It statically analyzes the source code to produce the slice but fails to handle dynamic constructs like aliasing and polymorphism effectively. To overcome this limitation we propose a new slicing algorithm that dynamically analyzes source code to produce static slices. It exploits the behavior preservation requirement of refactoring and uses the data collected during testing, which we perform prior to refactoring, for slicing. This algorithm suits better to the refactoring domain.