Old Projects

F. Kjolstad, D. Dig, Gabriel Acevedo and M. Snir:

  Transformation for Class Immutability

In the Proceedings of the 33rd International Conference on Software Engineering (ICSE'11), May 2011.


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, \tool, that enables the programmer to safely transform a mutable class into an immutable class. Two case studies and one controlled experiment show that \tool 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.


Download pre-print:
An earlier Technical Report is available from here.


  author={F. Kjolstad and D. Dig and G. Acevedo and M. Snir},
  title={{Refactoring for Immutability}},
  booktitle={33rd International Conference on Software Engineering (ICSE'11)},