CiFi: Versatile Analysis of Class and Field Immutability
Tobias Roth, Dominik Helm, Michael Reif, Mira Mezini
Abstract
Reasoning about immutability is important for pre-venting bugs, e.g., in multi-threaded software. So far, static analysis to infer immutability properties has mostly focused on individual objects and references. Reasoning about fields and entire classes, while significantly simpler, has gained less attention. Even a consistently used terminology is missing, which makes it difficult to implement analyses that rely on immutability information. We propose a model for class and field immutability that unifies terminology for immutability flavors considered by previous work and covers new levels of immutability to handle lazy initialization and immutability dependent on generic type parameters. Using the OPAL static analysis framework, we implement CiFi, a set of modular, collaborating analyses for different flavors of immutability, inferring the properties defined in our model. Additionally, we propose a benchmark of representative test cases for class and field immutability. We use the benchmark to showcase CiFi’s precision and recall in comparison to state of the art and use CiFi to study the prevalence of immutability in real-world libraries, showcasing the practical quality and relevance of our model.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers3
- Taking Out the Toxic Trash: Recovering Precision in Mixed Flow-Sensitive Static AnalysesFabian Stemmler, Michael Schwarz, Julian Erhard, Sarah Tilscher et al.PLDI 2025 · 3 citations
- Persisting and Reusing Results of Static Program Analyses on a Large ScaleJohannes Düsing, Ben HermannASE 2023 · 1 citation
- Unimocg: Modular Call-Graph Algorithms for Consistent Handling of Language FeaturesDominik Helm, Tobias Roth, Sven Keidel, Michael Reif et al.ISSTA 2024
Builds on1
Related papers
- Transitive, Abstract, and Class Polymorphic ImmutabilityAosen Xiong, Yudi Bai, Haifeng Shi, Lian Sun et al.OOPSLA 2026
- A programming model for semi-implicit parallelization of static analysesDominik Helm, Florian Kübler, Jan Thomas Kölzer, Philipp Haller et al.ISSTA 2020 · 8 citations
- Dynamically Checked Deep Immutability in PythonFridtjof Peer Stoldt, Sylvan Clebsch, Matthew A. Johnson, Matthew J. Parkinson et al.PLDI 2026 · 1 citation
- A conceptual framework for safe object initialization: a principled and mechanized soundness proof of the Celsius modelClement Blaudeau, Fengyun LiuOOPSLA 2022 · 2 citations
- Hybrid Inlining: A Framework for Compositional and Context-Sensitive Static AnalysisJiangchao Liu, Jierui Liu, Peng Di, Diyu Wu et al.ISSTA 2023 · 3 citations
