: Eli Kfir, Daniel Lemel Stud udents ents : Ran Ettinger Supervis pervisor
- r
June 27, 2010
Stud udents ents : Eli Kfir, Daniel Lemel Supervis pervisor or - - PowerPoint PPT Presentation
June 27, 2010 Stud udents ents : Eli Kfir, Daniel Lemel Supervis pervisor or : Ran Ettinger Co Code re refact ctoring ring [from Wikipedi dia] is the process of changing a computer program's source code without modifying its
: Eli Kfir, Daniel Lemel Stud udents ents : Ran Ettinger Supervis pervisor
June 27, 2010
Co
Code re refact ctoring ring [from Wikipedi
dia]
code without modifying its external functional behavior in
the software.
complexity to improve the maintainability of the source code, as well as a more expressive internal architecture or
In our project we have built an advanced
refactoring tool - Separate Query from Modifier (SQfM).
2 http://www.refactoring.com/catalog/separa
teQueryFromModifier.html
http://sourcemaking.com/refactoring/sepa
rate-query-from-modifier
http://t2.technion.ac.il/~selikfir
3public int f(…) { globalVar = …; return …; } public void f(…) { …; globalVar = …; } public int f(…) { …; return …; }
Implemented a prototype SQfM tool - split method
which returns information and also change an
Modifier before query. Query before modifier.
Improve previous semester project code –
Replace Temp with Query (with all the above).
5Inline Original Method Rearrange the Original Method to be: Call Modifier and Return the Query Extract Original Method to Modifier Prepare the remaining original statements to be extracted Invoke full Replace Temp with Query Replace Return Values with Temp
6Inline Original Method Rearrange the Original Method to be: Call Query, Call Modifier and Return Result Extract Original Method to Modifier without Query’s Result Prepare the remaining original statements to be extracted Invoke Replace Temp with Query without Inline Temp Replace Return Values with Temp
7 The selection is a method name. Original method is a query and a modifier. Query/Modifier name inserted by the user has
not already exists.
The Query created by RTwQ has no side
effects
Modifier is really modify any object.
8 Inline method limitations:
WALA limitations:
RTwQ limitations:
even it changes the behavior of the program.
Blocks:
Pre Conditions:
Modifier before Query:
Incr
creme ementa ntal ap approac ach
writing the code, testing and fixing any bugs found.
Build
d 1 1 (Week 8)
programming language, and adjust it to Java. Implement a limited version of the tool.
Build
d 2 2 (Week 14 14) ) – do as many things gs as time allows