arXiv:2611.12338cs.SENov 2026

Manuscript Offprint

arXiv:2611.12338

From Formal Methods to Fuzzing and Back

Alastair F. Donaldson

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

For the first twelve years of my career in computer science I mainly worked on formal methods. I had been drawn to the field as an undergraduate by its promise of a way to build software with strong, mathematically based correctness guarantees. But after many years of struggling to make formal methods scale, I was seduced by randomised testing—also known as fuzzing. Fuzzing is much less principled than formal methods, but it just works: it can be readily applied to very large systems, and it is extremely effective at finding real bugs that developers care about and fix. In this personal account I trace my path from formal methods to fuzzing, by way of the GPUVerify project on verifying GPU kernels and the GraphicsFuzz project on randomised testing of GPU compilers. I argue that the oracle problem provides an intellectual link between fuzzing and formal methods, describe my continuing, targeted uses of formal methods in the domain of GPU programming language design, and discuss work at the boundary between formal methods and fuzzing. Finally, I reflect on whether generative AI might be the missing ingredient that allows formal methods to scale, and set out my plans for large-scale formal methods via the Keystone project, through which my collaborators and I aim to find out how much of that promise can be realised in practice.

2012 ACM Subject Classification Software and its engineering → Formal software verification

Keywords and phrases Formal methods, software testing, fuzzing, model checking, SMT, proof assistants, agentic AI

Category Invited Talk

1 Introduction

I first encountered formal methods in the penultimate year of my Bachelor's degree at the University of Glasgow, through a course entitled "Professional Software Development". Taught by the late Professor Ray Welland, the course mainly focused on software engineering processes, covering topics such as requirements elicitation, project management, legacy systems and re-engineering. While interesting and practical, the material did not feel like core computer science: little about it was mathematical or precise. But at the very end of the course, Professor Welland gave two lectures about the Z notation [16], and I got a glimpse into something that seemed much more satisfying: the idea of using a mathematical formalism to precisely specify properties of software. Then, in my final year, I took "Modelling Reactive Systems", a course on model checking taught by Professor (and now Dame) Muffy Calder. This was even better! We learned how to describe a distributed protocol in a formalism very close to source code (Promela), express desired properties of the protocol in logic (LTL), feed both to the SPIN model checker [49] and—quick as a flash—get an execution trace demonstrating that the protocol did not conform to the specification (indicating a bug in one or the other). I was hooked. Upon graduating, I embarked on a PhD in formal methods.

I worked primarily on formal methods from 2003 to 2015 as a PhD student, postdoc and early career faculty member. But although I learned a lot and had a lot of fun in the process, there was always an elephant in the room: the real-world impact of formal methods was very limited. Despite islands of success (examples including Microsoft's Static Driver Verifier [4], the seL4 verified OS kernel [55] and the CompCert verified compiler [62]), in general it turned out to be difficult to make formal methods scale. The lack of formal methods impact would occasionally be called out explicitly. I recall a fellow PhD student at Glasgow bluntly telling me: "you know, nobody is ever going to use this stuff". When I was a postdoc at Oxford, a colleague's advice was: "if you want to have impact, change field" (this colleague also worked on formal methods, and was at peace with the idea of not having impact). As an early career faculty member at Imperial, one of my PhD students was chided by another student (in jest, but almost accurately) about there being nearly as many co-authors on one of our papers as there were lines of code in the program the paper sought to formally verify!

From around 2014 I started experimenting with randomised testing, also known as fuzzing. I was quickly seduced by the fact that fuzzing just works. I felt, first-hand, the thrill of being able to find real bugs in industry-scale software projects spanning millions of lines of code—bugs that developers quickly confirmed and fixed. This was the kind of impact I had been yearning for, and over the last decade my work has mainly focused on software testing and fuzzing, including founding a company, GraphicsFuzz Ltd., that was acquired by Google.

Still, despite the practical satisfaction that fuzzing brings, I find formal methods more fundamentally interesting. Fuzzing takes a "suck it and see" approach, where the worth of an idea is judged by its ability to find bugs. But there is nothing fundamental about finding bugs: whether one finds bugs in a system under test (SUT) is as much a function of how reliable the SUT is (including the extent to which the SUT has already been hardened by previous fuzzing campaigns) as it is a function of how smart and rigorous the current fuzzing strategy is. And ultimately, fuzzing provides no guarantees; Dijkstra famously stated the obvious fact: "Program testing can be used to show the presence of bugs, but never to show their absence!" [34]. So, I never fully left formal methods: I kept working on problems where scale is not a blocker, such as using formal methods to improve the rigour of GPU programming language semantics, as well as working at the intersection of the two fields, using formal methods as a basis for randomised testing, and bringing fuzzing techniques to bear on formal methods tools.

But now, in 2026, it seems that formal methods might finally have their day, thanks to the artificial intelligence revolution. Large language models (LLMs) are shockingly good at producing the mathematical artifacts—such as invariants and proofs—that formal methods demand and that humans struggle to grapple with. Furthermore, they can produce these directly in formal notation, e.g. writing proofs for proof assistants such as Lean and Rocq. And, better still, the outputs of LLMs do not need to be trusted when used in many formal methods contexts: they can be independently and rigorously checked by (non-AI-based) proof checkers—a marriage made in heaven! While LLM capabilities have ballooned month-on-month over the last four years, my experience is that the frontier models of late 2025 (for me, Claude Opus 4.5) marked a step change in capability with respect to formal proof; enough of a step change that formal methods projects that would traditionally have required heroic efforts that few would dare undertake might soon become mainstream. My first direct taste of this came via a project where I used Lean (with which I had no prior experience) to prove a result connecting randomised generation of structured data with the languages accepted by Turing machines [79]. Despite my lack of prior experience, AI enabled me to make very rapid progress on what turned out to be a sizeable proof [37]. Inspired by this, I have recently embarked on Keystone [40], a collaboration between Imperial College London and EPFL, funded by the UK's Advanced Research and Invention Agency (ARIA), on using AI and proof assistants to construct formally verified software, with a particular focus on creating formally verified infrastructure for serving LLMs.

This article is a personal account and reflection on my experience working in and moving between the formal methods and software testing fields. The examples I give, and the formal methods and fuzzing techniques I discuss, are thus heavily influenced by my own experience. Throughout, I consider formal methods applied to software, though some of the points made apply equally well to hardware verification, and some of the remarks about scaling proofs may be relevant to the use of proof assistants in mathematics.

In the rest of this article I elaborate on:

  • the scalability challenges that have hindered the practical impact of formal methods (Section 2);

  • my experience wrestling with these challenges in the GPUVerify project on formal verification for GPU kernels (Section 3);

  • my move from formal methods to fuzzing, which led to the GraphicsFuzz project, with some thoughts on why the oracle problem provides an intellectual link between the two fields (Section 4);

  • my continued work on “small scale” formal methods, in the context of GPU programming language semantics (Section 5);

  • my work at the intersection of formal methods and fuzzing (Section 6);

  • the opportunities that the AI revolution brings for formal methods, and the Keystone project through which my collaborators and I plan to explore them (Section 7).

If your background brings to mind different examples or experiences that either support or run counter to the points I make in this article, I would love to hear from you.

References (75)