Lune

ASE2024顶会

Verifying the Option Type with Rely-Guarantee Reasoning

James Yoo, Michael D. Ernst, René Just

摘要

Many programming languages include an implementation of the option type, which encodes the absence or presence of values. Incorrect use of the option type results in run-time errors, and unstylistic use results in unnecessary code. Researchers and practitioners have tried to mitigate the pitfalls of the option type, but have yet to evaluate tools for enforcing correctness and good style. To address problems of correctness, we developed two modular verifiers that cooperate via a novel form of rely-guarantee reasoning; together, they verify use of the option type. We implemented them in the Optional Checker, an open-source static verifier. The Optional Checker is the first verifier for the option type based on a sound theory -that is, it issues a compile-time guarantee of the absence of run-time errors related to misuse of the option type. We then conducted the first mechanized study of tools that aim to prevent run-time errors related to the option type. We compared the performance of the Optional Checker, SpotBugs, Error Prone, and IntelliJ IDEA over 1M non-comment, non-blank lines of code. The Optional Checker found 13 previously-undiscovered bugs (a superset of those found by all other tools) and had the highest precision at 93%. To address problems of style, we conducted a literature review of best practices for the option type. We discovered widely varying opinions about proper style. We implemented linting rules in the Optional Checker and discovered hundreds of violations of the style recommended by Oracle, including in 11% of JDK files that use Optional. Some of these were objectively bad code, and others reflected different styles.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Continuous Compliance 引用了 Verifying object construction
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper3

  1. Finding real bugs in big programs with incorrectness logicQuang Loc Le, Azalea Raad, Jules Villard, Josh Berdine 等OOPSLA 2022 · 52 次引用
  2. Continuous ComplianceMartin Kellogg, Martin Schäf, Serdar Tasiran, Michael D. ErnstASE 2020 · 16 次引用
  3. Verifying object constructionMartin Kellogg, Manli Ran, Manu Sridharan, Martin Schäf 等ICSE 2020 · 10 次引用

相关 Paper

  1. Understanding and Detecting Annotation-Induced Faults of Static AnalyzersHuaien Zhang, Yu Pei, Shuyun Liang, Shin Hwei TanFSE 2024 · 4 次引用
  2. JavaDL: automatically incrementalizing Java bug pattern detectionAlexandru Dura, Christoph Reichenbach, Emma SöderbergOOPSLA 2021 · 13 次引用
  3. Memory-Safety Verification of Open Programs with Angelic AssumptionsGourav Takhar, Baldip Bijlani, Prantik Chatterjee, Akash Lal 等OOPSLA 2025 · 2 次引用
  4. Practical Inference of Nullability TypesNima Karimipour, Justin Pham, Lazaro Clapp, Manu SridharanFSE 2023 · 6 次引用
  5. Relational nullable types with Boolean unificationMagnus Madsen, Jaco van de PolOOPSLA 2021 · 9 次引用
黄昏的海面,两侧是细线勾勒的悬崖