Title :
LambdaFicator: From imperative to functional programming through automated refactoring
Author :
Franklin, L. ; Gyori, Alex ; Lahoda, Jiri ; Dig, Danny
Author_Institution :
Ball State Univ., Muncie, IN, USA
Abstract :
Java 8 introduces two functional features: lambda expressions and functional operations like map or filter that apply a lambda expression over the elements of a Collection. Refactoring existing code to use these new features enables explicit but unobtrusive parallelism and makes the code more succinct. However, refactoring is tedious (it requires changing many lines of code) and error-prone (the programmer must reason about the control-flow, data-flow, and side-effects). Fortunately, these refactorings can be automated. We present LambdaFicator, a tool which automates two refactorings. The first refactoring converts anonymous inner classes to lambda expressions. The second refactoring converts for loops that iterate over Collections to functional operations that use lambda expressions. In 9 open-source projects we have applied these two refactorings 1263 and 1595 times, respectively. The results show that LambdaFicator is useful. A video highlighting the main features can be found at: http://www.youtube.com/watch?v=EIyAflgHVpU.
Keywords :
Java; functional programming; software maintenance; Java 8; LambdaFicator; automated refactoring; functional operations; functional programming; imperative programming; lambda expressions; object-oriented languages; Educational institutions; Functional programming; Java; Libraries; Open source software; Parallel processing; Semantics;
Conference_Titel :
Software Engineering (ICSE), 2013 35th International Conference on
Conference_Location :
San Francisco, CA
Print_ISBN :
978-1-4673-3073-2
DOI :
10.1109/ICSE.2013.6606699