DocumentCode :
555271
Title :
Transformation for class immutability
Author :
Kjolstad, Fredrik ; Dig, Danny ; Acevedo, Gabriel ; Snir, Marc
Author_Institution :
Univ. of Illinois at Urbana-Champaign, Urbana, IL, USA
fYear :
2011
fDate :
21-28 May 2011
Firstpage :
61
Lastpage :
70
Abstract :
It is common for object-oriented programs to have both mutable and immutable classes. Immutable classes simplify programing because the programmer does not have to reason about side-effects. Sometimes programmers write immutable classes from scratch, other times they transform mutable into immutable classes. To transform a mutable class, programmers must find all methods that mutate its transitive state and all objects that can enter or escape the state of the class. The analyses are non-trivial and the rewriting is tedious. Fortunately, this can be automated. We present an algorithm and a tool, Immutator, that enables the programmer to safely transform a mutable class into an immutable class. Two case studies and one controlled experiment show that Immutator is useful. It (i) reduces the burden of making classes immutable, (ii) is fast enough to be used interactively, and (iii) is much safer than manual transformations.
Keywords :
object-oriented programming; rewriting systems; class immutability transformation; immutable classes; immutator; object-oriented programs; rewriting; Algorithm design and analysis; Cloning; Data structures; Java; Libraries; Production facilities; Transforms; immutability; program transformation;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Software Engineering (ICSE), 2011 33rd International Conference on
Conference_Location :
Honolulu, HI
ISSN :
0270-5257
Print_ISBN :
978-1-4503-0445-0
Electronic_ISBN :
0270-5257
Type :
conf
DOI :
10.1145/1985793.1985803
Filename :
6032445
Link To Document :
بازگشت