Parameter reference immutability: formal definition, inference tool, and comparison

  • Shay Artzi
  • Adam Kieżun
  • Jaime Quinonez
  • Michael D. Ernst
Article

Abstract

Knowing which method parameters may be mutated during a method’s execution is useful for many software engineering tasks. A parameter reference is immutable if it cannot be used to modify the state of its referent object during the method’s execution. We formally define this notion, in a core object-oriented language. Having the formal definition enables determining correctness and accuracy of tools approximating this definition and unbiased comparison of analyses and tools that approximate similar definitions.

We present Pidasa, a tool for classifying parameter reference immutability. Pidasa combines several lightweight, scalable analyses in stages, with each stage refining the overall result. The resulting analysis is scalable and combines the strengths of its component analyses. As one of the component analyses, we present a novel dynamic mutability analysis and show how its results can be improved by random input generation. Experimental results on programs of up to 185 kLOC show that, compared to previous approaches, Pidasa increases both run-time performance and overall accuracy of immutability inference.

Keywords

Readonly Reference immutability Definition Combined analysis 

Copyright information

© Springer Science+Business Media, LLC 2008

Authors and Affiliations

  • Shay Artzi
    • 1
  • Adam Kieżun
    • 1
  • Jaime Quinonez
    • 1
  • Michael D. Ernst
    • 1
  1. 1.MIT Computer Science and Artificial Intelligence LaboratoryCambridgeUSA

Personalised recommendations