Testing Dafny (experience paper)
Ahmed Irfan, Sorawee Porncharoenwase, Zvonimir Rakamaric, Neha Rungta, Emina Torlak
Abstract
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. CCS CONCEPTS • Software and its engineering → Software verification and validation.
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.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 6c75f7fe-bb7a-4f8f-b142-7d8977fa6147Cited by top-tier papers5
- Towards AI-Assisted Synthesis of Verified Dafny MethodsMd Rakib Hossain Misu, Cristina V. Lopes, Iris Ma, James NobleFSE 2024 · 26 citations
- IronSpec: Increasing the Reliability of Formal SpecificationsEli Goldweber, Weixin Yu, Seyed Armin Vakil-Ghahani, Manos KapritsosOSDI 2024 · 4 citations
- Formally Verified Cloud-Scale AuthorizationAleks Chakarov, Jaco Geldenhuys, Matthew Heck, Michael Hicks et al.ICSE 2025 · 1 citation
- Formalization, Implementation, and Verification of the Bluetooth L2CAP State MachineTan Khang Le, Mohammad Omidvar Tehrani, Yuepeng Wang, Jianliang Wu et al.MobiCom 2025
- On the Impact of Formal Verification on Software DevelopmentEric Mugnier, Yuanyuan Zhou, Ranjit Jhala, Michael CoblenzOOPSLA 2025
Builds on5
- Validating SMT solvers via semantic fusionDominik Winterer, Chengyu Zhang, Zhendong SuPLDI 2020 · 80 citations
- On the unusual effectiveness of type-aware operator mutations for testing SMT solversDominik Winterer, Chengyu Zhang, Zhendong SuOOPSLA 2020 · 55 citations
- Storage Systems are Distributed Systems (So Verify Them That Way!)Travis Hance, Andrea Lattuada, Chris Hawblitzel, Jon Howell et al.OSDI 2020 · 52 citations
- Detecting critical bugs in SMT solvers using blackbox mutational fuzzingMuhammad Numair Mansur, Maria Christakis, Valentin Wüstholz, Fuyuan ZhangFSE 2020 · 51 citations
- Generative type-aware mutation for testing SMT solversJiwon Park, Dominik Winterer, Chengyu Zhang, Zhendong SuOOPSLA 2021 · 31 citations
Related papers
- SMT2Test: From SMT Formulas to Effective Test CasesChengyu Zhang, Zhendong SuOOPSLA 2024 · 5 citations
- MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler InfrastructureHaoyu Wang, Junjie Chen, Chuyue Xie, Shuang Liu et al.ASE 2023 · 16 citations
- NNSmith: Generating Diverse and Valid Test Cases for Deep Learning CompilersJiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan et al.ASPLOS 2023 · 90 citations
- DafnyMPI: A Dafny Library for Verifying Message-Passing Concurrent ProgramsAleksandr Fedchin, Antero Mejr, Hari Sundar, Jeffrey S. FosterPOPL 2026 · 1 citation
- D-Helix: A Generic Decompiler Testing Framework Using Symbolic DifferentiationMuqi Zou, Arslan Khan, Ruoyu Wu, Han Gao et al.USENIX Security 2024 · 14 citations
