skip to main content
10.1145/2972206.2972208acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Inference and Checking of Object Immutability

Published: 29 August 2016 Publication History

Abstract

Reference immutability guarantees that a reference is not used to modify the referenced object. It is well-understood and there are several scalable inference systems. Object immutability, a stronger immutability guarantee, guarantees that an object is not modified. Unfortunately, object immutability is not as well-understood; specifically, we are unaware of an inference system that infers object immutability across large Java programs and libraries.
It is tempting to use reference immutability to reason about object immutability. However, representation exposure and object initialization pose significant challenges.
In this paper we present a novel type system and a corresponding inference analysis. We leverage reference immutability to infer object immutability overcoming the challenges due to representation exposure and object initialization.
We have implemented our object immutability system for Java. Evaluation on the standard Dacapo benchmarks demonstrates precision and scalability. Nearly 40% of all static objects are inferred immutable. Analysis completes in under 2 minutes on all benchmarks.

References

[1]
S. M. Blackburn, S. Z. Guyer, M. Hirzel, and et. al. The Dacapo benchmarks: Java benchmarking development and analysis. In OOPSLA, pages 169--190, Oct. 2006.
[2]
J. Boyland. Alias burying: Unique variables without destructive reads. Softw. Pract. Exper., 31(6):533--553, May 2001.
[3]
J. Boyland. Checking interference with fractional permissions. In SAS, pages 55--72, 2003.
[4]
J. Boyland, J. Noble, and W. Retert. Capabilities for sharing: A generalisation of uniqueness and read-only. In ECOOP, pages 2--27, 2001.
[5]
D. Clarke and S. Drossopoulou. Ownership, encapsulation and the disjointness of type and effect. In OOPSLA, volume 37, pages 292--310, 2002.
[6]
D. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. In OOPSLA, pages 48--64, 1998.
[7]
D. Cunningham, W. Dietl, S. Drossopoulou, A. Francalanza, P. Müller, and A. Summers. Universe types for topology and encapsulation. In FMCO, pages 72--112, 2008.
[8]
W. Dietl and P. Müller. Universes: Lightweight ownership for JML. Journal of Object Technology, 4(8):5--32, 2005.
[9]
J. Dolby, C. Hammer, D. Marino, F. Tip, M. Vaziri, and J. Vitek. A data-centric approach to synchronization. ACM Transactions on Programming Languages and Systems, 34(1):1--48, Apr. 2012.
[10]
M. Fähndrich and K. R. M. Leino. Declaring and checking non-null types in an object-oriented language. In OOPSLA, pages 302--312, 2003.
[11]
C. Haack and E. Poll. Type-based object immutability with flexible initialization. In ECOOP, pages 520--545, 2009.
[12]
C. Haack, E. Poll, J. Schäfer, and A. Schubert. Immutable objects for a Java-like language. In ESOP, pages 347--362, 2007.
[13]
P. Haller and M. Odersky. Capabilities for uniqueness and borrowing. In ECOOP, pages 354--378, 2010.
[14]
W. Huang, W. Dietl, A. Milanova, and M. D. Ernst. Inference and checking of object ownership. In ECOOP, pages 181--206, 2012.
[15]
W. Huang, Y. Dong, and A. Milanova. Type-based Taint Analysis for Java Web Applications. Technical report, Rensselaer Polytechnic Institute, 2013.
[16]
W. Huang, Y. Dong, A. Milanova, and J. Dolby. Scalable and precise taint analysis for Android. In ISSTA, July 2015.
[17]
W. Huang, A. Milanova, W. Dietl, and M. D. Ernst. ReIm & ReImInfer: Checking and inference of reference immutability and method purity. In OOPSLA, pages 879--896, 2012.
[18]
K. Naden, R. Bocchino, J. Aldrich, and K. Bierhoff. A type system for borrowing permissions. In POPL, pages 557--570, 2012.
[19]
A. Potanin, J. Östlund, Y. Zibin, and M. D. Ernst. Immutability. In Aliasing in Object-Oriented Programming, volume 7850 of LNCS, pages 233--269. Springer-Verlag, Apr. 2013.
[20]
J. Quinonez, M. S. Tschantz, and M. D. Ernst. Inference of reference immutability. In ECOOP, pages 616--641, 2008.
[21]
T. Reps. Undecidability of context-sensitive data-independence analysis. ACM Trans. Program. Lang. Syst., 22(1):162--186, 2000.
[22]
M. S. Tschantz and M. D. Ernst. Javari: Adding reference immutability to Java. In OOPSLA, pages 211--230, 2005.
[23]
Y. Zibin, A. Potanin, M. Ali, S. Artzi, A. Kieżun, and M. D. Ernst. Object and Reference Immutability using Java Generics. In ESEC/FSE, pages 75--84, 2007.
[24]
Y. Zibin, A. Potanin, P. Li, M. Ali, and M. D. Ernst. Ownership and Immutability in Generic Java. In OOPSLA, pages 598--617, 2010.

Cited By

View all
  • (2021)CiFi: Versatile Analysis of Class and Field Immutability2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE51524.2021.9678903(979-990)Online publication date: Nov-2021
  • (2021)Using Machine Learning to Identify Methods Violating ImmutabilityIntelligent Computing10.1007/978-3-030-80126-7_33(453-462)Online publication date: 7-Jul-2021
  • (2018)Transforming Threads into Actors: Learning Concurrency Structure from Execution TracesPrinciples of Modeling10.1007/978-3-319-95246-8_2(16-37)Online publication date: 20-Jul-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPPJ '16: Proceedings of the 13th International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools
August 2016
186 pages
ISBN:9781450341356
DOI:10.1145/2972206
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 29 August 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. immutability
  2. object immutability
  3. reference immutability

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

PPPJ '16
PPPJ '16: Virtual Machines, Languages, and Tools
August 29 - September 2, 2016
Lugano, Switzerland

Acceptance Rates

PPPJ '16 Paper Acceptance Rate 14 of 31 submissions, 45%;
Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2021)CiFi: Versatile Analysis of Class and Field Immutability2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE51524.2021.9678903(979-990)Online publication date: Nov-2021
  • (2021)Using Machine Learning to Identify Methods Violating ImmutabilityIntelligent Computing10.1007/978-3-030-80126-7_33(453-462)Online publication date: 7-Jul-2021
  • (2018)Transforming Threads into Actors: Learning Concurrency Structure from Execution TracesPrinciples of Modeling10.1007/978-3-319-95246-8_2(16-37)Online publication date: 20-Jul-2018
  • (2017)Transferring State-of-the-Art Immutability Analyses: Experimentation Toolbox and Accuracy Benchmark2017 IEEE International Conference on Software Testing, Verification and Validation (ICST)10.1109/ICST.2017.55(484-491)Online publication date: Mar-2017

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media