Testing Dafny (experience paper)
Ahmed Irfan, Sorawee Porncharoenwase, Zvonimir Rakamaric, Neha Rungta, Emina Torlak
摘要
Verification toolchains are widely used to prove the correctness of critical software systems. To build confidence in their results, it is important to develop testing frameworks that help detect bugs in these toolchains. Inspired by the success of fuzzing in finding bugs in compilers and SMT solvers, we have built the first fuzzing and differential testing framework for Dafny, a high-level programming language with a Floyd-Hoare-style program verifier and compilers to C#, Java, Go, and Javascript. This paper presents our experience building and using XDsmith, a testing framework that targets the entire Dafny toolchain, from verification to compilation. XDsmith randomly generates annotated programs in a subset of Dafny that is free of loops and heapmutating operations. The generated programs include preconditions, postconditions, and assertions, and they have a known verification outcome. These programs are used to test the soundness and precision of the Dafny verifier, and to perform differential testing on the four Dafny compilers. Using XDsmith, we uncovered 31 bugs across the Dafny verifier and compilers, each of which has been confirmed by the Dafny developers. Moreover, 8 of these bugs have been fixed in the mainline release of Dafny.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Formalization, Implementation, and Verification of the Bluetooth L2CAP State Machine 引用了 Validating SMT solvers via semantic fusion
- Formalization, Implementation, and Verification of the Bluetooth L2CAP State Machine 引用了 Storage Systems are Distributed Systems (So Verify Them That Way!)
- On the unusual effectiveness of type-aware operator mutations for testing SMT solvers 引用了 Validating SMT solvers via semantic fusion
- On the unusual effectiveness of type-aware operator mutations for testing SMT solvers 引用了 Detecting critical bugs in SMT solvers using blackbox mutational fuzzing
- On the Impact of Formal Verification on Software Development 引用了 IronSpec: Increasing the Reliability of Formal Specifications
- IronSpec: Increasing the Reliability of Formal Specifications 引用了 Storage Systems are Distributed Systems (So Verify Them That Way!)
引用它的顶会 Paper5
- Towards AI-Assisted Synthesis of Verified Dafny MethodsMd Rakib Hossain Misu, Cristina V. Lopes, Iris Ma, James NobleFSE 2024 · 26 次引用
- IronSpec: Increasing the Reliability of Formal SpecificationsEli Goldweber, Weixin Yu, Seyed Armin Vakil-Ghahani, Manos KapritsosOSDI 2024 · 4 次引用
- Formally Verified Cloud-Scale AuthorizationAleks Chakarov, Jaco Geldenhuys, Matthew Heck, Michael Hicks 等ICSE 2025 · 1 次引用
- Formalization, Implementation, and Verification of the Bluetooth L2CAP State MachineTan Khang Le, Mohammad Omidvar Tehrani, Yuepeng Wang, Jianliang Wu 等MobiCom 2025
- On the Impact of Formal Verification on Software DevelopmentEric Mugnier, Yuanyuan Zhou, Ranjit Jhala, Michael CoblenzOOPSLA 2025
它引用的 Paper5
- Validating SMT solvers via semantic fusionDominik Winterer, Chengyu Zhang, Zhendong SuPLDI 2020 · 80 次引用
- On the unusual effectiveness of type-aware operator mutations for testing SMT solversDominik Winterer, Chengyu Zhang, Zhendong SuOOPSLA 2020 · 55 次引用
- Storage Systems are Distributed Systems (So Verify Them That Way!)Travis Hance, Andrea Lattuada, Chris Hawblitzel, Jon Howell 等OSDI 2020 · 52 次引用
- Detecting critical bugs in SMT solvers using blackbox mutational fuzzingMuhammad Numair Mansur, Maria Christakis, Valentin Wüstholz, Fuyuan ZhangFSE 2020 · 51 次引用
- Generative type-aware mutation for testing SMT solversJiwon Park, Dominik Winterer, Chengyu Zhang, Zhendong SuOOPSLA 2021 · 31 次引用
相关 Paper
- SMT2Test: From SMT Formulas to Effective Test CasesChengyu Zhang, Zhendong SuOOPSLA 2024 · 5 次引用
- MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler InfrastructureHaoyu Wang, Junjie Chen, Chuyue Xie, Shuang Liu 等ASE 2023 · 16 次引用
- DafnyMPI: A Dafny Library for Verifying Message-Passing Concurrent ProgramsAleksandr Fedchin, Antero Mejr, Hari Sundar, Jeffrey S. FosterPOPL 2026 · 1 次引用
- NNSmith: Generating Diverse and Valid Test Cases for Deep Learning CompilersJiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan 等ASPLOS 2023 · 90 次引用
- Constraint-Based Test Oracles for Program AnalyzersMarkus Fleischmann, David Kaindlstorfer, Anastasia Isychev, Valentin Wüstholz 等ASE 2024 · 2 次引用
