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

  • Authors:
  • Shay Artzi;Adam Kieżun;Jaime Quinonez;Michael D. Ernst

  • Affiliations:
  • MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, USA 02142;MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, USA 02142;MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, USA 02142;MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, USA 02142

  • Venue:
  • Automated Software Engineering
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

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.